Applying Percentage Discounts to the Whole Cart in Magento
As a senior developer working extensively with e-commerce platforms like Magento, I often encounter queries from merchants seeking to apply percentage discounts across their entire cart value. The confusion arises because Magento’s official documentation suggests that the ‘Fixed Amount Discount for Whole Cart’ applies a percentage discount, which is not accurate.
Let me clarify this and guide you through applying a percentage discount to the total cart price in your Magento 1.7.0.2 store.
Understanding Magento’s Discount Calculation
Magento calculates discounts at two levelsâproduct level (per item) and order level (whole cart). Your current setup is applying a fixed amount at the order level, which results in a flat reduction of £10/$10 from the cart total regardless of its original value.
To achieve your desired outcomeâa 15% discount on the entire cart after all other discounts have been appliedâyou’ll need to create a custom discount rule that targets the subtotal attribute and applies a percentage rate.
Creating a Custom Percentage Discount Rule
Follow these steps to set up a new discount rule:
- Log in to your Magento admin panel.
- Navigate to Promotions > Cart Price Rules.
- Click on “Add New Rule”.
- Enter a name for the rule, e.g., “15% Off Whole Cart”.
- In the “Rule Information” section:
- Set “Website” to the desired scope (All Websites or specific ones).
- Set “Customer Groups” to the relevant group(s).
- Set “From Date” and “To Date” for the rule’s validity.
- Scroll down to the “Actions” section.
For “Apply the rule automatically after discount calculations processing is complete” set:
- “Discount Amount Fixed” = No
- “Discount Step By Amount” = 0
- “Discount Step By Percentage” = Yes
- Enter your desired percentage (e.g., 15)
- “Max Discount (0 for no Limit)” = Leave as 0
-
In the “Conditions” section, set:
- First condition: “Carts Total Amount” > 0
- Add another condition: “If ALL of these conditions match:”
- Choose “Subtotal” from the first dropdown.
- Set “is greater than equal to (>=)” or “equals (=)” based on your preference.
-
Click “Save Rule”.
Your new rule will now apply a 15% discount to any cart total that matches the specified subtotal condition, effectively providing the desired percentage reduction across the whole cart value after other discounts have been applied.
Testing Your Custom Discount
To ensure everything works as expected:
- Add items to your cart with prices that trigger the subtotal condition.
- Apply the “15% Off Whole Cart” rule using a test coupon or by enabling it for the current session.
- Observe whether the discount is correctly calculated and applied against the entire cart amount.
Conclusion
As you can see, Magento’s out-of-the-box discount rules don’t directly support applying percentage discounts to the whole cart. However, with some strategic configuration of your custom price rule, it becomes possible to achieve this functionality.
By following the steps outlined above, you should be able to create a discount rule that accurately applies your desired percentage reduction across the entire cart total in your Magento 1.7.0.2 store.
Remember, discounts can significantly impact your customers’ shopping experience and your overall revenue. Always test thoroughly before deploying any changes to a live environment.
If you need expert guidance on implementing more advanced customizations or optimizing your Magento setup, don’t hesitate to reach out to our team of experienced developers at Laravel Company. We’re here to help you unlock the full potential of your e-commerce platform.