woocommerce
woocommerce copied to clipboard
vendor model and it's relationship
Vendors own the products, a person may be the author of the product but it belongs to someone else (vendor).
use:
$vendorId = 1;
Product::published()
->whereHas('vendor', fn($query) => $query->where('term_relationships.term_taxonomy_id', $vendorId));
Thanks @Hebrahimzadeh for your PR! Can you elaborate something about this change? I haven't used WooCommerce in some time and I am not familiar with what Vendor in that ecosystem is.
@Dartui Glad to help. I briefly explained.