Last active
March 27, 2020 09:25
-
-
Save daveloodts/dbcabc8187facb58c847f036bcc152af to your computer and use it in GitHub Desktop.
Display a custom text under cart item name in checkout #woocommerce #shipping
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
// Display a custom text under cart item name in checkout | |
add_filter( 'woocommerce_checkout_cart_item_quantity', 'custom_checkout_text_cart_item_name', 10, 3 ); | |
function custom_checkout_text_cart_item_name( $item_qty, $cart_item, $cart_item_key ) { | |
// Here below define your shipping class slug | |
$shipping_class = 'be-shipping-klein'; | |
if( $cart_item['data']->get_shipping_class() === $shipping_class ) { | |
$item_qty .= '<br /><div class="item-shipping-class">' . __("Gratis geleverd 2-4 werkdagen", "woocommerce") . '</div>'; | |
} | |
return $item_qty; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment