Creating Conditional Shopping Cart Price Rules for Magento
As an experienced developer specializing in e-commerce platforms like Magento, I often encounter complex scenarios involving shopping cart price rules and conditional discounts based on payment methods. Let’s break down the given conditions and create a step-by-step guide to implement these rules effectively.
Understanding the Requirements
The main objectives are:
- Credit Card Payment: Offer free shipping if the customer chooses to pay via credit card.
- Cash on Delivery (Subtotal < 2000): Charge a combined fee of Rs 200 for both shipping and cash on delivery when the subtotal is less than Rs 2000.
- Cash on Delivery (Subtotal > 2000): Offer free shipping but charge an additional Rs 100 as a cash on delivery fee if the subtotal exceeds Rs 2000.
Step-by-Step Implementation
Step 1: Create the Discounts
First, you need to create three simple discounts in the Magento admin panel:
- Free Shipping for Credit Card: Set this discount to apply only when the payment method is ‘Credit Card.’
- Combined Fee (Subtotal < 2000): Designate this as a fixed amount of Rs 200.
- Cash on Delivery Fee (Subtotal > 2000): Set this as a fixed amount of Rs 100.
Step 2: Create Price Rules
Now, let’s create the shopping cart price rules:
-
Rule for Free Shipping with Credit Card
- Rule name: Free Shipping for Credit Card
- Conditions:
- If ALL of these conditions are TRUE:
- Payment Method equals Credit Card
- If ALL of these conditions are TRUE:
- Actions:
- Apply a discount of 0% to all items
-
Rule for Combined Fee (Subtotal < 2000)
- Rule name: Combined Fee Less than Rs 2000
- Conditions:
- If ALL of these conditions are TRUE:
- Payment Method equals Cash on Delivery
- Subtotal Amount equals less than 2000
- If ALL of these conditions are TRUE:
- Actions:
- Apply a fixed discount of Rs 200 to all items
-
Rule for Cash on Delivery Fee (Subtotal > 2000)
- Rule name: Cash on Delivery Fee Greater than Rs 2000
- Conditions:
- If ALL of these conditions are TRUE:
- Payment Method equals Cash on Delivery
- Subtotal Amount equals greater than 2000
- If ALL of these conditions are TRUE:
- Actions:
- Apply a fixed discount of Rs 100 to all items
Important Considerations
- Make sure the discounts you created in Step 1 are associated with these price rules.
- Ensure that the payment methods in the conditions match exactly what is available in your Magento store’s configuration.
Conclusion
Implementing complex shopping cart price rules requires careful planning and understanding of the underlying logic. By following this guide, you should be able to effectively set up the desired discounts based on the given conditions.
Remember, if you need more advanced solutions or have any questions about Magento development, don’t hesitate to reach out to our team at Laravel Company. We specialize in providing high-quality e-commerce solutions.