Wrong prices after coupon code in cart/checkout
See original GitHub issueCurrent behavior
When entering a coupon code in checkout that has the setting in magento 2: “Deduct 5€ for whole cart” then the prices on the products are wrong:
Expected behavior
The price of the products in cart should not change if the coupon deducts from grand total… only if coupon is for product
Steps to reproduce the issue
Repository
Can you handle fixing this bug by yourself?
- YES
- NO
Which Release Cycle state this refers to? Info for developer.
Pick one option.
- This is a bug report for test version on https://test.storefrontcloud.io - In this case Developer should create branch from
develop
branch and create Pull Request2. Feature / Improvement
back todevelop
. - This is a bug report for current Release Candidate version on https://next.storefrontcloud.io - In this case Developer should create branch from
release
branch and create Pull Request3. Stabilisation fix
back torelease
. - This is a bug report for current Stable version on https://demo.storefrontcloud.io and should be placed in next stable version hotfix - In this case Developer should create branch from
hotfix
ormaster
branch and create Pull Request4. Hotfix
back tohotfix
.
Environment details
- Browser:
- OS:
- Node:
- Code Version: 1.11.4
Additional information
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Wrong prices after coupon code in cart/checkout #4460 - GitHub
Current behavior When entering a coupon code in checkout that has the setting in magento 2: "Deduct 5€ for whole cart" then the...
Read more >Cart discount price is incorrect - WordPress.org
I have set up quantity discount pricing using the following tutorial: ... PS: My bad I mentioned Cart/checkout page shows incorrect amount by...
Read more >Applying Coupon Code After Refreshing Checkout ... - Drupal
The error/notice only appears: 1. The first time I try entering a coupon code after a /cart/checkout page refresh
Read more >Managing conditional coupons and additional fees on cart ...
The problem I have is that part concernign the management of teh discount coupon doesn't work. It gets the $coupon_code and $coupon_amount, but ......
Read more >Fix issues with disapproved promotions - Google Support
Possible causes: There's no redemption code associated with the specific promotion. How to troubleshoot: Add a valid coupon code in your promotion's details....
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 Free
Top 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
To close it, we need to merge:
@lukaszjedrasik
Just to further explain the fix as this theme is no longer available to review the code
<div class="prices" v-if="!displayItemDiscounts || !isOnline"> <span class="h4 serif cl-error price-special" v-if="product.special_price"> {{ product.price_incl_tax * product.qty | price(storeView) }} </span> <span class="h6 serif price-original" v-if="product.special_price"> {{ product.original_price_incl_tax * product.qty | price(storeView) }} </span> <span class="h4 serif price-regular" v-else data-testid="productPrice"> {{ (product.original_price_incl_tax ? product.original_price_incl_tax : product.price_incl_tax) * product.qty | price(storeView) }} </span> </div> <div class="prices" v-else-if="isOnline && product.totals"> <span class="h4 serif cl-error price-special" v-if="product.totals.discount_amount"> {{ product.totals.row_total - product.totals.discount_amount + product.totals.tax_amount | price(storeView) }} </span> <span class="h6 serif price-original" v-if="product.totals.discount_amount"> {{ product.totals.row_total_incl_tax | price(storeView) }} </span> <span class="h4 serif price-regular" v-if="!product.totals.discount_amount"> {{ product.totals.row_total_incl_tax | price(storeView) }} </span> </div> <div class="prices" v-else> <span class="h4 serif price-regular"> {{ (product.regular_price || product.price_incl_tax) * product.qty | price(storeView) }} </span> </div> </div>
Note displayItemDiscounts is a computed property which returns config.cart.displayItemDiscounts
If this is true, you will fall into the else-if section which uses product.totals.discount_amount
With Magento storing cart item discounts against the quote item as discount_amount. This results in the issue reported.
Thanks
Jamie