Results 1 to 10 of 11

Hybrid View

  1. #1
    Join Date
    Aug 2004
    Posts
    817
    Plugin Contributions
    0

    Default Coupon Restriction - Can this be done?

    Quick question. Let's say that you have two categories of products: Category A and Category B.

    You have a coupon which restricts Category A from being discounted, but it will work for Category B.

    Right now, the way Zen Cart is setup, if you have a product that is linked to BOTH Category A and Category B, then the discount will be applied to the item because it exists in the whitelisted Category B.

    Where would I look to tweak the code so that if ANY product is in Category A, regardless of what other categories it's in, I don't want the coupon to apply?

    In other words, I have a hidden category called Non Discountable items which I put certain items in. However, these items may be a book or DVD, and I also want them linked to my non-hidden, visiable category of BOOKS or DVD's so that customers can browse them on our website by category. Since these items are linked to both categories (Books and Non Discountable Items), it's still allowing the discounts to be applied even though my coupon restricts the Non Discountable Item category, simply because the item exists in the discountable Books category as well. So I need to find what function to tweak so that if the item is found in ANY NON DISCOUNTABLE category, restricted by the coupon, that the discount will not apply.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Coupon Restriction - Can this be done?

    Discount Coupons are based on the Category, which is based on the master_categories_id of a Product, or on the Product itself with the products_id ...

    So if you set the Restriction to Category A, and you have Products in Category A and Linked to Category B ... the Discount Coupon will work on ALL Products that use Category A as the master_categories_id ...
    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!

  3. #3
    Join Date
    Aug 2004
    Posts
    817
    Plugin Contributions
    0

    Default Re: Coupon Restriction - Can this be done?

    Hi Ajeh - I see what you're saying, but that's NOT what's happening.

    I have a product who's Master Category is called "No Further Discounts." The thing is that this category is DISABLED/HIDDEN, and I think that is the key difference here. I have it DISABLED/HIDDEN so that it doesn't show up on my website's menu, because after all, who wants to go to a category that says "No Further Discounts!" So it's hidden, but the products inside of it are ACTIVE.

    Look at attached screenshot NoDiscountCategory.jpg to see what I mean.

    So these active items (whose Master Category is the hidden "No Further Discounts") are linked to non-hidden ACTIVE/VISIBLE categories like "Books" or "DVDs".

    See attached screenshot LinkedCategories.jpg

    Despite the Master Category being restricted by the coupon, the discount is still applying, and I think it may have to do with the category being disabled/hidden even though the items within in are not.

    Can you tell me where to look in the code to make it so that the restriction will apply even to a DISABLED category?
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	NoDiscountCategory.jpg 
Views:	148 
Size:	2.3 KB 
ID:	8165   Click image for larger version. 

Name:	LinkedCategories.jpg 
Views:	159 
Size:	21.9 KB 
ID:	8166  

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Coupon Restriction - Can this be done?

    I have a Category at the Top Level and one below it:

    Hidden Top categories_id 66
    |-- Hidden DC categories_id 67

    Both Hidden Top and Hidden DC are marked as disabled Categories (red icon) ...

    In the Category Hidden DC categories_id 67 ...

    I have 2 Products ... Hidden Product products_id 182 master_categories_id 67 and Hidden Product Linked products_id 183 master_categories_id 67 and Linked to any other active Category ...

    I have a Discount Coupon for 10% with the Restrictions:

    Category TOP Deny

    Category Hidden DC Allow

    I go to my Catalog and search on Hidden and find my two Products ... Hidden Product and Hidden Product Linked ...

    I add both to the Cart where Hidden Product is $10 and Hidden Product Linked is $20 ...

    I apply my Discount Coupon for 10% to my cart and I get $3.00 off of the $30.00 for these two Products ...

    Is this what you are wanting to happen?
    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!

  5. #5
    Join Date
    Aug 2004
    Posts
    817
    Plugin Contributions
    0

    Default Re: Coupon Restriction - Can this be done?

    If I'm following you, I think I want the OPPOSITE.

    I have this:

    Hidden Category (id 31)
    ---> Non-hidden product (id 200)

    This category is restricted from discounts with my coupon, where I set it to DENY discounts on Hidden Category (id 31).

    If I try to use my coupon on the product as you see it above, everything works fine. It will NOT DISCOUNT which is perfect. The problem is that from a shoppers perspective, this item will only show up in our store if they search by name. They cannot browse it in a category because I have the category HIDDEN. So what I do is I LINK IT to a visible category, like "DVDS" so that when they click the DVD category, they will see the item.

    However, while some DVD's are discountable, I don't want to discount anything that has a Master Category ID for my Hidden Category (id 31).

    The way the code is working now, if I were to LINK my item above (id 200) to a category that is ALLOWED by the coupon, then it's giving me the discount when I don't want it to.

    Bottom line: I would like to customize the code so that if a product is in a master category that is RESTRICTED from discount coupons, then it should never apply the discount on that item EVEN IF THE MASTER CATEGORY IS HIDDEN/DISABLED.

    Let me know if I can clear that up any more.

    Basically, I need this to happen:


    Hidden Category (id 31) <--------- [Nothing in here should be discounted]
    ---> Non-hidden product (id 200) <-------[This item should never be discounted]

    Visible Category (id 32) <----------[Items in here can be discounted]
    ---> LINKED product (id 200) <----[I don't want this to be discounted because it's Master Category is restricted]

    Right now, it IS applying the discount in the above example, either because its linked to a discountable category, or because the master category is HIDDEN and therefore, not being factored into the logic behind the coupon restrictions.

    Make sense?

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Coupon Restriction - Can this be done?

    Okay ... let's change a few things ...

    If I have Products Linked to another Category, example:
    Good Category categories_id 22

    where this is a visible Category with Products from the Hidden DC categories_id 67 ...

    If I set the Restrictions up as:
    TOP Deny
    Hidden DC categories_id 67 Deny
    Good Category categories_id 22 Allow

    Then Products Linked to Good Category categories_id 22 ... but have master_categories_id 67 ... these Products will NOT be included in the Allowed Products on the Discount Coupon because their master_categories_id is not 22 for the Good Category ...

    Check to see if what you are doing is setting the "Parent" Category rather than the Master Category as being Allowed ...

    Keep in mind it is the Master Category that controls what is Allowed and Denied on the Restrictions ...
    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!

 

 

Similar Threads

  1. Replies: 27
    Last Post: 15 Dec 2015, 02:02 PM
  2. Coupon restriction error
    By dre in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 7
    Last Post: 30 Jun 2011, 10:09 AM
  3. Coupon Restriction
    By enzo-ita in forum General Questions
    Replies: 2
    Last Post: 29 Nov 2010, 09:28 AM
  4. Coupon Restriction Issue
    By disciple in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 11
    Last Post: 26 Sep 2010, 06:56 AM
  5. Coupon restriction logic
    By dbrewster in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 3
    Last Post: 3 Jul 2006, 06:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg