-
Notifications
You must be signed in to change notification settings - Fork 299
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
Refactor OptionFields / SHOP_OPTION_TYPE_CHOICES #232
Comments
I vaguely recall the main reason being around the number of SQL queries performed when generating the dropdown lists of product options to choose from on the product page, but I couldn't say for certain - the design is 6 years old now. You'll also see in I think what needs fixing here is somewhat broader - basically we shouldn't be adding a variable number of database columns based on So I don't think trying to fix this for translations' sake is worth the effort, given the larger problem which should be addressed - perhaps if that was done, the translation problems would be resolved too, I'm really not sure. |
I am presently working on support for dynamic product variations for a |
Awesome Sam, thanks! |
There are a few things that probably should be discussed in terms of Anyway - I have some thoughts as to how it should work - I will open an |
I just renamed this issue which we can use to track the broader task of refactoring here. |
Well look at that, I thought this was on the mailing list, I never noticed it was an existing issue (have been email replying until now). Thanks Stephen, will keep you all updated. |
I'm really interested in this as well. Sam, if you have made some progress on it I'd be willing to chip in. |
I am still working on it - slowly. Will post more soon and we can see what else needs to be done. Thanks |
I’m wondering why the
option%s
fields created in theProductVariationMetaclass
areOptionField
s instead ofForeignKey
s. What is the historical reason behind this?It has always bothered me that changes on existing
ProductOption
s are not reflected in existingProductVariation
s. I understand thatProductOption
s are not really meant to be changed after creation but correcting typos or making one more precise when creating a similar one (e.g.green -> light green
when creatingdark green
) are use cases where one would like the change to automatically reflect on existingProductVariation
s.A second drawback is that it triggers a modeltranslation issue when a
ProductOption
is not fully translated and is chosen for a variation. See deschler/django-modeltranslation#286.Changing the
OptionField
s intoForeignKey
s in theProductVariationMetaclass
would resolve both. But might be a mess to migrate (I’m not really into this kind of things, so I don't really know).What are your views on this, is it worth trying to make the change?
The text was updated successfully, but these errors were encountered: