-
Notifications
You must be signed in to change notification settings - Fork 372
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
Feat - Variant Generation #1488
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
If there are no shared options, it just shows an empty dropdown list. Maybe we should show a message to say they don't have any set-up? |
I don't think we need to say "Restricted" in the add option button, I think that's implied by having "shared" on the other button. |
Once variants have been generated (and saved), you can't delete any. |
This suggests that a shared option has already been used, but I don't have any. Maybe we just remove the "more" word? |
Thanks for the heads up! |
If I remove all options and save the variants, I have to refresh to get the side menu to show all the sections again. |
packages/admin/src/Support/Actions/Products/MapVariantsToProductOptions.php
Outdated
Show resolved
Hide resolved
… feat/variant-editing # Conflicts: # packages/admin/src/Filament/Resources/ProductResource/Widgets/ProductOptionsWidget.php
@alecritson the introduction of |
@wychoong This is to make it A) Easier to fetch which options a product has and B) Because we now have local product options which can be specific to a product. Before you would have to load all variants a product has, load all their product option values, fetch the option itself and then dedupe them it was quite the adventure. Now it can be simplified as such: $productOptions = $product->productOptions()->with([
'values' => function ($query) use ($product) {
$query->whereHas('variants', function ($relation) use ($product) {
$relation->where('product_id', $product->id);
});
},
])->get(); |
Noted. Mainly is because I have a process that create products outside of the provided product page. So now I need to update my code to cater insert to product_product_option, else it won’t show the variants in panel |
@alecritson Could you have a look in the morning please? |
@ryanmitchell Are you able to provide some steps on how to reproduce this one? I've added a loom video showing what I did and it seemed to generate the variants fine 🤔 |
@alecritson thanks for looking, you're right, it works fine when there is a base variant. The issue comes when you remove the base variant and try to add another. Maybe its not something you need to handle, but clients do strange things. |
This PR looks to add variant generation to the filament hub. This isn't a port of the current offering in
0.7
but is instead a complete reimagining of how it should work, inspired by some other popular systems out there.