I am using the Drupal Commerce module. On the checkout page, I need to add 'Subtotal' and 'Discount' fields above the 'Order total'.

The discount will be calculated by iterating through all products in the cart and (using some unique and complex PHP business logic that I won't get into here) calculating how much discount each product is eligible for.

The discount total will then be displayed in a 'Discount' field between 'Subtotal' and 'Total'. The product prices should not be discounted.

Any Suggestions?

  • Have you look on the discount modules? to check if they cant help you? – Vic Mar 27 '13 at 19:33
  • Thank you for the pointer Vic. I take it you are referring to drupalcommerce.org/extensions/module/discount modules. The Coupon modules might be useful as code references. – user320691 Mar 27 '13 at 20:32

So you will have to use the Rules modules with this

I guess its would something like : Calculating the sale price of products. Data comparision conditions should be added to this, then multiply the unit price by a certain amount, This would remove some % of the individual products which would give you the feature of removing it from the total amount.

Hope this help you

Commerce Conditions

This link, might also give you closer indicator of how to solve the problem


Check out the Commerce Price Savings Formatter module.

  • 1
    Please add some details about WHY you recommend this module, and what this module does (eg via a relevant quote from its project page). Not doing so will put your answer at risk of being considered as a link-only answer (and possibly deleted via moderation). Just trying to help to improve your answer, ok? – Pierre.Vriens Apr 13 '16 at 9:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.