Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vendor model and it's relationship #36

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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