Display sku in category woo page - by stavroch

This topic has 4 replies, 3 voices, and was last updated 9 years, 9 months ago ago by Robert Hall

  • Avatar: stavroch
    stavroch
    Participant
    March 16, 2016 at 14:58

    How can I display the sku of each product in category woo commerce page?

    3 Answers
    Avatar: Eva
    Eva Kemp
    Participant
    March 16, 2016 at 16:12

    Hello,

    You need add this code in functions.php file:

    add_action( 'woocommerce_after_shop_loop_item', 'custom_shop_item', 5);
    function custom_shop_item() {
    	global $post, $product;
    	/* product sku */
    	echo '<p>SKU: '.$product->get_sku().'</p>';
    }

    Regards,
    Eva Kemp.

    Avatar: stavroch
    stavroch
    Participant
    March 16, 2016 at 21:24

    thank u. u fix it!

    Avatar: Robert Hall
    Robert Hall
    Participant
    March 16, 2016 at 21:43

    Hello,

    You’re welcome!

    Regards,
    Robert Hall

  • Viewing 4 results - 1 through 4 (of 4 total)

The issue related to '‘display sku in category woo page’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.