Skip to content

Price and VAT are cleared on parent product when price of new created variant is changed #2973

@80Quattro

Description

@80Quattro

Steps to reproduce:

  • Add a product and set its price
  • On CoreShopProduct set "allowInherit" and "allowVariants" to true
  • Add a product variant and change its price
  • The price of parent product will be set to 0

This appears to be a regression of #1486
This patch fixed the issue previously in CoreShop 2.2: https://github.com/coreshop/CoreShop/pull/1491/files

In the current version I've replaced the $storeValuesEntity = clone $storeValuesEntity; with $storeValuesEntity = new ProductStoreValues() and it seems to work correctly in my local environment. However, I don’t fully understand why "clone" doesn't work as expected.
I’m also not sure what the consequences might be if a completely new ProductStoreValues instance is created.

I can create a PR if my changes make sense.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions