最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

categories - How to show given products only using product id array from specific category page in woocommerce

programmeradmin0浏览0评论

I would like to show only the list of product ids in the tax query using woocommerce_product_query filter.

So I need to add an additional filter along with a tax query to filter to show only products with given ids.

$tax_query[] = array('add filter to show only specified products');
$q->set( 'tax_query', $tax_query );

Thanks

I would like to show only the list of product ids in the tax query using woocommerce_product_query filter.

So I need to add an additional filter along with a tax query to filter to show only products with given ids.

$tax_query[] = array('add filter to show only specified products');
$q->set( 'tax_query', $tax_query );

Thanks

Share Improve this question edited Nov 25, 2020 at 10:08 Ivan Shatsky 8901 gold badge7 silver badges12 bronze badges asked Nov 25, 2020 at 7:54 prajoshprajosh 11 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

Maybe I somehow misunderstood your question, but you don't need the tax_query for that, just use the

$ids = array( <ID1>, <ID2>, ... );
$q->set( 'post__in', $ids );
发布评论

评论列表(0)

  1. 暂无评论