django-oscar icon indicating copy to clipboard operation
django-oscar copied to clipboard

Bug AbsoluteDiscountBenefit

Open ebottos94 opened this issue 2 years ago • 2 comments

Hi, according with the description in the class AbstractBenefit in file src/oscar/apps/offer/abstract_models.py in line 480, for the absolute discount the discount's logic is : "Discount is a fixed amount off of the product's value".

In the file src/oscar/apps/offer/benefits.py instead the logic in the class AbsoluteDiscountBenefit is developed as if the discount were "Discount is a fixed amount off of the total amount of the shopping".

I assumed that the description "Discount is a fixed amount off of the product's value" is correct and i've change the AbsoluteDiscountBenefit's code so that it works as the description would like.

Thanks.

ebottos94 avatar Jul 28 '22 11:07 ebottos94

Hi, I think you better improve the description, because what you are doing now is change exsiting offers on sites that use this functionality. I think most customers would not enjoy it when suddenly their offers give a much larger discount then before after an update!

specialunderwear avatar Jul 28 '22 11:07 specialunderwear

@specialunderwear yes I've thought that but the description of the offer is enough clear now, so i don't think that the customers use this offer now. But you are rigth. Anyway, now the description does not reflect the logic, so if you don't want change the logic I think that the description must be changed!

ebottos94 avatar Jul 28 '22 11:07 ebottos94

Yes, hence is suggest improving the description, if you need this kind of discount, you should introduce a new discount, so existing discounts are not changed. That would be great to have!

specialunderwear avatar Oct 12 '22 07:10 specialunderwear

@samar-hassan I think you need to edit a migration because the make migration test failed now.

viggo-devries avatar Sep 13 '23 19:09 viggo-devries

@samar-hassan please edit the existing migration, a new migration for choices is not needed!

viggo-devries avatar Sep 13 '23 19:09 viggo-devries

Codecov Report

Merging #3954 (896c381) into master (2cc14b9) will not change coverage. The diff coverage is n/a.

:exclamation: Current head 896c381 differs from pull request most recent head 23cc1f9. Consider uploading reports for the commit 23cc1f9 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3954   +/-   ##
=======================================
  Coverage   87.50%   87.50%           
=======================================
  Files         290      290           
  Lines       15912    15912           
=======================================
  Hits        13924    13924           
  Misses       1988     1988           
Files Changed Coverage Δ
src/oscar/apps/offer/abstract_models.py 89.00% <ø> (ø)

codecov[bot] avatar Sep 13 '23 19:09 codecov[bot]