Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Nov 2005
    Location
    Australia
    Posts
    28
    Plugin Contributions
    0

    application error Error Message when Trying to Restrict Coupons

    Hi,


    Prior to the recent upgrade, Using Restrictions in Coupon Admin worked fine. Today I tried to restrict a coupon and as soon as I click on the Restriction Button, I get this message:

    Category Restrictions
    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 = '56' 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.

    It looks like I need to change some setting in display restrict entries .. but I have no idea where to find this. I found in the GV Coupons - Maximum Coupons displayed, and fiddled with those numbers, but obviously this is not the issue as the Coupon page is displaying fine.




    Details of my Version, recently upgraded.

    Zen Cart 1.3.9g

    Database Patch Level: 1.3.9g

    v1.3.9g [2010-11-02 00:59:08] (Version Update 1.3.8->1.3.9g)
    v1.3.8 [2009-07-10 10:38:43] (Fresh Installation)
    PHP Version 5.2.11
    Database: MySQL 5.0.91-community

    Any help on fixing this would be very much appreciated! Thanks for your time :)

    Rachel
    Goodnite Lingerie & Adult Toys
    www.goodnite.com.au

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

    Default Re: Error Message when Trying to Restrict Coupons

    Could you go to your Tools ... Developers Tool Kit ... and in the bottom input box enter:
    MAX_DISPLAY_RESTRICT_ENTRIES

    and see if you have the define statement for that constant ...

    You should see something like:
    /adminsecretdirectory/includes/languages/english/coupon_restrict.php

    Line #27 : define('MAX_DISPLAY_RESTRICT_ENTRIES', 20);
    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
    Nov 2005
    Location
    Australia
    Posts
    28
    Plugin Contributions
    0

    Default Re: Error Message when Trying to Restrict Coupons

    Thanks for the reply & sorry for my tardy response.

    I had actually tried the toolkit before, and I get: Error: No matching Configuration Keys were found ... MAX_DISPLAY_RESTRICT_ENTRIES

    I have searched & searched and cant find whats going on. It was fine prior to the upgrade?

    Thanks for any assistance you can offer.
    Goodnite Lingerie & Adult Toys
    www.goodnite.com.au

  4. #4
    Join Date
    Nov 2005
    Location
    Australia
    Posts
    28
    Plugin Contributions
    0

    Default Re: Error Message when Trying to Restrict Coupons

    I just found the file you referred to, and the line that you posted isnt in it. This is the file in its entirety:

    coupon_restrict.php
    PHP script text
    <?php
    //
    // +----------------------------------------------------------------------+
    // |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', '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');
    ?>



    Should I be adding something in there?
    Thanks!
    Goodnite Lingerie & Adult Toys
    www.goodnite.com.au

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

    Default Re: Error Message when Trying to Restrict Coupons

    Could you try once more in the Developers Tool Kit and use the bottom input box and enter:
    MAX_DISPLAY_RESTRICT_ENTRIES

    then select Admin from the dropdown and click SEARCH ...

    Does the:
    MAX_DISPLAY_RESTRICT_ENTRIES

    come up in any file(s)?

    It sounds like you did not upgrade the files in the:
    /admin

    directory on your server ...

    Check that you did not create a directory:
    /admin

    in addition to your renamed /admin directory ...
    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!

  6. #6
    Join Date
    Nov 2005
    Location
    Australia
    Posts
    28
    Plugin Contributions
    0

    Default Re: Error Message when Trying to Restrict Coupons

    Wow this problem just occurred again so I searched the forum for this problem and found my own post! I had major issues last time and never managed to fix this problem. After doing a search today I have located the file that refers to the MAX_DISPLAY_RESTRICT_ENTRIES and a complete copy of it is below: Any assistance in what to do would be appreciated! When the upgrade was done (which I got someone else to do for me) he also renamed my admin file so that it is harder to find/hack - could this be the problem?

    I do really appreciate any assistance.
    Goodnite Lingerie & Adult Toys
    www.goodnite.com.au

  7. #7
    Join Date
    Nov 2005
    Location
    Australia
    Posts
    28
    Plugin Contributions
    0

    Default Re: Error Message when Trying to Restrict Coupons

    <?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 17534 2010-09-08 19:50:34Z wilt $
    */
    //define('MAX_DISPLAY_RESTRICT_ENTRIES', 0);
    require('includes/application_top.php');
    $restrict_array = array();
    $restrict_array[] = array('id'=>'Deny', text=>'Deny');
    $restrict_array[] = array('id'=>'Allow', text=>'Allow');

    $the_path = $_POST['cPath'];
    if ($_GET['action']=='switch_status') {
    $status = $db->Execute("select coupon_restrict
    from " . TABLE_COUPON_RESTRICT . "
    where restrict_id = '" . $_GET['info'] . "'");

    $new_status = 'N';
    if ($status->fields['coupon_restrict'] == 'N') $new_status = 'Y';
    $db->Execute("update " . TABLE_COUPON_RESTRICT . "
    set coupon_restrict = '" . $new_status . "'
    where restrict_id = '" . $_GET['info'] . "'");
    }
    if ($_GET['action']=='add_category' && isset($_POST['cPath'])) {
    if ($_POST['cPath'] == 0) $_POST['cPath'] = -1;
    $test_query=$db->Execute("select * from " . TABLE_COUPON_RESTRICT . "
    where coupon_id = '" . $_GET['cid'] . "'
    and category_id = '" . $_POST['cPath'] . "'");

    if ($test_query->RecordCount() < 1) {
    $status = 'N';
    if ($_POST['restrict_status']=='Deny') $status = 'Y';
    $db->Execute("insert into " . TABLE_COUPON_RESTRICT . "
    (coupon_id, category_id, coupon_restrict)
    values ('" . $_GET['cid'] . "', '" . $_POST['cPath'] . "', '" . $status . "')");
    } else {
    // message that nothing is done
    $messageStack->add(ERROR_DISCOUNT_COUPON_DEFINED_CATEGORY . ' ' . $_POST['cPath'], 'caution');
    }
    }


    // from products dropdown selection
    if ($_GET['action']=='add_product' && $_POST['products_drop']) {
    $test_query=$db->Execute("select * from " . TABLE_COUPON_RESTRICT . " where coupon_id = '" . $_GET['cid'] . "' and product_id = '" . $_POST['products_drop'] . "'");
    if ($test_query->RecordCount() < 1) {
    $status = 'N';
    if ($_POST['restrict_status']=='Deny') $status = 'Y';

    // ==================================
    // bof: ALL ADD/DELETE of Products in one Category
    if ($_POST['products_drop'] < 0) {
    // adding new records
    if ($_POST['products_drop'] == -1) {
    // to insert new products from a given categories_id for a coupon_code that are not already in the table
    // products in the table from the catategories_id are skipped
    $new_products_query = "select products_id from products_to_categories where categories_id = '" . $_GET['build_cat'] . "' and products_id not in (select product_id from coupon_restrict where coupon_id = '" . $_GET['cid'] . "')";
    $new_products = $db->Execute($new_products_query);
    }

    if ($_POST['products_drop'] == -2) {
    // to delete existing products from a given categories_id for a coupon_code that are already in the table
    // products in the table from the catategories_id are skipped
    $new_products_query = "select products_id from products_to_categories where categories_id = '" . $_GET['build_cat'] . "' and products_id in (select product_id from coupon_restrict where coupon_restrict = '" . $status . "' and coupon_id = '" . $_GET['cid'] . "')";
    $new_products = $db->Execute($new_products_query);
    }

    // nothing to be done
    if ($new_products->RecordCount() == 0) {
    $messageStack->add(ERROR_DISCOUNT_COUPON_DEFINED_CATEGORY . ' ' . $_POST['cPath'], 'caution');
    }
    while(!$new_products->EOF) {
    // product passed and needs to be added/deleted
    // add all products from select category for each product not already defined in coupons_restrict
    if ($_POST['products_drop'] == -1) {
    $db->Execute("insert into " . TABLE_COUPON_RESTRICT . "
    (coupon_id, product_id, coupon_restrict)
    values ('" . $_GET['cid'] . "', '" . $new_products->fields['products_id'] . "', '" . $status . "')");
    } else {
    // removed as defined in coupons_restrict for either DENY or ALLOW
    $db->Execute("delete from " . TABLE_COUPON_RESTRICT . "
    WHERE coupon_id = '" . $_GET['cid'] . "'
    and product_id = '" . $new_products->fields['products_id'] . "'
    and coupon_restrict = '" . $status . "'");
    }

    $new_products->MoveNext();
    }
    // eof: ALL ADD/DELETE of Products in one Category
    // ==================================

    } else {
    // normal insert of product one by one allow/deny to coupon
    $db->Execute("insert into " . TABLE_COUPON_RESTRICT . "
    (coupon_id, product_id, coupon_restrict)
    values ('" . $_GET['cid'] . "', '" . $_POST['products_drop'] . "', '" . $status . "')");
    } // not all deny allow
    } else {
    $messageStack->add(ERROR_DISCOUNT_COUPON_DEFINED_PRODUCT . ' ' . $_POST['products_drop'], 'caution');
    }
    }
    if ($_GET['action']=='remove' && $_GET['info']) {
    $db->Execute("delete from " . TABLE_COUPON_RESTRICT . " where restrict_id = '" . $_GET['info'] . "'");
    }
    ?>
    <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html <?php echo HTML_PARAMS; ?>>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
    <title><?php echo TITLE; ?></title>
    <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
    <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
    <script language="javascript" src="includes/menu.js"></script>
    <script type="text/javascript">
    <!--
    function init()
    {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
    var kill = document.getElementById('hoverJS');
    kill.disabled = true;
    }
    }
    // -->
    </script>
    </head>
    <body onload="init()">
    <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
    <!-- header //-->
    <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
    <!-- header_eof //-->
    <!-- body //-->
    <table border="0" width="100%" cellspacing="2" cellpadding="2">
    <tr>
    <!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
    <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
    <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td class="pageHeading"><?php echo HEADING_TITLE_CATEGORY; ?></td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
    <tr class="dataTableHeadingRow">
    <td class="dataTableHeadingContent"><?php echo HEADER_COUPON_ID; ?></td>
    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_COUPON_NAME; ?></td>
    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_CATEGORY_ID; ?></td>
    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_CATEGORY_NAME; ?></td>
    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_RESTRICT_ALLOW; ?></td>
    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_RESTRICT_DENY; ?></td>
    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_RESTRICT_REMOVE; ?></td>
    </tr>
    <?php
    $cr_query_raw = "select * from " . TABLE_COUPON_RESTRICT . " where coupon_id = '" . $_GET['cid'] . "' and category_id != '0'";
    $cr_split = new splitPageResults($_GET['cpage'], MAX_DISPLAY_RESTRICT_ENTRIES, $cr_query_raw, $cr_query_numrows);
    $cr_list = $db->Execute($cr_query_raw);
    while (!$cr_list->EOF) {
    $rows++;
    if (strlen($rows) < 2) {
    $rows = '0' . $rows;
    }
    if (((!$_GET['cid']) || (@$_GET['cid'] == $cr_list->fields['restrict_id'])) && (!$cInfo)) {
    $cInfo = new objectInfo($cr_list->fields);
    }
    echo ' <tr class="dataTableRow">' . "\n";
    if ($cr_list->fields['category_id'] != -1) {
    $coupon = $db->Execute("select coupon_name from " . TABLE_COUPONS_DESCRIPTION . "
    where coupon_id = '" . $_GET['cid'] . "' and language_id = '" . $_SESSION['languages_id'] . "'");
    $category_name = zen_get_category_name($cr_list->fields['category_id'], $_SESSION['languages_id']);
    } else {
    $category_name = TEXT_ALL_CATEGORIES;
    }
    ?>
    <td class="dataTableContent"><?php echo $_GET['cid']; ?></td>
    <td class="dataTableContent" align="center"><?php echo $coupon->fields['coupon_name']; ?></td>
    <td class="dataTableContent" align="center"><?php echo $cr_list->fields['category_id']; ?></td>
    <td class="dataTableContent" align="center"><?php echo $category_name; ?></td>
    <?php
    if ($cr_list->fields['coupon_restrict']=='N') {
    echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $cr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ALLOW) . '</a></td>';
    } else {
    echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $cr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_DENY) . '</a></td>';
    }
    if ($cr_list->fields['coupon_restrict']=='Y') {
    echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $cr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ALLOW) . '</a></td>';
    } else {
    echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $cr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_DENY) . '</a></td>';
    }
    echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=remove&info=' . $cr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icons/delete.gif', IMAGE_REMOVE) . '</a></td>';
    ?>
    </tr>
    <?php
    $cr_list->MoveNext();
    }
    ?>
    <tr>
    <td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
    <tr>
    <td class="smallText" valign="top"><?php echo $cr_split->display_count($cr_query_numrows, MAX_DISPLAY_RESTRICT_ENTRIES, $_GET['cpage'], TEXT_DISPLAY_NUMBER_OF_CATEGORIES); ?></td>
    <td class="smallText" align="right"><?php echo $cr_split->display_links($cr_query_numrows, MAX_DISPLAY_RESTRICT_ENTRIES, MAX_DISPLAY_PAGE_LINKS, $_GET['cpage'],zen_get_all_get_params(array('cpage','action', 'x', 'y')),'cpage'); ?></td>
    </tr>
    </table></td>
    </tr>
    <tr><form name="restrict_category" method="post" action="<?php echo zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=add_category&info=' . $cInfo->restrict_id, 'NONSSL'); ?>">
    <td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
    <tr>
    <td class="smallText" valign="top"><?php echo HEADER_CATEGORY_NAME; ?></td>
    <td class="smallText" align="left"></td>
    <td class="smallText" align="left"><?php echo zen_draw_pull_down_menu('cPath', zen_get_category_tree(), $current_category_id); ?></td>
    <td class="smallText" align="left"><?php echo zen_draw_pull_down_menu('restrict_status', $restrict_array, $current_category_id); ?></td>
    <td class="smallText" align="left"><input type="submit" name="add" value="Add"></td>
    <td class="smallText" align="left">&nbsp;</td>
    <td class="smallText" align="left">&nbsp;</td>
    </tr>
    </table></td>
    </tr></form>
    </table></td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
    </tr>
    <tr>
    <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
    </tr>
    <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td class="pageHeading"><?php echo HEADING_TITLE_PRODUCT; ?></td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
    <tr class="dataTableHeadingRow">
    <td class="dataTableHeadingContent"><?php echo HEADER_COUPON_ID; ?></td>
    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_COUPON_NAME; ?></td>
    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_PRODUCT_ID; ?></td>
    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_PRODUCT_NAME; ?></td>
    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_RESTRICT_ALLOW; ?></td>
    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_RESTRICT_DENY; ?></td>
    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_RESTRICT_REMOVE; ?></td>
    </tr>
    <?php
    $pr_query_raw = "select * from " . TABLE_COUPON_RESTRICT . " where coupon_id = '" . $_GET['cid'] . "' and product_id != '0'";
    $pr_split = new splitPageResults($_GET['ppage'], MAX_DISPLAY_RESTRICT_ENTRIES, $pr_query_raw, $pr_query_numrows);
    $pr_list = $db->Execute($pr_query_raw);
    while (!$pr_list->EOF) {
    $rows++;
    if (strlen($rows) < 2) {
    $rows = '0' . $rows;
    }
    if (((!$_GET['cid']) || (@$_GET['cid'] == $cr_list->fields['restrict_id'])) && (!$pInfo)) {
    $pInfo = new objectInfo($pr_list);
    }
    echo ' <tr class="dataTableRow">' . "\n";

    $coupon = $db->Execute("select coupon_name from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $_GET['cid'] . "' and language_id = '" . $_SESSION['languages_id'] . "'");
    $product_name = zen_get_products_name($pr_list->fields['product_id'], $_SESSION['languages_id']);
    ?>
    <td class="dataTableContent"><?php echo $_GET['cid']; ?></td>
    <td class="dataTableContent" align="center"><?php echo $coupon->fields['coupon_name']; ?></td>
    <td class="dataTableContent" align="center"><?php echo $pr_list->fields['product_id']; ?></td>
    <td class="dataTableContent" align="left"><?php echo '<strong>' . $product_name . '</strong><br />' . TEXT_CATEGORY . zen_get_categories_name_from_product($pr_list->fields['product_id']) . '<br />' . TEXT_MANUFACTURER . zen_get_products_manufacturers_name($pr_list->fields['product_id']); ?></td>
    <?php
    if ($pr_list->fields['coupon_restrict']=='N') {
    echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $pr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ALLOW) . '</a></td>';
    } else {
    echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $pr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_DENY) . '</a></td>';
    }
    if ($pr_list->fields['coupon_restrict']=='Y') {
    echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $pr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_DENY) . '</a></td>';
    } else {
    echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $pr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ALLOW) . '</a></td>';
    }
    echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=remove&info=' . $pr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icons/delete.gif', IMAGE_REMOVE) . '</a></td>';
    ?>
    </tr>
    <?php
    $pr_list->MoveNext();
    }
    ?>
    Goodnite Lingerie & Adult Toys
    www.goodnite.com.au

  8. #8
    Join Date
    Nov 2005
    Location
    Australia
    Posts
    28
    Plugin Contributions
    0

    Default Re: Error Message when Trying to Restrict Coupons

    <tr>
    <td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
    <tr>
    <td class="smallText" valign="top"><?php echo $pr_split->display_count($pr_query_numrows, MAX_DISPLAY_RESTRICT_ENTRIES, $_GET['ppage'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
    <td class="smallText" align="right"><?php echo $pr_split->display_links($pr_query_numrows, MAX_DISPLAY_RESTRICT_ENTRIES, MAX_DISPLAY_PAGE_LINKS, $_GET['ppage'],zen_get_all_get_params(array('ppage','action', 'x', 'y')),'ppage'); ?></td>
    </tr>
    </table></td>
    </tr>
    <tr><form name="restrict_category" method="post" action="<?php echo zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=add_category&info=' . $cInfo->restrict_id, 'NONSSL'); ?>">
    <td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
    <tr>
    <?php
    if (isset($_POST['cPath_prod'])) $current_category_id = $_POST['cPath_prod'];
    $products = $db->Execute("select p.products_id, pd.products_name from " .
    TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
    where p.products_id = pd.products_id and pd.language_id = '" . $_SESSION['languages_id'] . "'
    and p.products_id = p2c.products_id and p2c.categories_id = '" . $_POST['cPath_prod'] . "'
    order by pd.products_name");
    $products_array = array();

    if (!$products->EOF) {
    $products_array[] = array('id' => '-1',
    'text' => TEXT_ALL_PRODUCTS_ADD);
    $products_array[] = array('id' => '-2',
    'text' => TEXT_ALL_PRODUCTS_REMOVE);
    }

    while (!$products->EOF) {
    $products_array[] = array('id'=>$products->fields['products_id'],
    'text'=>$products->fields['products_name']);
    $products->MoveNext();
    }
    ?>
    <td class="smallText" valign="top"><?php echo HEADER_CATEGORY_NAME; ?></td>
    <td class="smallText" align="left"></td><form name="restrict_product" method="post" action="<?php echo zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'info=' . $cInfo->restrict_id, 'NONSSL'); ?>">
    <?php echo zen_hide_session_id(); ?>
    <td class="smallText" align="left"><?php echo zen_draw_pull_down_menu('cPath_prod', zen_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"'); ?></td></form>
    <?php if (sizeof($products_array) > 0) { ?>
    <form name="restrict_category" method="post" action="<?php echo zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=add_product&info=' . $cInfo->restrict_id . '&build_cat=' . $current_category_id, 'NONSSL'); ?>">
    <td class="smallText" valign="top"><?php echo HEADER_PRODUCT_NAME; ?></td>
    <td class="smallText" align="left"><?php echo zen_draw_pull_down_menu('products_drop', $products_array, $current_category_id); ?></td>
    <td class="smallText" align="left"><?php echo zen_draw_pull_down_menu('restrict_status', $restrict_array); ?></td>
    <td class="smallText" align="left"><input type="submit" name="add" value="Update"></td>
    <td class="smallText" align="left">&nbsp;</td>
    <td class="smallText" align="left">&nbsp;</td>
    <?php } else { ?>
    <td class="smallText" align="left" colspan="6">&nbsp;</td>
    <?php } ?>
    </tr>
    <tr>
    <td class="smallText" align="left" colspan = "9"><?php echo TEXT_INFO_ADD_DENY_ALL; ?></td>
    </tr>
    </table></td>
    </tr></form>
    </table></td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
    </tr>
    <tr>
    <td align="right" colspan="2" class="smallText"><?php echo '<a href="' . zen_href_link(FILENAME_COUPON_ADMIN, 'page=' . $_GET['page'] . '&cid=' . (!empty($cInfo->coupon_id) ? $cInfo->coupon_id : $_GET['cid']) . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '')) . '">' . zen_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
    </tr>
    </table></td>
    <!-- body_text_eof //-->
    </tr>
    </table>
    <!-- body_eof //-->

    <!-- footer //-->
    <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
    <!-- footer_eof //-->
    <br>
    </body>
    </html>
    <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>



    SORRY If its too long
    Goodnite Lingerie & Adult Toys
    www.goodnite.com.au

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

    Default Re: Error Message when Trying to Restrict Coupons

    Could you be specific on the current error you are getting?

    Do you see any debug logs in your:
    /cache

    directory?
    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!

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

    Default Re: Error Message when Trying to Restrict Coupons

    Do you have this line in your file:
    /your_secret_admin_dir/includes/languages/english/coupon_restrict.php

    Line #27 : define('MAX_DISPLAY_RESTRICT_ENTRIES', 20);
    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!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. error message when trying to checkout
    By sflasal in forum General Questions
    Replies: 1
    Last Post: 3 Feb 2011, 02:46 AM
  2. Error message when trying to run upgrade 1.3.7 to 1.3.8
    By huwmac in forum Upgrading from 1.3.x to 1.3.9
    Replies: 5
    Last Post: 10 Apr 2008, 08:24 AM
  3. Error Message when trying to create account
    By kimberlyeddy in forum Managing Customers and Orders
    Replies: 14
    Last Post: 5 Aug 2007, 04:44 AM
  4. Error Message when trying to insert attributes?
    By PetesTown in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 2 Aug 2007, 06:16 AM
  5. Error message when trying to select a template
    By lollyloopp in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 11 Nov 2006, 04:36 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