Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Oct 2007
    Location
    Australia
    Posts
    843
    Plugin Contributions
    0

    Default Coupon error with restrictions set

    I am getting the following error with coupons when there is a category set to allow and then a product within that category also set to allow, when attempting to use the coupon customers get a blank page with the following message

    PHP Code:
    1064 You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near 'AND coupon_restrict = 'Y' AND coupon_id = 53 LIMIT 1' at line 3
    in
    :
    [
    SELECT count(*) AS total FROM coupon_restrict AND coupon_restrict 'Y' AND coupon_id 53 LIMIT 1
    ...the error goes away if I remove the category restriction and just keep the product restriction....how do I fix this?
    HunnyBee Design
    "A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

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

    Default Re: Coupon error with restrictions set

    First if you have an Allow on the Category why do you need an Allow on the Product in that Category?

    I just made a Discount Coupon that is setup as:
    TOP DENY
    Category 53 ALLOW

    Product in Category 53 ALLOW

    and I am not getting an error ...

    I added Products from Category 53 and did a checkout without a problem ...

    I added Products from Category 53 and the Product that is also Allowed and did a checkout without a problem ...

    I added Products from Category 53 and the Product that is also Allowed and from another Category and did a checkout without a problem ...

    So far I am unable to reproduce the error ...

    Where are you seeing this error?

    NOTE: you may wish to check the Known Bug Fixes and apply them:
    http://www.zen-cart.com/forum/showthread.php?t=82619

    And now is a good time to ensure that you have all of the Secure Patches and Updates:
    http://www.zen-cart.com/forum/showthread.php?t=131115
    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: v1.5.5]
    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
    Oct 2007
    Location
    Australia
    Posts
    843
    Plugin Contributions
    0

    Default Re: Coupon error with restrictions set

    I have a commercial module addon that gives my designers access to their products, sales and coupons etc through a seperate folder so they don't access the main admin folder and when adding a coupon it is automatically set to allow their master category so the coupon is restricted and not valid on the whole store lol

    Many times we gives out coupons that we only want to allow the customers to use on a single product, which is where both those allow restrictions come in.

    I could be wrong, but I believe this error is only happening when the coupon is restricted to a single use (not just per customer, but actual one-time use), I have yet to see it happen if the usage is unrestricted or restricted to 2 or more (cross fingers lol) and as soon as I remove the top allow for the category the error doesn't happen any more.

    I have all security patches and bugfixes applied....as far as I am aware I didn't miss any, but it could happen LOL
    HunnyBee Design
    "A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

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

    Default Re: Coupon error with restrictions set

    If you only want the Discount Coupon for 1 Product, why not just set to:

    TOP DENY

    Product wanted ALLOW

    Now it is only good on 1 Product ...
    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: v1.5.5]
    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
    Oct 2007
    Location
    Australia
    Posts
    843
    Plugin Contributions
    0

    Default Re: Coupon error with restrictions set

    Linda, I do go in and do that after I discover it, but as I said up there lol the mod I have that allows the designers to create their own coupons (without accessing the main admin or anyone else's area/info) sets the category restrictions....otherwise all coupons they create could be used on the whole store and not just their category.

    If there's no fix, I will just have to make sure I check for new coupons created regularly lol
    HunnyBee Design
    "A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

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

    Default Re: Coupon error with restrictions set

    So far ... I haven't reproduced the error ...

    I will keep fooling with it and see if I can ...
    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: v1.5.5]
    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!

  7. #7
    Join Date
    Oct 2007
    Location
    Australia
    Posts
    843
    Plugin Contributions
    0

    Default Re: Coupon error with restrictions set

    No worries Ajeh, and thanx....I like to bring challenging moments LOL!
    HunnyBee Design
    "A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

  8. #8
    Join Date
    Oct 2007
    Location
    Australia
    Posts
    843
    Plugin Contributions
    0

    Default Re: Coupon error with restrictions set

    Ajeh, this issue has been resolved, after several errors I had my programmer track down the problem for me...turned out it was most likely "user error" with me making a mistake when I applied the bugfixes LOL!

    includes/functions/functions_general.php

    PHP Code:
    $sql "SELECT count(*) AS total
                FROM " 
    TABLE_COUPON_RESTRICT "
                AND coupon_restrict = 'Y'
                AND coupon_id = " 
    . (int)$coupon_id " LIMIT 1"
    around line 847 thru 850
    changed to

    PHP Code:
    $sql "SELECT count(*) AS total
                FROM " 
    TABLE_COUPON_RESTRICT "
                WHERE category_id = -1
                AND coupon_restrict = 'Y'
                AND coupon_id = " 
    . (int)$coupon_id " LIMIT 1"
    Thanx for looking into it for me
    HunnyBee Design
    "A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

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

    Default Re: Coupon error with restrictions set

    Thanks for the update on what the problem was ...
    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: v1.5.5]
    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!

  10. #10
    Join Date
    May 2008
    Location
    Ventura Co.
    Posts
    82
    Plugin Contributions
    1

    Default Re: Coupon error with restrictions set

    ok so this is the closest thing I have found to my problem.

    I just installed the coupon module and when I click on coupon admin i get this;
    1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-0, 0' at line 1
    in:
    [select coupon_id, coupon_code, coupon_amount, coupon_type, coupon_start_date,coupon_expire_date,uses_per_user,uses_per_coupon,restrict_to_p roducts, restrict_to_categories, date_created,date_modified, coupon_active, coupon_zone_restriction from zen_coupons where coupon_active='Y' and coupon_type != 'G' limit -0, 0]
    If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields


    I went to the file LissaE listed above for my site and it doesnt have that line of code.
    (I am presently using: v1.3.9e)
    the site has been up fore a year, we just decided to install the coupon module.
    http://littlepeoplecustoms.com/toolbox/index.php

    any help would be great thanks
    jim

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v154 Confused with Discount coupon and restrictions
    By SarahL in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 4
    Last Post: 31 Mar 2016, 09:08 PM
  2. Can't set restrictions on any coupon
    By Cuda71 in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 7
    Last Post: 8 Apr 2011, 01:35 AM
  3. Please help with coupon restrictions
    By twiddletails in forum Setting Up Specials and SaleMaker
    Replies: 6
    Last Post: 21 Aug 2009, 09:24 PM
  4. Product restrictions not working with coupon
    By supersnow in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 8
    Last Post: 20 Oct 2008, 11:44 PM
  5. Coupon restrictions don't seem to work with mixed cart
    By Rahenna in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 1
    Last Post: 3 Sep 2006, 10:19 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR