S
S
smash_wp2015-09-26 19:38:46
Blogs
smash_wp, 2015-09-26 19:38:46

How to display category products in a specific woocommerce template?

In general, there are 5 categories of products (Metal tiles, corrugated board, etc.). Actually, the 5th category is "Other materials for roofing". It has several subcategories, but it doesn't matter.
What is the point, when we select a certain category of goods, for example "Metal tile", we display goods from this category, and under these goods, a block should be displayed where there will be goods from the aforementioned category "Other roofing materials". How to implement it correctly?
If possible, explain in more detail, because I haven’t figured out WooCommerce yet, but the project already needs to be done, and I only know the basics from PHP...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WP Panda, 2015-09-27
@smash_wp

a regular query through WP_Query with these parameters

$array = array('post_type' = > 'product',
'tax_query' = array(
array(
'taxonomy' => 'product_cat',
'field' = > 'term_id/slug/name ',
'terms' = 'id/slug/name'
)
)
);

taxonomies and post types WooCommerce
tax_query

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question