Zen Cart Logo
Forums / Setting Up Specials and SaleMaker / Exclude a Specific Category from a Particular Discount Coupon Code?

Exclude a Specific Category from a Particular Discount Coupon Code?

Views: 3,239

Results 1 to 10 of 10
20 Oct 2012, 1:01 PM
#1
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Exclude a Specific Category from a Particular Discount Coupon Code?

Does anyone know of an easy way to exclude category 350 from a discount coupon code? Basically, we want to offer a 10% discount on everything on our website, so long as the master category is not 350.

I read somewhere in another thread about a exclude_product() function but it was only mentioned vaguely, in passing? Could really use this right now.... Thank you in advance for any help you can offer me.

20 Oct 2012, 2:03 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Exclude a Specific Category from a Particular Discount Coupon Code?

If you make the Discount Coupon and just add on the Restrictions your Category for categories_id 350 and set to DENY ... doesn't this give the 10% on everything except the Products with a master_categories_id of 350?

What version Zen Cart are you running on the store where you are trying to do this?

20 Oct 2012, 2:46 PM
#3
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Exclude a Specific Category from a Particular Discount Coupon Code?

Ajeh:

If you make the Discount Coupon and just add on the Restrictions your Category for categories_id 350 and set to DENY ... doesn't this give the 10% on everything except the Products with a master_categories_id of 350?

What version Zen Cart are you running on the store where you are trying to do this?

v.1.3.8c and it doesn't seem to have restrictions built in?

20 Oct 2012, 2:49 PM
#4
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Exclude a Specific Category from a Particular Discount Coupon Code?

Hi Ajeh,

Sorry, I've noticed the restricions now... they're applied "after" the coupon setup... I'm new to coupons so just getting to grips with this area on the site... it's pretty self-explanatory....DUHH!!

20 Oct 2012, 2:52 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Exclude a Specific Category from a Particular Discount Coupon Code?

After you make the Discount Coupon ... you should see in the right panel the button for RESTRICTIONS ...

Click that, and you should see the Category area where you can set the DENY for your Category for 350 ...

20 Oct 2012, 2:54 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Exclude a Specific Category from a Particular Discount Coupon Code?

I rather thought that might be the problem ...

NOTE: v1.3.8 is ancient, buggy and has a lot of security issues ... some of the issues do relate to how the categories_id is selected and while there may be a bug fix on the Known Bug Fixes for v1.3.8, you really should be looking to upgrade to v1.3.9h or v1.5 or v1.5.1 ...

20 Oct 2012, 2:56 PM
#7
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Exclude a Specific Category from a Particular Discount Coupon Code?

Here's where I'm going to complicate things though,.... is there a way to exclude the discount code when one specific "payment method" is selected at the checkout confirmation page?

20 Oct 2012, 3:46 PM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Exclude a Specific Category from a Particular Discount Coupon Code?

This can be done ...

For example, let's say I do not want a particular Discount Coupon to be used when PayPal Express is selected ...

Editing the file:
/includes/modules/order_total/ot_coupon.php

I can add the code in RED:

[B]// bof: stop Discount Coupon coupon_id 6 from use when paypal is selected
if ($_SESSION['payment'] == 'paypalwpp' and $coupon_result->fields['coupon_id'] == 6) {
  $foundvalid = false;
}
// eof: stop coupon from use when paypal is selected
[/B]
          // remove if fails address validation
          if (!$foundvalid) {

where the coupon_id would match the cID you see when editing the Discount Coupon in the URL of you Admin ...

20 Oct 2012, 4:09 PM
#9
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Exclude a Specific Category from a Particular Discount Coupon Code?

This is perfect, Linda, pure and utter genius!

20 Oct 2012, 4:38 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Exclude a Specific Category from a Particular Discount Coupon Code?

Glad that this worked for you ... thanks for the update ... :smile: