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

T1763 - Change how donations are displayed in cart #39

Merged
merged 3 commits into from
Sep 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion crowdfunding_compassion/controllers/donation_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,14 @@ def post_donation_form(self, project, participant, amount, **post):
sale_order = request.website.sale_get_order(force_create=True).sudo()
product = project.product_id
quantity = float(amount) / product.standard_price
price = product.standard_price
if not quantity.is_integer():
quantity = 1
price = amount

Comment on lines +90 to +94
Copy link
Member

Choose a reason for hiding this comment

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

This can be done regardless if the quantity is entire or not.

Suggested change
price = product.standard_price
if not quantity.is_integer():
quantity = 1
price = amount
quantity = 1
price = amount

PS: the line above can also be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But wouldn't it be weird if after selecting 3 toilet accesses it shows toilet accesses 1 for 90.- instead of toilet access 3? Or maybe also change the name of the product to 3 toilet accesses directly?
My change:
image
Your proposition:
image
New Proposition:
image
And maybe something like that for custom donations
image

Copy link
Member

Choose a reason for hiding this comment

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

You are right, your changes make more sense :)

sale_order.add_donation(
product.id,
product.standard_price,
price,
qty=quantity,
participant_id=participant.id,
opt_out=post.get("opt_out"),
Expand Down
Loading