How might I apply a 20% discount to one product when another is present?
I was wondering if anyone has created a solution using either the observer class or other method to do something like the following:
If the customer puts product A in their cart and we are offering 20% off product B and C (in an unlimited quantity and combination) only if they purchase product A. It must do so without applying the 20% discount to product A.
I think I have part of the solution, which is to create a discount code for only products B and C and somehow use the Observer Class to create a script that would parse the coupon code to the discount coupon input field in the billing step of the form when product A is in the cart. What I am unsure about is where or how I might find the proper locations to "hook" into or if this is even possible. It seems this might work as it is similar the BOGOF solution.
I would very much like to know if someone has accomplished something like this, and if so, how? OR If anyone knows of an alternative solution that would provide the same outcome.
Last edited by cpk; 3 Jun 2006 at 01:42 AM.
Reason: unclear title
Re: How might I apply a 20% discount to one product when another is present?
It depends on where you want the discount to show up.
If you only want the discount to show up on the confirnation page.
sub-total - $100..00
Multi-discount(20%) - $20.00
then you are better off using a order total class, much like the group pricing class.
If however you want the discounts to show up in the shopping cart, then you are better off using the observer/notifier method in a similar manner to the BOGOF example.
Content and Graphics Copyright (c) 2003 - 2013 Zen Ventures, LLC - all rights reserved
Zen Cart® is a Registered Trademark of Zen Ventures, LLC