Skip to content
New issue

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

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

Already on GitHub? # 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);

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants