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

Variable product #33

Open
fillobotto opened this issue Nov 12, 2022 · 1 comment
Open

Variable product #33

fillobotto opened this issue Nov 12, 2022 · 1 comment

Comments

@fillobotto
Copy link

I wasn't able to create a Product with type variable (like you do with REST API) and its corresponding product variations based on one or more Attributes/Taxonomies. Is there an example for that?

@alagaccia
Copy link

$term_slug = 'variable';

$taxonomy = ProductType::whereHas('term', function($q) use ($term_slug) {
   $q->where('slug', $term_slug);
})->first();

$youProductModel->productTypes()->syncWithoutDetaching($taxonomy->term_taxonomy_id);

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

No branches or pull requests

2 participants