Updated to Commerce 3, and now when i create a node with product reference field, the dimensions and weight are missing from the product variation.
Product uses the "Inline Entity Form - Complex" widget
Product Variation uses the "commerce_product_single_variation" aka "Single variation (Product information)" widget
Weight and Dimensions use Default widget
Confusingly, the dimensions and weight show up for product variants that already existed before Commerce 3 update.
Only product variant forms for variants created after updating to Commerce 3 are missing these widgets.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | commerce-do_not_change_variation_types_on_update-3535297-4.patch | 962 bytes | aaronbauman |
Issue fork commerce-3535297
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
aaronbaumanComment #3
aaronbaumanOK, i traced the culprit to
commerce_product_update_10301, which according to docblock :Problem was that my "variationType" was set to "default", but "variationTypes" was set to "shippable" (and shippable only).
So, after updating, "variationType" is gone, and variationTypes is "default" and "shippable" - not what i want!
And since it's a simple inline entity form, I guess it just uses the first value, which is not correct.
Not sure how this was resolved previously, but turning "default" off again solved it.
Comment #4
aaronbaumanHere's the patch I'm using.
I assume maintainers are not gonna want to roll this in, so I won't bother with an MR.
But it's working for me.
Comment #5
jsacksick commentedhm, no this change doesn't make sense? I think what we should probably do instead is not touch the variationTypes if it is set... Can you open an MR doing this?
We only migrate the values if variationType is set but variationTypes is empty?
Comment #6
jsacksick commentedRetitling, working on that.
Comment #9
jsacksick commentedWent ahead and committed the amended update hook which now sets the variation type IDS only if the "variationTypes" setting is empty.
Comment #10
aaronbaumanThanks, that change makes sense to me and should address my use case.
Not sure how or why variationTypes and variationType contained different values previously, but this should fix it.