• Resolved olstadesigns

    (@olstadesigns)


    Hi all,

    I am trying to get my head around why the is_product_category conditional tag is not working for me in the archive-products.php file.

    I am wanting to hide some hooks (ie: Afterpay Info) on category listing and single product pages for the product Group Buys (group-buys). I have it working for single products pages but I have put the code below in the archive-product.php file and nothing happens.

    if (is_product_category( 'group-buys' ))
            { wc_get_template_part( 'content', 'product-group-buys' ); } 
    else    { wc_get_template_part( 'content', 'product' ); }

    Funily enough if I change this to

    if (is_product_category( 'group-buys' ))
            { wc_get_template_part( 'content', 'product-group-buys' ); } 
    else    { wc_get_template_part( 'content', 'product-group-buys' ); }

    then it works but obviously for all categories so this tells me the conditional isn’t working. My category slug is group-buys and the ID is 2887

    Any assistance here would be greatly apreciated. Thanks

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘archive-product.php Modifications / Customisation’ is closed to new replies.