Offers are consumed twice on basket lines
See original GitHub issueI am wondering about how to apply offer for consume offer for django oscar 1.6.4,
I was digging in to the code base, and found out that we call consume
2 times when applying a benefit. For example
- In
apps.basket.abstract_models.py
def discount(self, discount_value, affected_quantity, incl_tax=True,
offer=None):
"""
Apply a discount to this line
"""
if incl_tax:
if self._discount_excl_tax > 0:
raise RuntimeError(
"Attempting to discount the tax-inclusive price of a line "
"when tax-exclusive discounts are already applied")
self._discount_incl_tax += discount_value
else:
if self._discount_incl_tax > 0:
raise RuntimeError(
"Attempting to discount the tax-exclusive price of a line "
"when tax-inclusive discounts are already applied")
self._discount_excl_tax += discount_value
self.consume(affected_quantity, offer=offer)
And then again in apps.offer.conditions.py
in each condition, they have def consume_items(self, offer, basket, affected_lines):
and call line.consume(quantity_to_consume, offer=offer)
method again.
I don’t think it’s supposed to call consume
twice like this?
Technical details
- Oscar version: django oscar 1.6.4
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
macroeconomics asu 3 Flashcards - Quizlet
In year two, the price of the same basket is $8.00. ... Use the orange line (square symbol) to plot the initial money...
Read more >Utility Maximization - ECON 150: Microeconomics
The law of diminishing marginal utility states that as more of the good is consumed, the additional satisfaction from another bite will eventually...
Read more >6.2 The Indifference Curve – Principles of Microeconomics
An indifference curve maps the consumption bundles that the consumer views ... Let's assume instead that José likes T-shirts twice as much as...
Read more >Basketball Violations - Rookie Road
Double Dribble: Dribbling the ball before picking it up and dribbling again. Eight-Second Violation (Backcourt Violation): The offense fails to cross half-court ...
Read more >Multiple Coupons in a Basket
Products aren't discounted multiple times, and exclusivity rules remain the same. There is one exception: product promotions of type With Amount of Qualifying ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ll prepare a fix for this asap.
Fix delivered in PR https://github.com/django-oscar/django-oscar/pull/2970