I am currently working on a WordPress website, with the preferred eCommerce platform being WooCommerce.

At present, I am putting together a series of if statements, as to call sections of code, depending on which Product a visitor lands on. I am aware of how to ‘target’ individual Products as well as Product Category Archives but is there a way to ‘target’ all Products within a certain Category? All I have at present, for this particular task, is the following code:

    if (is_product_category( 'product-category-a' )){
        get_template( 'templates/template-a' )

Any help on whether this is actually possible, and on what modification would be required, would be greatly appreciated.

Read more here: How do I target all Products within a Category, when it comes to Conditional Logic?


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: