Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2007
    Posts
    48
    Plugin Contributions
    0

    Default Gift Certificates causing fatal error when applying a coupon to them

    We were testing to see that our coupon code would work, and when applying it to a gift certificate, and after entering all CC info and advancing from step 2 to step 3 it brings up this fatal error:

    Warning: Division by zero in /mnt/target02/342199/342988/www.fleurdepup.com/web/content/includes/modules/order_total/ot_coupon.php on line 364

    within the screen. The site is not totally broken, but the font sizes get huge, and this bit of fatal error code is displayed in the header as well as in the body above the subtotal.

    if you click on confirm anyway, you are brought to an error screen that says the same fatal error from above twice and then this:

    Warning: Cannot modify header information - header already sent by (output started at /mnt/target02/342199/342988/www.fleurdepup.com/web/content/includes/modules/order_total/ot_coupon.php:364)
    in (/mnt/target02/342199/342988/www.fleurdepup.com/web/content/includes/functions/functions_general.php on line 44

    However when we apply the same coupon code to a product other than the gift certificate, the coupon code works as expected.

    What could the problem be?

    Rich
    [FONT="Georgia"]Rich Staats
    Your snowboarding, web designing, problem solving, social networking, trying to f' with eCommerce type of Guy.[/FONT]

  2. #2
    Join Date
    Jun 2003
    Posts
    33,715
    Plugin Contributions
    0

    Default Re: Gift Certificates causing fatal error when applying a coupon to them

    Well - first - Gift Certificates are set up so that you cannot apply discounts to them ...
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #3
    Join Date
    Sep 2007
    Posts
    48
    Plugin Contributions
    0

    Default Re: Gift Certificates causing fatal error when applying a coupon to them

    are you saying that by default they wont except them? Because when you are in the process of purchasing one, (step 2) there is an option field to insert a coupon code. And when you do so, it returns that error

    Any further thoughts.

    BTW. Thank you so much for that quick reply!

    Rich
    [FONT="Georgia"]Rich Staats
    Your snowboarding, web designing, problem solving, social networking, trying to f' with eCommerce type of Guy.[/FONT]

  4. #4
    Join Date
    Sep 2007
    Posts
    48
    Plugin Contributions
    0

    Default Re: Gift Certificates causing fatal error when applying a coupon to them

    Should we consider this a bug?
    [FONT="Georgia"]Rich Staats
    Your snowboarding, web designing, problem solving, social networking, trying to f' with eCommerce type of Guy.[/FONT]

  5. #5
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,897
    Plugin Contributions
    4

    Default Re: Gift Certificates causing fatal error when applying a coupon to them

    There is a bug in the coupon code, which was posted elsewhere. This generates the division by zero error, and is not just related to use with Gift Vouchers.

    You can fix that by changing the line in question (line 364) from

    PHP Code:
    $ratioTax $adjustedTax/$order->info['tax']; 
    to

    PHP Code:
    $ratioTax = (isset($order->info['tax']) && $order->info['tax'] != 0) ? $adjustedTax/$order->info['tax'] : 0
    in includes/modules/order_totals/ot_coupon.php

    However as Kim noted, their is logic in place to disallow Gift Vouchers from the order total that Coupons are applied against.

  6. #6
    Join Date
    Nov 2007
    Posts
    49
    Plugin Contributions
    0

    Default Re: Gift Certificates causing fatal error when applying a coupon to them

    Thank you so much for this fix. It worked. Don't know what side effect it will have on gift certificates, but at least for me, I have the gift cert feature turned off...and now it's all back in order.

 

 

Similar Threads

  1. v150 PayPal Gift Certificate/Discount Coupon causing error
    By wil_sutton in forum PayPal Express Checkout support
    Replies: 1
    Last Post: 8 Jul 2012, 06:48 PM
  2. Duplicate entry error when trying to send Gift Certificates
    By thegolfguru in forum General Questions
    Replies: 0
    Last Post: 10 Dec 2010, 07:54 PM
  3. Credit Card Error when processing Gift Certificates in 1.3.9f (worked in 1.3.8a)
    By bigwig in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 1
    Last Post: 20 Sep 2010, 10:23 PM
  4. Preventing Group Discounts Applying to Gift Certificates
    By rbev01 in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 3
    Last Post: 17 Apr 2007, 10:00 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