Page 3 of 3 FirstFirst 123
Results 21 to 23 of 23
  1. #21
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Apply coupon discount to more than one line item

    This should work for you ...

    Edit the file:
    /includes/modules/order_total/ot_coupon.php

    and add the code in RED:
    Code:
            if (strval($orderTotalDetails['orderTotal']) >= $coupon->fields['coupon_minimum_order'])
            {
    if ($coupon->fields['coupon_type'] == 'F' || $coupon->fields['coupon_type'] == 'O') {
      global $cart;
      $products = $_SESSION['cart']->get_products();
      $coupon_product_count = 0;
      for ($i=0; $i<sizeof($products); $i++) {
        if (is_product_valid($products[$i]['id'], $coupon->fields['coupon_id'])) {
          $coupon_product_count += $_SESSION['cart']->get_quantity($products[$i]['id']);
        }
      }
    //$messageStack->add_session('checkout_payment', 'Coupon cont: ' . $coupon_product_count, 'caution');
    }
              switch($coupon->fields['coupon_type'])
    Then edit the line:
    Code:
                case 'F':
                  $od_amount['total'] = zen_round($coupon->fields['coupon_amount'] * ($orderTotalDetails['orderTotal']>0) * $coupon_product_count, $currencyDecimalPlaces);
                  $od_amount['type'] = $coupon->fields['coupon_type']; // amount off 'F' or amount off and free shipping 'O'
                  $ratio = $od_amount['total']/$orderTotalDetails['orderTotal'];
                  break;
    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!

  2. #22
    Join Date
    Apr 2015
    Location
    Pennsylvania, USA
    Posts
    21
    Plugin Contributions
    0

    Default Re: Apply coupon discount to more than one line item

    Works beautifully! Thank You!

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

    Default Re: Apply coupon discount to more than one line item

    You are most welcome ... thanks for the update that this works for you ...

    I have built this into Zen Cart v1.6 the ability to have this feature and set it per Discount 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!

 

 
Page 3 of 3 FirstFirst 123

Similar Threads

  1. Shipping Discount on More Than 1 Item?
    By gabstero in forum Addon Shipping Modules
    Replies: 0
    Last Post: 27 Feb 2012, 05:57 PM
  2. Add more than one pic with one item
    By drago in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 16 Sep 2011, 12:45 AM
  3. coupon codes that apply to one item only
    By MB1 in forum Setting Up Specials and SaleMaker
    Replies: 3
    Last Post: 4 Oct 2010, 04:43 PM
  4. How do i insert more than one image for one item?
    By len47811 in forum General Questions
    Replies: 8
    Last Post: 23 Aug 2010, 06:41 AM
  5. apply one attribute to more than one product?
    By dellvostro in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 27 Oct 2008, 12:39 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