You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refer to craftcms/feed-me#493, but creating a brand new Product with multiple Variants, doesn't seem to set its defaultVariantId value. Subsequently re-saving the product will fix it right up. I'm ensuring that at least one variant has the 'default' switch on (near the matrix-like actions on the right-hand side).
I imagine its to do with the implementation here, where you're indeed sending an SQL update to correctly update the product - but it'll do nothing if the variant has null for an ID - which is what happens for a new variant.
I can see shortly after this code you're saving the variant. Would it be prudent to move this SQL update after the variant has been saved, therefore has an ID?
Additional info
Craft version: 3.1.17
PHP version: 7.0.31
Database driver & version: MySQL
Plugins & versions: Commerce 2.1.0.2
The text was updated successfully, but these errors were encountered:
Description
Refer to craftcms/feed-me#493, but creating a brand new Product with multiple Variants, doesn't seem to set its
defaultVariantId
value. Subsequently re-saving the product will fix it right up. I'm ensuring that at least one variant has the 'default' switch on (near the matrix-like actions on the right-hand side).I imagine its to do with the implementation here, where you're indeed sending an SQL update to correctly update the product - but it'll do nothing if the variant has null for an ID - which is what happens for a new variant.
I can see shortly after this code you're saving the variant. Would it be prudent to move this SQL update after the variant has been saved, therefore has an ID?
Additional info
The text was updated successfully, but these errors were encountered: