WC Displaying only product with given id in archive page

I’ve created a button that’s collecting product_ids to the array. Now i want to display the shop page with only products that are contained in array.

$product_ids = [“1″,”2″,”3″,”4″,”5”];

I think that i need redirect my site to the shop page and hook into product_loop but i don’t have any idea how it works.

How should this function looks like?

Read more here:: WC Displaying only product with given id in archive page

Leave a Reply

Your email address will not be published. Required fields are marked *