Site logo

Archived topic

product number visible on categories and home page

10 replies · Started by Ceramica Sud Curlante on October 20, 2021

Viewing posts 1–11 of 11

Is it possible to make the product number visible on categories and home pages?

Hi there,

I'm not sure I fully understand your question, is there any examples we can refer to?

And can you link us to the site in question as well?

inside the home page see product previews I would like the product number I mean the product code

http://www.ceramicasud.com

Hi there,

Can you specify which part of the product card on the list do you want the product code to be added into?

Perhaps share a mockup image of how you want things to be laid it? So we can use it for reference in deciding which hook to use for insertion of product code.

the link shows my old site

Thanks.

Try adding this PHP snippet to your site:

add_action('woocommerce_shop_loop_item_title', function(){
    global $product;
    if(is_front_page() || is_shop() || is_product_category()) {
        echo $product->get_sku();
    }
}, 11);

Here's how to add PHP snippets - https://docs.generatepress.com/article/adding-php/

It's basically a choice between using a child theme's functions.php or using Code Snippets plugin. :)

Ok it works!

Tell the wise man that I have updated the chache.

Have you fully sorted it out? Let us know if you need further help. (in case it needs CSS styling/layout)

Thanks for letting us know. Marking this topic resolved. Let's continue to the other topic. :D

This archived topic is closed to new replies.