Skip to content

Commit

Permalink
Merge pull request #1528 from craftcms/bugfix/1525-importing-new-variant
Browse files Browse the repository at this point in the history
when variant is new, set the product on it (that'll set ownership)
  • Loading branch information
angrybrad authored Oct 9, 2024
2 parents 34f2eda + dd152fc commit bd41a40
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/elements/CommerceProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ private function _parseVariants($event): void
// Create a new variant, or find an existing one to edit
if (!isset($variants[$sku])) {
$variants[$sku] = new VariantElement();
$variants[$sku]->product = $element;
}

// We are going to handle stock after the product and variants save
Expand Down

0 comments on commit bd41a40

Please sign in to comment.