Zen Cart Logo
Forums / Setting Up Specials and SaleMaker / How might I apply a 20% discount to one product when another is present?

How might I apply a 20% discount to one product when another is present?

Locked

Views: 3,120

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
3 Jun 2006, 12:40 AM
#1
cpk avatar

cpk

New Zenner

Join Date:
Apr 2006
Posts:
37
Plugin Contributions:
0

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.

Thanks,

cpk

5 Jun 2006, 6:40 PM
#2
wilt avatar

wilt

Oji-san

Join Date:
Jun 2003
Location:
Newcastle UK
Posts:
1,837
Plugin Contributions:
3

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.

eg.

sub-total - $100..00
shipping $5.00
Multi-discount(20%) - $20.00

Total $85.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.