I’m using WooCommerce and it has a lot of plugins to handle different stuff.
The one thing needed by the client that no other plugin manages correctly is which variations can be visible for each user role.
So what is happening on the website is that we’re having 6 different roles for registered users and each of them can see only some of the variation of each product.
The following code manages the showing of the variation in the product page and whenever the
$product->get_children() method is called.
This all works, but whenever I filter the products by the variation attribute, I also see products that have that variation even if that variation is not available for the given product.
To solve this problem I tried the following code:
Which should filter the product based on the said meta values, but the problem is that the query only works for the main products and not the children/variations.
So what I’d need to do is using that
meta_query to get the products based on the children meta… is it even possible?
- Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
- Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
- Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.
Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com