woocommerce icon indicating copy to clipboard operation
woocommerce copied to clipboard

vendor model and it's relationship

Open Hebrahimzadeh opened this issue 1 year ago • 2 comments

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));

Hebrahimzadeh avatar Jul 11 '23 06:07 Hebrahimzadeh

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 avatar Jul 11 '23 08:07 Dartui

@Dartui Glad to help. I briefly explained.

Hebrahimzadeh avatar Jul 16 '23 13:07 Hebrahimzadeh