And what name should I enter in: case ‘free-shipping’
When I enter my name it doesn’t work. e.g:
function etheme_child_product_shipping_banner() {
global $product;
$shipping_class = $product->get_shipping_class();
switch ( $shipping_class ) {
case 'free-shipping':
echo 'Free shipping on this item';
break;
case 'flat-rate':
echo 'Flat rate shpping $10';
break;
}
}
add_action('woocommerce_before_single_product', 'etheme_child_product_shipping_banner', 20 );
Or maybe it can be done with a static block or custom html code in single product builder?
https://prnt.sc/5HHAnUsAUqxI