Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Jan 2011
    Posts
    83
    Plugin Contributions
    0

    Default Discount coupons for category is not working,error MySQL

    Hello,
    I have set up a discount coupon,but I want to give 10% discount for a specific category.
    This needs to be done via restrictions I suppose?
    But if I click on restrictions I get the following error:

    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, MAX_DISPLAY_RESTRICT_ENTRIES' at line 1
    in:
    [select * from coupon_restrict where coupon_id = '2' and category_id != '0' limit -0, MAX_DISPLAY_RESTRICT_ENTRIES]
    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.

    What is wrong and what can I do to solve this problem?

    I am using latest version of Zen-Cart.

    Or is there maybe an addon to get a discount coupon working for a specific category?
    Looking forward to get some advice.

    Thanks in advance.
    Richard

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Discount coupons for category is not working,error MySQL

    Quote Originally Posted by Rimo View Post
    But if I click on restrictions I get the following error:

    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, MAX_DISPLAY_RESTRICT_ENTRIES' at line 1
    There is something amiss with your installation.

    Where you are seeing "MAX_DISPLAY_RESTRICT_ENTRIES" it should be showing a number (default = 20).

    This is/should be set/defined in the file:
    /admin/includes/languages/english/coupon_restrict.php

    The Dev Toolkit indicates that this setting is defined on line#27 of this file. By default it should read:
    define('MAX_DISPLAY_RESTRICT_ENTRIES', 20);

    What does it read for your store?

    Cheers
    Rod

  3. #3
    Join Date
    Jan 2011
    Posts
    83
    Plugin Contributions
    0

    Default Re: Discount coupons for category is not working,error MySQL

    Quote Originally Posted by RodG View Post
    There is something amiss with your installation.

    Where you are seeing "MAX_DISPLAY_RESTRICT_ENTRIES" it should be showing a number (default = 20).

    This is/should be set/defined in the file:
    /admin/includes/languages/english/coupon_restrict.php

    The Dev Toolkit indicates that this setting is defined on line#27 of this file. By default it should read:
    define('MAX_DISPLAY_RESTRICT_ENTRIES', 20);

    What does it read for your store?

    Cheers
    Rod

    Hi Rod,

    Thanks for your answer.
    I am at my work right now and I do not have access to a ftp manager to check the file you mentioned.
    Is there another how I can checkthis right now,otherwise I have to wait for about 10 hours to check this

    Richard

  4. #4
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Discount coupons for category is not working,error MySQL

    Quote Originally Posted by Rimo View Post
    I do not have access to a ftp manager.
    Is there another how I can checkthis right now,otherwise I have to wait for about 10 hours to check this
    Most hosts provide a file manager with their control panels, so this is one way you can check.

    Also, if your host allows SSH access you can download a program called 'PuTTY' (google it). and gain access to your files that way.

    Finally, most web browsers provide reasonably good FTP support these days, so you almost certainly DO have access to 'an ftp manager', but you simply don't know it.

    Instead of accessing your site with
    http://yourserver.com/ simply replace the 'http' with 'ftp'. as such:
    ftp://yourserver.com/
    you might be pleasantly surprised (or perhaps shocked that such access is even possible).

    Cheers
    Rod
    Last edited by RodG; 6 Oct 2011 at 08:39 AM.

  5. #5
    Join Date
    Jan 2011
    Posts
    83
    Plugin Contributions
    0

    Default Re: Discount coupons for category is not working,error MySQL

    Hi,

    I just checked the files and here they are:

    By the way I am using the dutch versions so you will find here two files of coupon_restrict.php

    admin/includes/language/english

    Code:
    <?php
    /**
     * @package admin
     * @copyright Copyright 2003-2010 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: coupon_restrict.php 16174 2010-05-02 14:10:30Z drbyte $
     */
    
    define('HEADING_TITLE', 'Discount Coupons Product/Category Restrictions');
    define('HEADING_TITLE_CATEGORY', 'Category Restrictions');
    define('HEADING_TITLE_PRODUCT', 'Product Restrictions');
    
    define('HEADER_COUPON_ID', 'Coupon ID');
    define('HEADER_COUPON_NAME', 'Coupon Name');
    define('HEADER_CATEGORY_ID', 'Category ID');
    define('HEADER_CATEGORY_NAME', 'Category Name');
    define('HEADER_PRODUCT_ID', 'Product ID');
    define('HEADER_PRODUCT_NAME', 'Product Name');
    define('HEADER_RESTRICT_ALLOW', 'Allow');
    define('HEADER_RESTRICT_DENY', 'Deny');
    define('HEADER_RESTRICT_REMOVE', 'Remove');
    define('IMAGE_ALLOW', 'Allow');
    define('IMAGE_DENY', 'Deny');
    define('IMAGE_REMOVE', 'Remove');
    define('TEXT_ALL_CATEGORIES', 'All Categories');
    
    define('MAX_DISPLAY_RESTRICT_ENTRIES', 20);
    define('TEXT_ALL_PRODUCTS_ADD', 'Add All Category Products');
    define('TEXT_ALL_PRODUCTS_REMOVE', 'Remove All Category Products');
    define('TEXT_INFO_ADD_DENY_ALL', '<strong>For Add all Category Products, only Products not already set for restrictions will be added.<br />
                        For Delete all Category Products, only Products that are specified Deny or Allow will be removed.</strong>');
    
    define('TEXT_MANUFACTURER', 'Manufacturer: ');
    define('TEXT_CATEGORY', 'Category: ');
    define('ERROR_DISCOUNT_COUPON_DEFINED_CATEGORY', 'Category Not Completed');
    define('ERROR_DISCOUNT_COUPON_DEFINED_PRODUCT', 'Product Not Completed');

    admin/includes/languages/dutch

    Code:
    <?php
    //dutch translation Zencart ; v1.3.7 2007-09-11 by Edwin Wiering ; v1.3.5 2006-09-04 by joostvdl ; dutch translation Zencart v1.2.6d 2005-11-12  by dutchguy 
    // +----------------------------------------------------------------------+
    // |zen-cart Open Source E-commerce                                       |
    // +----------------------------------------------------------------------+
    // | Copyright (c) 2003 The zen-cart developers                           |
    // |                                                                      |   
    // | http://www.zen-cart.com/index.php                                    |   
    // |                                                                      |   
    // | Portions Copyright (c) 2003 osCommerce                               |
    // +----------------------------------------------------------------------+
    // | This source file is subject to version 2.0 of the GPL license,       |
    // | that is bundled with this package in the file LICENSE, and is        |
    // | available through the world-wide-web at the following url:           |
    // | http://www.zen-cart.com/license/2_0.txt.                             |
    // | If you did not receive a copy of the zen-cart license and are unable |
    // | to obtain it through the world-wide-web, please send a note to       |
    // | [email protected] so we can mail you a copy immediately.          |
    // +----------------------------------------------------------------------+
    //  $Id: coupon_restrict.php 3666 2006-05-28 21:21:37Z wilt $
    //
    
    define('HEADING_TITLE', 'Kortingsbonnen Artikel/Categorie beperkingen');
    define('HEADING_TITLE_CATEGORY', 'Categorie beperkingen');
    define('HEADING_TITLE_PRODUCT', 'Artikel beperkingen');
    
    define('HEADER_COUPON_ID', 'Kortingsbon ID');
    define('HEADER_COUPON_NAME', 'Naam kortingsbon');
    define('HEADER_CATEGORY_ID', 'Categorie ID');
    define('HEADER_CATEGORY_NAME', 'Categorienaam');
    define('HEADER_PRODUCT_ID', 'Artikel ID');
    define('HEADER_PRODUCT_NAME', 'Artikelnaam');
    define('HEADER_RESTRICT_ALLOW', 'Toestaan');
    define('HEADER_RESTRICT_DENY', 'Weigeren');
    define('HEADER_RESTRICT_REMOVE', 'Verwijderen');
    define('IMAGE_ALLOW', 'Toestaan');
    define('IMAGE_DENY', 'Weigeren');
    define('IMAGE_REMOVE', 'Verwijderen');
    define('TEXT_ALL_CATEGORIES', 'Alle Categorieën');
    ?>
    I copied this from the files,but at the end of admin/includes/languages/english/coupon_restricted.php i am missing ?> can this be a problem?

  6. #6
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Discount coupons for category is not working,error MySQL

    Quote Originally Posted by Rimo View Post
    By the way I am using the dutch versions so you will find here two files of coupon_restrict.php
    If I'd known that I would have suggested that you simply change languages to see if the problem goes away.

    Not needed now though, I see where your problem is.

    The dutch version of this file is based on an older version of zencart, as such, some of the defines are missing, including the one under discussion.

    You will need to add these missing defines to your dutch file. Just copy them over from the english one and edit as needed.

    As for the missing "?>" - No, this will NOT cause you any problems. It is supposed to be that way. It should be removed from the dutch file when you update it with the missing entries.

    Cheers
    Rod

 

 

Similar Threads

  1. v154 discount coupons not working as expected...
    By kitcorsa in forum General Questions
    Replies: 3
    Last Post: 3 Apr 2015, 05:29 PM
  2. Mysql error Coupons
    By romanus in forum General Questions
    Replies: 0
    Last Post: 12 Apr 2011, 06:00 PM
  3. Making discount coupon coupons NOT available for items already discounted.
    By spadesoleil in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 3
    Last Post: 21 Oct 2010, 03:52 AM
  4. Help Discount coupons isn't working right.
    By wmorris in forum General Questions
    Replies: 2
    Last Post: 30 Nov 2009, 01:52 AM
  5. Coupons Not working - checkout still asks for money
    By designerman in forum Managing Customers and Orders
    Replies: 5
    Last Post: 24 Aug 2007, 06:07 AM

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