This file contains hidden or 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
<?php | |
add_filter( 'woocommerce_no_shipping_available_html', 'my_custom_no_shipping_message' ); | |
add_filter( 'woocommerce_cart_no_shipping_available_html', 'my_custom_no_shipping_message' ); | |
function my_custom_no_shipping_message( $message ) { | |
return 'Custom No Shipping Method Message'; | |
} | |
?> |
This file contains hidden or 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
<?php | |
add_filter( 'woocommerce_package_rates', 'custom_shipping_costs_and_vat', 20, 2 ); | |
function custom_shipping_costs_and_vat( $rates, $package ) { | |
foreach( $rates as $rate_key => $rate ){ | |
$rates[$rate_key]->cost = 5; // Replace with your own shipping cost | |
$taxes = array(); | |
foreach ($rates[$rate_key]->taxes as $key => $tax){ | |
if( $rates[$rate_key]->taxes[$key] > 0 ) | |
$taxes[$key] = 1; // Replace with your own tax rate |
This file contains hidden or 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
<?php | |
add_filter('woocommerce_cart_shipping_method_full_label', 'custom_shipping_method_label', 10, 2); | |
function custom_shipping_method_label( $label, $method ){ | |
switch ( $method->instance_id ) { | |
case '7': // Replace with your own shipping method id | |
$text = '<br /><small>' . __('Add Method Description') . '</small>'; | |
break; | |
default: | |
$text = ''; |
This file contains hidden or 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
<?php | |
add_filter( 'woocommerce_return_to_shop_redirect', 'wc_custom_shop_redirect_url' ); | |
add_filter( 'woocommerce_continue_shopping_redirect', 'wc_custom_shop_redirect_url' ); | |
function wc_custom_shop_redirect_url() { | |
return '/new-slug/'; | |
} | |
?> |
This file contains hidden or 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
<?php | |
add_action( 'woocommerce_before_calculate_totals', 'remove_matched_coupons' ); | |
function remove_matched_coupons() { | |
$coupon_code = 'renewal20'; // Replace with your own coupon code | |
if ( ! WC()->cart->has_discount( $coupon_code ) ) return; | |
// REMOVE COUPON WITHOUT ANY CONDITIONS | |
WC()->cart->remove_coupon( $coupon_code ); | |
wc_clear_notices(); |
This file contains hidden or 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
<?php | |
add_action( 'woocommerce_before_cart', 'apply_matched_coupons' ); | |
function apply_matched_coupons() { | |
$coupon_code = 'renewal20'; // Replace with your own coupon code | |
if ( WC()->cart->has_discount( $coupon_code ) ) return; | |
// APPLY COUPON WITHOUT ANY CONDITIONS | |
WC()->cart->apply_coupon( $coupon_code ); | |
wc_print_notices(); |
This file contains hidden or 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
<?php | |
add_filter( 'woocommerce_cart_item_thumbnail', '__return_false' ); | |
?> |
This file contains hidden or 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
<?php | |
add_filter( 'woocommerce_order_item_permalink', '__return_false' ); | |
?> |
This file contains hidden or 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
<?php | |
add_filter( 'woocommerce_cart_item_permalink', '__return_null' ); | |
?> |