Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
So following is the situation when the amount becomes 0 after applying the discount coupon code with percentage value.
- Create Coupon code by create discount of percentage type
- Where "Product discount conditions" = Apply to All
- Create Product with 0 base price
- Selected the options you have created for pricing attributes using options set
- On the product display page, Select an option, lets say an option of $100
- Click add to cart
- Go to cart page, value will perfectly display i.e. $100
- Click checkout
- On checkout page add coupon code
- After page gets refreshed the whole amount becomes 0 i.e order total = 0 and value of the item = 0
Or I can say that after applying discount code the code applies to the base price of the product
- If Base price of the product = $50
- If Selected option on product display page is = $100
- Total Value becomes = $150
- After applying discount code of percentage value of 10% the product total show on checkout page = $45, Subtotal = $50 and discount = -$5
Comments
Comment #1
vivek.saurabh CreditAttribution: vivek.saurabh commentedComment #2
kunalkursija CreditAttribution: kunalkursija commentedHi Vivek,
Did you find any solution for this ?
Comment #3
Trey CreditAttribution: Trey commentedI just ran into this problem, I fixed it by changing the weight of the rule that applies the pricing attributes to be higher than the weight of the discount rules... now all of my discount rules have a weight of 0 and my pricing attributes rule has a weight of 2. This does not apply the discount to the pricing attributes which is the preferred behavior for our site.
Comment #4
vivek.saurabh CreditAttribution: vivek.saurabh commentedHi Kunal,
Please try the solution mentioned by Trey, and let us know if that works for you or not.
Comment #5
Riff Raff CreditAttribution: Riff Raff commentedTrey's solution worked for me - the discount rule was stomping the attribute pricing modification. Altering the weight of the "Commerce pricing attributes calculation" rule solved the issue.
Thanks Trey!
Comment #6
tadesign CreditAttribution: tadesign commentedHi,
I have exactly the same issue Vivek had originally. The rules weight change mentioned in #3 works, but as mentioned only for a case where the discount shouldn't apply to the pricing attribute cost. However I have a site that require the attribute cost to be discounted as well.
I had the discount setup as a product discount so I tried changing it to the order discount which does seem to work but then I get other issues which don't appear with the product discount i.e. the VAT amount shows the wrong value even though the subtotal/discount/total are correct. I also need to exclude a certain product type from being discounted and so far have only managed to do this with the discount set to product.
Does anyone have any ideas on how to get the attribute price not to zero with the discount applied and apply the discount to the attribute without changing the rules weight?
Kind Regards
Richard
Comment #7
anneeasterling CreditAttribution: anneeasterling as a volunteer commented@tadesign / Richard, we've found this issue as well and have the same question. Did you ever find a solution?
Thanks,
Anne