#3089040: Single product with multiple variation types added the ability to leverage multiple variation types for a single product type. However, if there are pre-existing products for a given product type, the Variations section is greyed out with the message "Products exist for this product type, you can no longer edit this setting."

Ideally we'd be able to add additional variation types to these "locked" product types. This would likely mean disabling/making the readonly the checkboxes for previously selected variations as opposed to disabling the entire field. Since this feature is not (to my knowledge) provided by core, we might need to add a dependency on something like Form Options Attributes unless there's another way to do it.

CommentFileSizeAuthor
#3 3270838-3.patch2.96 KBjsacksick

Comments

mrweiner created an issue. See original summary.

mrweiner’s picture

Just a note that I enabled the field via form_alter and added some extra options for one of these product types. On first review, nothing seems to be broken, but probably important to note that the next config export resulted in both the old and new variation values being present (i.e. variationType and variationMultipleTypes, or whatever the new key is). We may or may not need some handling for this.

jsacksick’s picture

Status: Active » Needs review
StatusFileSize
new2.96 KB

I've been looking into this and I actually don't see really see why we should have that restriction in place. I changed the variation types setting after I had variations of that type associated to existing products and it didn't break.

For reference the check was "loosened" as part of #3014686: Loosen the variation type disabling on the product type form because previously the setting was completely disabled if the product type wasn't new.

I double checked the code... I really don't see how it could break if the setting is changed...

  • jsacksick committed 6e6d9e8 on 8.x-2.x
    Issue #3270838 by jsacksick, mrweiner: Allow additional variation types...

  • jsacksick committed ed94de7 on 3.0.x
    Issue #3270838 by jsacksick, mrweiner: Allow additional variation types...
jsacksick’s picture

Status: Needs review » Fixed

So I've been discussing this with @rszrama and the only place where it could "break" is the product variation collection access (i.e the variations list). So for example if a previously selected variation type is unchecked, but a product still references variations of that type, a customer with the permission to manage variations of the type unchecked won't be able to access the "variations" tab, I think we can live with that and simply document this.
Committed!

mrweiner’s picture

Great, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.