Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2012
    Posts
    331
    Plugin Contributions
    0

    Default Apply coupon even when discount is 0.00

    Hello,
    Here's what i'm trying to accomplish, i want to have a coupon code which provides no discount or additional product, it is just for tracking purposes (we will gift customer using the coupon) but if the discount amount is 0.00 the coupon will not show on order, is there a way to tweak it should show even when 0.00 discount?

    TIA

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

    Default Re: Apply coupon even when discount is 0.00

    While you could take out the safety check of a value being set for the discount in the ot_coupon.php by changing the > 0 to >= 0 ...
    Code:
      function process() {
        global $order, $currencies;
        $order_total = $this->get_order_total(isset($_SESSION['cc_id']) ? $_SESSION['cc_id'] : '');
        $od_amount = $this->calculate_deductions($order_total['total']);
        $this->deduction = $od_amount['total'];
        if ($od_amount['total'] >= 0) {
    You will/may have other customizations to make the discount make sense ...
    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 2012
    Posts
    331
    Plugin Contributions
    0

    Default Re: Apply coupon even when discount is 0.00

    Quote Originally Posted by Ajeh View Post
    While you could take out the safety check of a value being set for the discount in the ot_coupon.php by changing the > 0 to >= 0 ...
    Code:
      function process() {
        global $order, $currencies;
        $order_total = $this->get_order_total(isset($_SESSION['cc_id']) ? $_SESSION['cc_id'] : '');
        $od_amount = $this->calculate_deductions($order_total['total']);
        $this->deduction = $od_amount['total'];
        if ($od_amount['total'] >= 0) {
    You will/may have other customizations to make the discount make sense ...
    It works, but this way a discount coupon field is displayed on all orders with a 0.00 discount

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

    Default Re: Apply coupon even when discount is 0.00

    Try using:
    Code:
        if ($od_amount['total'] >= 0 && isset($_SESSION['cc_id'])) {
    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 2012
    Posts
    331
    Plugin Contributions
    0

    Default Re: Apply coupon even when discount is 0.00

    Quote Originally Posted by Ajeh View Post
    Try using:
    Code:
        if ($od_amount['total'] >= 0 && isset($_SESSION['cc_id'])) {
    Works! Thanks a mil!

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

    Default Re: Apply coupon even when discount is 0.00

    Thanks for the update that this was able to work 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!

 

 

Similar Threads

  1. v151 Apply coupon discount to more than one line item
    By keyconn in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 22
    Last Post: 3 Jun 2015, 11:04 PM
  2. v151 Can I apply free shipping over a certain price when coupon used
    By oavs in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 20 Feb 2015, 04:17 AM
  3. Discount Coupon does not apply to linked products in a Category
    By farhansabir in forum General Questions
    Replies: 3
    Last Post: 6 Mar 2010, 09:27 PM
  4. Coupon welcome message showing discount when coupon is expired
    By tracyselena in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 4
    Last Post: 26 Jan 2007, 06:32 PM
  5. How might I apply a 20% discount to one product when another is present?
    By cpk in forum Setting Up Specials and SaleMaker
    Replies: 1
    Last Post: 5 Jun 2006, 07:40 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