mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
https://stackoverflow.com/questions/65541818/display-a-text-after-cart-and-checkout-totals-for-specific-countries-in-woocomme/65546876
7 lines
324 B
Text
7 lines
324 B
Text
add_filter( 'woocommerce_cart_totals_order_total_html', 'custom_total_message_html', 10, 1 );
|
|
function custom_total_message_html( $value ) {
|
|
if( in_array( WC()->customer->get_shipping_country(), array('US', 'CA') ) ) {
|
|
$value .= '<small>' . __('My text.', 'woocommerce') . '</small>';
|
|
}
|
|
return $value;
|
|
}
|