commerce icon indicating copy to clipboard operation
commerce copied to clipboard

[4.x]: Can't add new lineitem in cp if the purchasable has a min amount set

Open samuelbirch opened this issue 2 years ago • 0 comments

What happened?

If a purchasable has minimum allowedQty set, then when trying to add it via a cp order (add new lineitem) it returns an error.

A generic "couldn't recalculate order" is seen in the ui, but viewing the request shows that the actual error is because the default qty of 1 (when adding via the cp) is less than the minimum qty.

Steps to reproduce

  1. create a purchasable with the minimum allowedQty set to greater than 1.
  2. Try to add that purchasable in a cp order.

Expected behavior

I would expect it to add the purchasable with the minimum allowedQty set as the lineitem qty

Actual behavior

errors.

Craft CMS version

4.2.3

Craft Commerce version

4.1.1

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

samuelbirch avatar Sep 07 '22 13:09 samuelbirch