From 2e01f5d2807c70baac6354c3482aa3a84403e838 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 15:35:59 +0000 Subject: [PATCH 1/2] Initial plan From 0bdf313472687d4fc0c050efd610122b3743def1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 15:42:31 +0000 Subject: [PATCH 2/2] Fix parent product price being cleared when variant price is changed Replace clone of ProductStoreValues with new instance creation via factory to prevent shared Doctrine identity (ID) from causing the parent's database record to be updated when persisting the variant's store values. Fixes the regression where changing a variant's price would reset the parent product's price and VAT to 0. Co-authored-by: dpfaffenbauer <5981845+dpfaffenbauer@users.noreply.github.com> --- .../Bundle/CoreBundle/CoreExtension/StoreValues.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/CoreShop/Bundle/CoreBundle/CoreExtension/StoreValues.php b/src/CoreShop/Bundle/CoreBundle/CoreExtension/StoreValues.php index 3a944e2c7b..e53cb58cd8 100644 --- a/src/CoreShop/Bundle/CoreBundle/CoreExtension/StoreValues.php +++ b/src/CoreShop/Bundle/CoreBundle/CoreExtension/StoreValues.php @@ -448,9 +448,13 @@ public function save(Localizedfield|\Pimcore\Model\DataObject\Fieldcollection\Da //This means that we inherited store values and also changed something, thus we break the inheritance and //give the product its own record if (count($changeSet) > 0) { - $productStoreValue = clone $productStoreValue; - $productStoreValue->setProduct($object); - $productStoreValue->setFieldName($this->getName()); + $newStoreValue = $this->getFactory()->createNew(); + $newStoreValue->setStore($productStoreValue->getStore()); + $newStoreValue->setPrice($productStoreValue->getPrice()); + $newStoreValue->setTaxRule($productStoreValue->getTaxRule()); + $newStoreValue->setProduct($object); + $newStoreValue->setFieldName($this->getName()); + $productStoreValue = $newStoreValue; } } else { $productStoreValue->setProduct($object); @@ -669,7 +673,7 @@ public function getDataFromEditmode($data, $object = null, $params = []): mixed } if ($storeValuesEntity instanceof ProductStoreValuesInterface && $storeValuesEntity->getProduct() && $storeValuesEntity->getProduct()->getId() !== $object->getId()) { - $storeValuesEntity = clone $storeValuesEntity; + $storeValuesEntity = $this->getFactory()->createNew(); $storeValuesEntity->setProduct($object); $storeValuesEntity->setFieldName($this->getName()); }