Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 47
  1. #21
    Join Date
    Jul 2012
    Posts
    346
    Plugin Contributions
    0

    Default Re: Coupon Restriction by Manufacturer

    Quote Originally Posted by Ajeh View Post
    Eeeks! I might have found it ...

    You use prefixes on your database tables?

    I tried adding prefix but still same thing. Just to make sure where should I add prefix in following lines:

    Code:
    if ($_GET['build_man'] > 0 && $_POST['products_drop'] == -1) {
              // to insert new products from a given manufacturers_id for a coupon_code that are not already in the table
              // products in the table from the manufacturers_id are skipped
                $new_products_query = "select products_id from products where manufacturers_id = '" . $_GET['build_man'] . "' and products_id not in (select product_id from coupon_restrict where coupon_id = '" . $_GET['cid'] . "')";
                $new_products = $db->Execute($new_products_query);
              }
    
              if ($_GET['build_man'] > 0 && $_POST['products_drop'] == -2) {
              // to delete existing products from a given manufacturers_id for a coupon_code that are already in the table
              // products in the table from the manufacturers_id are skipped
                $new_products_query = "select products_id from products where manufacturers_id = '" . $_GET['build_man'] . "' 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);

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

    Default Re: Coupon Restriction by Manufacturer

    Change line 90 from:
    Code:
                $new_products_query = "select products_id from products where manufacturers_id = '" . $_GET['build_man'] . "' and products_id not in (select product_id from coupon_restrict where coupon_id = '" . $_GET['cid'] . "')";
    to read:
    Code:
                $new_products_query = "select products_id from " . TABLE_PRODUCTS . " where manufacturers_id = '" . $_GET['build_man'] . "' and products_id not in (select product_id from " . TABLE_COUPON_RESETRICT . " where coupon_id = '" . $_GET['cid'] . "')";
    change line 97:
    Code:
                $new_products_query = "select products_id from products where manufacturers_id = '" . $_GET['build_man'] . "' and products_id in (select product_id from coupon_restrict where coupon_restrict = '" . $status . "' and coupon_id = '" . $_GET['cid'] . "')";
    to read:
    Code:
                $new_products_query = "select products_id from " . TABLE_PRODUCTS . " where manufacturers_id = '" . $_GET['build_man'] . "' and products_id in (select product_id from " . TABLE_COUPON_RESETRICT . " where coupon_restrict = '" . $status . "' and coupon_id = '" . $_GET['cid'] . "')";
    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. #23
    Join Date
    Jul 2012
    Posts
    346
    Plugin Contributions
    0

    Default Re: Coupon Restriction by Manufacturer

    Quote Originally Posted by Ajeh View Post
    Change line 90 from:
    Code:
                $new_products_query = "select products_id from products where manufacturers_id = '" . $_GET['build_man'] . "' and products_id not in (select product_id from coupon_restrict where coupon_id = '" . $_GET['cid'] . "')";
    to read:
    Code:
                $new_products_query = "select products_id from " . TABLE_PRODUCTS . " where manufacturers_id = '" . $_GET['build_man'] . "' and products_id not in (select product_id from " . TABLE_COUPON_RESETRICT . " where coupon_id = '" . $_GET['cid'] . "')";
    change line 97:
    Code:
                $new_products_query = "select products_id from products where manufacturers_id = '" . $_GET['build_man'] . "' and products_id in (select product_id from coupon_restrict where coupon_restrict = '" . $status . "' and coupon_id = '" . $_GET['cid'] . "')";
    to read:
    Code:
                $new_products_query = "select products_id from " . TABLE_PRODUCTS . " where manufacturers_id = '" . $_GET['build_man'] . "' and products_id in (select product_id from " . TABLE_COUPON_RESETRICT . " where coupon_restrict = '" . $status . "' and coupon_id = '" . $_GET['cid'] . "')";
    Changed but still same error in admin. Log shows following now:

    Code:
    [05-Nov-2014 21:49:47] PHP Fatal error:  1146:Table 'zencart.TABLE_COUPON_RESETRICT' doesn't exist :: select products_id from zen_products where manufacturers_id = '24' and products_id not in (select product_id from TABLE_COUPON_RESETRICT where coupon_id = '10') ==> (as called by) /home/public_html/admin/coupon_restrict.php on line 91 <== in /home/public_html/includes/classes/db/mysql/query_factory.php on line 155

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

    Default Re: Coupon Restriction by Manufacturer

    Sorry typo ... change all of the:
    TABLE_COUPON_RESETRICT

    to be:
    TABLE_COUPON_RESTRICT
    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. #25
    Join Date
    Jul 2012
    Posts
    346
    Plugin Contributions
    0

    Default Re: Coupon Restriction by Manufacturer

    Quote Originally Posted by Ajeh View Post
    Sorry typo ... change all of the:
    TABLE_COUPON_RESETRICT

    to be:
    TABLE_COUPON_RESTRICT

    Thank you! working now :)

    Do you know if this is possible.
    Customer apply a coupon code on checkout and a free product get added to their cart per that coupon instead of any discount?

    I know right now it is possible if customer add a product to cart and then apply coupon and coupon can make that product free/discounted but is it possible free product get auto added to cart when they apply coupon?

  6. #26
    Join Date
    Jul 2012
    Posts
    346
    Plugin Contributions
    0

    Default Re: Coupon Restriction by Manufacturer

    Quote Originally Posted by Ajeh View Post
    Sorry typo ... change all of the:
    TABLE_COUPON_RESETRICT

    to be:
    TABLE_COUPON_RESTRICT
    Ajeh,
    I noticed today there is still an issue. In admin it adds manufacturer product (s) but on live site customer can use coupon for any products by other manufacturers.

    Any idea how to apply fix on this?

  7. #27
    Join Date
    Jul 2012
    Posts
    346
    Plugin Contributions
    0

    Default Re: Coupon Restriction by Manufacturer

    I did try to add restrict_to_manufacturer, to includes/modules/ordertotal/ot_coupon.php but it shows error on page load. Log shows
    "1054:Unknown column 'restrict_to_manufacturer'............"

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

    Default Re: Coupon Restriction by Manufacturer

    What are your restrictions set up as on your Discount Coupon?

    It sounds like perhaps you did not set:
    Top DENY

    on the Discount Coupon when you set the Manufacturer Products to ALLOW ...
    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. #29
    Join Date
    Jul 2012
    Posts
    346
    Plugin Contributions
    0

    Default Re: Coupon Restriction by Manufacturer

    I think that was the problem and it is working now.

    Order total is $118 when I applied coupon it gave error "You must spend at least $50.00 to redeem this coupon"
    Can we show brand name in error like You must spend at least $50.00 on abc brand products to redeem this coupon?

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

    Default Re: Coupon Restriction by Manufacturer

    The ability to select by Manufacturer is just in the Admin to grab the right Products ... once the restrictions are set, there is nothing about the Discount Coupon to indicate the Manufacturer ...

    You would have to do additional custom coding to manage this further ...
    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 3 of 5 FirstFirst 12345 LastLast

Similar Threads

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