solidusio / solidus

🛒 Solidus, the open-source eCommerce framework for industry trailblazers.
https://solidus.io
Other
4.97k stars 1.29k forks source link

Negative order totals #2741

Closed kushniryb closed 2 years ago

kushniryb commented 6 years ago

Steps to reproduce

Create 2 separate promotions with the following configurations:

  1. Whole-order adjustment with the Flat Percent of 90
  2. Per-line-item adjustment with the Flat Rate of 100

Buy some item so that it's amount is less than 100, go to the cart and apply promos one after another.

Expected behavior

• Order total is 0

Actual behavior

• Order total is negative

System configuration

Solidus Version: master

Extensions in use: Extensions from default sandbox

jacobherrington commented 6 years ago

I am able to replicate this:

screenshot from 2018-06-11 11-49-41

However, upon checkout the charge will still be $0.00, so this is really just a presentation layer bug.

kennyadsl commented 6 years ago

We discussed this issue in the core team meeting, and we think that this scenario is basically not realistic. We think that no business could ever create this kind of cumulative promotions, isn't it?

Despite we know that technically this could happen, in this case it's more like an issue in how you set promotions up for your store and we think that for now the best trade-off between patching complex code, working around the issue as for (#2769) and do something here is to just raise an exception when calculating total, if it's less than 0. Stores that want to ignore this scenario can just ignore it while other store can rescue the exception and print an error message to the user.

@jacobherrington again, thanks for your contribution, we really appreciate the effort, if you'd like to take this task it would be great!

jacobherrington commented 6 years ago

I still plan on working on this when I have time, but I'm also happy to pair-with/hand-off-to someone looking to get involved in this project.

peterberkenbosch commented 5 years ago

Work is being done here right now. https://github.com/solidusio/solidus/pull/2855