commerce icon indicating copy to clipboard operation
commerce copied to clipboard

[4.x]: Altered unit price for lineItem resets after recalculating order

Open nilsenpaul opened this issue 1 year ago • 0 comments

What happened?

Description

One of our clients needed a way to use 'variable' products from within Commerce's control panel. To facilitate this, we added a product with a €0,- price. Once the order has been completed (somehow this is not allowed before order completion), the client can alter the price for the line item. So far, so good.

Now, two things happen:

  • The tax for that line item does not get set automatically, but has to be entered by the client, even though the product has a 21% tax rate.
  • Whenever the client chooses to recalculate the order, the lineItem price gets reset to €0,-.

Steps to reproduce

  1. Create a product with a tax category, and set its price to €0,- / $0,-
  2. Create a new order from the CP, add the product and then complete the order
  3. Edit the lineItem and set the price to €20,- (notice how no tax is added to the lineItem)
  4. Recalculate the order and see how the price gets reset to €0,-

Expected behavior

  1. I'd expect the tax input to be automatically set to the right tax amount
  2. I'd expect the altered price to stay altered whenever the order is recalculated

I can use an adjuster to add the tax myself, but not if the price is reset on recalculation.

https://github.com/craftcms/commerce/assets/6794819/3d14d686-9089-4bb7-9df6-c2fe8e9ff6db

Craft CMS version

4.5.13

Craft Commerce version

4.3.3

PHP version

8.0

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

No response

nilsenpaul avatar Jan 10 '24 08:01 nilsenpaul