Reply 334293 to: how to add shipping class in product page

Avatar: lew-shop
lew-shop
Participant
September 16, 2022 at 13:09

my code

function etheme_child_product_shipping_banner() {
global $product;

$shipping_class = $product->get_shipping_class();

switch ( $shipping_class ) {
    case 'duze-inpost':
        echo 'Kurier';
    break;
	case 'drobnica':
        echo 'paczkomat';
    break;
}
}
add_action('woocommerce_before_single_product', 'etheme_child_product_shipping_banner', 20 );
Go To The Whole Conversation In Topic
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.