If this is your first visit, check our documentation. To post, register or login.
Forums / Setting Up Your Zen Cart Products / 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?

Started by limelites on 20 Oct 2012, 1:01 PM · Views: 3,257

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

Post #1 by limelites

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

Post #2 by 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?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

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

limelites

Totally Zenned

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

Post #3 by limelites

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

Post #4 by limelites

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

Post #5 by ajeh

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 ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

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

ajeh

Oba-san

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

Post #6 by ajeh

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 ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

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

limelites

Totally Zenned

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

Post #7 by limelites

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

Post #8 by ajeh

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 ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

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

limelites

Totally Zenned

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

Post #9 by limelites

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

Post #10 by ajeh

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

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!