I am using woocommerce_review_order_after_cart_contents hook to display some custom text on the checkout page but the following code entered into functions.php prints the message twice on the checkout page:
/**
* Add Custom Shipping Message to the checkout
**/
add_action('woocommerce_review_order_after_cart_contents', 'shipping_message');
function shipping_message() {
echo 'Heavy parcels to the Highlands, Scottish Islands and Channel Islands may require an additional shipping surcharge.';
}
I have tested the above with twenty twelve theme and all plugins deactivated except WooCommerce.
WooCommerce 2.1.0
WooCommerce 2.2.0
WooCommerce 2.2.11
WooCommerce 2.3.7
https://woothemes.zendesk.com/agent/tickets/272307
@seanreloaded @mikejolley @ChromeOrange
Use:
add_action('woocommerce_review_order_after_cart_contents', 'shipping_message');
function shipping_message() {
if ( ! is_ajax() ) {
echo 'Heavy parcels to the Highlands, Scottish Islands and Channel Islands may require an additional shipping surcharge.';
}
}
Ref #7226
Most helpful comment
Use:
Ref #7226