Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix use get_is_discountable instead is_discountable attribute from product #4071

Closed
wants to merge 6 commits into from

Conversation

kaewjai
Copy link

@kaewjai kaewjai commented Mar 13, 2023

When there are product discountable true and variant discountable false in cart in the same time, discount is calculated for variant which is incorrect.

@@ -655,7 +655,7 @@ def can_apply_benefit(self, line):
"""
Determines whether the benefit can be applied to a given basket line
"""
return line.stockrecord and line.product.is_discountable
return line.stockrecord and line.product.get_is_discountable()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a test demonstrating the issue you are describing?

Copy link
Author

@kaewjai kaewjai Mar 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@specialunderwear I add picture for describe more and my branch already has tests added. Can you approve workflow for run test from github CI.

image
image

@specialunderwear
Copy link
Member

specialunderwear commented May 5, 2023

Hi there is a failing test:

django-oscar/tests/integration/offer/test_absolute_benefit.py:409

ValueError: Strategy hasn't found a price for product Dùmϻϒ title

I think you need to update the fixtures to fix this. If you fix this we will review again. We are going to review pull requests weekly from now!

You can run the tests by running make test

@specialunderwear
Copy link
Member

Failed to push changes to this branch so reopened in #4102 4102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants