Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    2,008
    Plugin Contributions
    1

    Default Discount Category TOP Deny problem

    Discount Coupon
    10% discount
    Category Top Deny
    Product Restrictions: One specific product ALLOW

    Discount Coupon Code functions as desired. If customer does not have the specific item in the cart, they get the RED error message. When the specific item is in the cart, they get the GREEN success message.

    The issue is IF they click on the coupon code in the checkout screen, they see:

    Category This coupon is valid for all categories.

    This portion of the message is the same regardless of Category Top Deny or Category Top Allow
    Customer calls very grumpy because the text for the discount coupon indicates that it is valid for all categories and the discount was not applied to the entire order. Discount was applied as intended by the discount setup.

    Have I missed something in the setup? Is it a terminology issue?

    V1.3.9h

    TNX
    Rick

    Discount code: SSW0612JPL


    =========================================
    Complete text of the coupon code popup window:

    Congratulations, you have redeemed a Discount Coupon.

    Coupon Name : SSW JunJul 2012

    The coupon is worth 10.00% discount against your order

    The coupon is valid between 05/13/2012 and 05/13/2013

    Product/Category Restrictions


    Category
    • This coupon is valid for all categories.

    Product
    • JPL3 Square Bracelet ►►► (Allowed)

    Discount Coupons may not be applied towards the purchase of Gift Certificates.
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

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

    Default Re: Discount Category TOP Deny problem

    Hate that issue ...

    Give a bit, as in 10 minutes to 48 hours, to fool with this one and come up with a better solution to how to manage this code for the messages and not goober up the code for other combinations ...
    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
    Aug 2009
    Location
    North Idaho, USA
    Posts
    2,008
    Plugin Contributions
    1

    Default Re: Discount Category TOP Deny problem

    TNX Linda. This was the first customer in 3 years who has ever clicked the discount code to see the text and I never noticed that the discount code was a link so it took me a while to figure out how they were reading the text.

    If it requires "too much goobering", we understand and can live with it.
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

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

    Default Re: Discount Category TOP Deny problem

    You can try this change to the file:
    /includes/modules/discount_coupon/header_php.php

    with the code in RED:
    Code:
          $cats = array();
          $skip_cat_restriction = true;
    
    // bof: of fix for Product Only 
    /*
          while (!$get_result->EOF) {
            if ($get_result->fields['coupon_restrict'] == 'N') {
              $restrict = TEXT_CAT_ALLOWED;
            } else {
              $restrict = TEXT_CAT_DENIED;
            }
            if ($get_result->RecordCount() != 1 and $get_result->fields['category_id'] != '-1') {
              $result = $db->Execute("SELECT * FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_id = cd.categories_id
              and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' and c.categories_id='" . $get_result->fields['category_id'] . "'");
              $cats[] = array("validity"=> ($get_result->fields['coupon_restrict'] =='N' ? 'A' : 'D'), 'name'=> $result->fields["categories_name"], 'link'=>'<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . (int)$result->fields['categories_id']) . '">' . $result->fields["categories_name"] . '</a>' . $restrict);
            }
            $get_result->MoveNext();
          }
    
          if ($skip_cat_restriction == false || sizeof($cats) == 0) $cats[] = array("link" => TEXT_NO_CAT_RESTRICTIONS);
    */
    
    
          while (!$get_result->EOF) {
            if ($get_result->fields['coupon_restrict'] == 'N') {
              $restrict = TEXT_CAT_ALLOWED;
            } else {
              $restrict = TEXT_CAT_DENIED;
            }
            if ($get_result->RecordCount() != 1 and $get_result->fields['category_id'] != '-1') {
              $result = $db->Execute("SELECT * FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_id = cd.categories_id
              and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' and c.categories_id='" . $get_result->fields['category_id'] . "'");
              $cats[] = array("validity"=> ($get_result->fields['coupon_restrict'] =='N' ? 'A' : 'D'), 'name'=> $result->fields["categories_name"], 'link'=>'<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . (int)$result->fields['categories_id']) . '">' . $result->fields["categories_name"] . '</a>' . $restrict);
    $no_categories = '';
            } else {
    $no_categories = '<p>Specific Products Only</p>';
            }
            $get_result->MoveNext();
          }
    
          if ($skip_cat_restriction == false || (sizeof($cats) == 0 && !$no_categories)) {
            $cats[] = array("link" => TEXT_NO_CAT_RESTRICTIONS);
          } else {
            if ($no_categories != '') {
              $cats[] = array("link" => $no_categories);
            }
          }
    // eof: of fix for Product Only 
    
          sort($cats);
          $mycats = array();
    Not a perfect solution but takes away the confusion on that ...

    NOTE: check other Discount Coupons to ensure they still look good ...
    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
    Aug 2009
    Location
    North Idaho, USA
    Posts
    2,008
    Plugin Contributions
    1

    Default Re: Discount Category TOP Deny problem

    You can try this change to the file:
    /includes/modules/discount_coupon/header_php.php
    I assume that you meant:
    /includes/modules/pages/discount_coupon/header_php.php

    but there is no change in the text displayed to the customer in:

    /index.php?main_page=popup_coupon_help&cID=51

    after inserting the code in red.

    OR
    /includes/templates/template_default/popup_coupon_help/tpl_main_page.php

    Text is displayed as expected in the coupon popup window now.

    Do I leave the code in both files or just one? OR have I really messed things up thinking that I am helping?



    Code:
    $cats = array();
    $skip_cat_restriction = true;
    
    Added RED code here in front of existing code in blue
    
          while (!$get_result->EOF) {
            if ($get_result->fields['coupon_restrict'] == 'N') {
              $restrict = TEXT_CAT_ALLOWED;
            } else {
              $restrict = TEXT_CAT_DENIED;
            }
            if ($get_result->RecordCount() != 1 and $get_result->fields['category_id'] != '-1') {
              $result = $db->Execute("SELECT * FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_id = cd.categories_id
              and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' and c.categories_id='" . $get_result->fields['category_id'] . "'");
              $cats[] = array("validity"=> ($get_result->fields['coupon_restrict'] =='N' ? 'A' : 'D'), 'name'=> $result->fields["categories_name"], 'link'=>'<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . (int)$result->fields['categories_id']) . '">' . $result->fields["categories_name"] . '</a>' . $restrict);
            }
            $get_result->MoveNext();
          }
    
          if ($skip_cat_restriction == false || sizeof($cats) == 0) $cats[] = array("link" => TEXT_NO_CAT_RESTRICTIONS);
    
      sort($cats);
      $mycats = array();
    Last edited by RixStix; 27 May 2012 at 06:57 PM. Reason: typo
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

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

    Default Re: Discount Category TOP Deny problem

    Replace the code between the two sections in BLACK with the code in RED ...
    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
    Aug 2009
    Location
    North Idaho, USA
    Posts
    2,008
    Plugin Contributions
    1

    Default Re: Discount Category TOP Deny problem

    Sorry. I read change and inserted rather than replace.

    Still not certain which one of the two files you meant, so I replaced the code in both files.

    Change to /includes/modules/pages/discount_coupon/header_php.php did not seem to have any effect (that I could see).

    Change to /includes/templates/template_default/popup_coupon_help/tpl_main_page.php did change text in the coupon popup as expected.

    Thank you for the help.
    This also taught us the lesson to be very specific in our choice of words for print ads that appear in Internationally circulated magazines.
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

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

    Default Re: Discount Category TOP Deny problem

    This one:
    Change to /includes/modules/pages/discount_coupon/header_php.php did not seem to have any effect (that I could see).
    should of fixed it when you go to check the Discount Coupon from the Information link ...

    This one would work in the checkout:
    /includes/templates/template_default/popup_coupon_help/tpl_main_page.php
    I am not sure why it would not work for you on the discount_coupon page ...

    What are your exact Restrictions settings on this coupon?
    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!

  9. #9
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    2,008
    Plugin Contributions
    1

    Default Re: Discount Category TOP Deny problem

    Sorry. Brainfart on this end, only looking in one place.

    It's fine in both places. I wasn't even thinking about the information link.

    The exact settings are
    category restrictions top deny
    product restrictions: Product ID 258 allow

    All appears well in the discount coupon world. Thank you helping me.
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

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

    Default Re: Discount Category TOP Deny problem

    Thanks for the update that this is now working for you ...
    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!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. hide or deny Delete options For category and product
    By jennydutch in forum Customization from the Admin
    Replies: 5
    Last Post: 21 Apr 2014, 05:16 PM
  2. What are the coupon category apply/deny rules?
    By GerryTheMole in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 7
    Last Post: 6 Feb 2011, 07:45 PM
  3. Deny multiple discount code entry
    By hookedoncarp in forum General Questions
    Replies: 1
    Last Post: 5 Sep 2010, 06:04 PM
  4. Products in Top Level Category - Easy Populate Problem
    By stomm in forum Setting Up Categories, Products, Attributes
    Replies: 13
    Last Post: 14 Jan 2010, 01:16 PM
  5. BetterCategories -- Top Category Rollover Problem
    By srturner47 in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 4 Nov 2007, 12:43 AM

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