Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // WooCommerce - Show shipping class on product pages
- // code goes in functions.php for your child theme above add-to-cart button
- add_action( 'woocommerce_single_product_summary', 'show_shipping', 35 );
- function show_shipping() {
- global $product;
- $class_id = $product->get_shipping_class_id();
- if ($class_id) {
- $term = get_term_by( 'id', $class_id, 'product_shipping_class' );
- echo '<p class="shipping_class">Shipping class: '.$term->name.'</p>';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement