[Resolved] product number visible on categories and home page

Home Forums Support [Resolved] product number visible on categories and home page

Home Forums Support product number visible on categories and home page

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1969833
    Ceramica Sud Curlante

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

    #1969932
    Ying
    Staff
    Customer Support

    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?

    #1970339
    Ceramica Sud Curlante

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

    http://www.ceramicasud.com

    #1970345
    Elvin
    Staff
    Customer Support

    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.

    A wise man once said:
    "Have you cleared your cache?"

    #1970368
    Ceramica Sud Curlante
    #1970369
    Ceramica Sud Curlante

    the link shows my old site

    #1970379
    Elvin
    Staff
    Customer Support

    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. ๐Ÿ™‚

    A wise man once said:
    "Have you cleared your cache?"

    #1971533
    Ceramica Sud Curlante

    Ok it works!

    Tell the wise man that I have updated the chache.

    #1971571
    Elvin
    Staff
    Customer Support

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

    A wise man once said:
    "Have you cleared your cache?"

    #1971644
    Ceramica Sud Curlante

    you have solved everything.

    I am only waiting for an answer to this request:

    https://generatepress.com/forums/topic/question-on-menu-with-photographic-icons/#new-post

    #1974050
    Elvin
    Staff
    Customer Support

    Thanks for letting us know. Marking this topic resolved. Let’s continue to the other topic. ๐Ÿ˜€

    A wise man once said:
    "Have you cleared your cache?"

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.