This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Replace the 'x' in WooCommerce cart.php with text because 'x' is not helpfull at all for screenreader users, see https://gist.github.com/Willem-Siebe/dc34719917e77fcecbc6. | |
function wsis_woocommerce_remove_item( $wsis_html, $cart_item_key ) { | |
$cart_item_key = $cart_item_key; | |
$wsis_html = sprintf( '<a href="%s" class="remove" title="%s"><span class="wsis-remove-item">%s</span></a>', esc_url( WC()->cart->get_remove_url( $cart_item_key ) ), __( 'Remove this item', 'woocommerce' ), __( 'Remove this item', 'woocommerce' )); | |
return $wsis_html; | |
} | |
add_filter ( 'woocommerce_cart_item_remove_link', 'wsis_woocommerce_remove_item', 10, 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Increase PHP Memory, see https://gist.github.com/Willem-Siebe/8a7d17c5f82859129f32. | |
* | |
* Please note, this has to be put before wp-settings.php inclusion. | |
*/ | |
define( 'WP_MEMORY_LIMIT', '128M' ); | |
// Administration tasks require much memory than usual operation. When in the administration area, the memory can be increased or decreased from the WP_MEMORY_LIMIT by defining WP_MAX_MEMORY_LIMIT. | |
define( 'WP_MAX_MEMORY_LIMIT', '512M' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove CSS and/or JS for Select2 used by WooCommerce, see https://gist.github.com/Willem-Siebe/c6d798ccba249d5bf080. | |
add_action( 'wp_enqueue_scripts', 'wsis_dequeue_stylesandscripts_select2', 100 ); | |
function wsis_dequeue_stylesandscripts_select2() { | |
if ( class_exists( 'woocommerce' ) ) { | |
wp_dequeue_style( 'select2' ); | |
wp_deregister_style( 'select2' ); | |
wp_dequeue_script( 'select2'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove TablePress plugin CSS in favor of using LESS from Twitter Bootstrap, see https://gist.github.com/Willem-Siebe/ba6428a1dcd6b767a818. | |
add_filter( 'tablepress_use_default_css', '__return_false' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove CSS and JS from Jetpack plugin, see https://gist.github.com/Willem-Siebe/3f6bff80b01973a21467. | |
function wsis_remove_jetpack_assets() { | |
// devicepx-jetpack.js, used to optionally load retina/HiDPI versions of files (Gravatars etc) which are known to support it, for devices that run at a higher resolution. | |
wp_dequeue_script( 'devicepx' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'wsis_remove_jetpack_assets', 20 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Add the first custom fields available in WooCommerce PDF Invoices & Packing Slips to your own custom invoice template, see https://gist.github.com/Willem-Siebe/cf8474b5ca4e72880a04. --> | |
<?php if ( $wpo_wcpdf->get_extra_1() ): ?> | |
<div id="extra1"> | |
<?php $wpo_wcpdf->extra_1(); ?> | |
</div> | |
<?php endif; ?> | |
<!-- Add the second custom fields available in WooCommerce PDF Invoices & Packing Slips to your own custom invoice template, see https://gist.github.com/Willem-Siebe/cf8474b5ca4e72880a04. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Display WooCommerce shop, category and tag description also on next pages, see https://gist.github.com/Willem-Siebe/c883eeb2eefb5eea82ab. | |
function woocommerce_product_archive_description() { | |
if ( is_post_type_archive( 'product' ) && get_query_var( 'paged' ) >= 0 ) { | |
$shop_page = get_post( wc_get_page_id( 'shop' ) ); | |
if ( $shop_page ) { | |
$description = apply_filters( 'the_content', $shop_page->post_content ); | |
if ( $description ) { | |
echo '<div class="page-description">' . $description . '</div>'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove CSS from WooCommerce after version 2.1, see https://gist.github.com/Willem-Siebe/8c29bcfa791316165127. | |
add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The return to shop button in WooCommerce empty-cart.php goes to the shop archive page. However, if we don't want a shop page and leave this option unset in WooCommerce settings, we need this button to go to our homepage. See https://gist.github.com/Willem-Siebe/c1d70aeef75a3e60ab15. | |
function wsis_woocommerce_return_to_shop_redirect() { | |
return get_home_url(); | |
} | |
add_filter( 'woocommerce_return_to_shop_redirect', 'wsis_woocommerce_return_to_shop_redirect' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Add Order number besides invoicenumber to invoice (WooCommerce PDF Invoices & Packing Slips plugin), see https://gist.github.com/Willem-Siebe/c05bd7d2938e951b54bc --> | |
<span class="order-number-label"><?php _e( 'Order Number:', 'wpo_wcpdf' ); ?></span> | |
<span class="order-number"><?php $wpo_wcpdf->order_number(); ?></span><br /> |
NewerOlder