Skip to content

Conversation

@Hebrahimzadeh
Copy link

@Hebrahimzadeh Hebrahimzadeh commented Jul 11, 2023

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

@Dartui
Copy link
Collaborator

Dartui commented Jul 11, 2023

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.

@Hebrahimzadeh
Copy link
Author

@Dartui
Glad to help.
I briefly explained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants