Page 4 of 6 FirstFirst ... 23456 LastLast
Results 31 to 40 of 60
  1. #31
    Join Date
    Jan 2004
    Posts
    66,380
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Coupons, some bugs?

    Try this:
    Edit /includes/modules/order_total/ot_coupon.php
    Line 476 says this:
    Code:
        $order_total = array('totalFull'=>$orderTotalFull, 'total'=>$order_total, 'tax'=>$order_total_tax, 'totalInclusive'=>$orderTotalInclusive);
    Change that to this (note the extra lines added too):
    Code:
        global $currencies;
        $prec = $currencies->get_decimal_places();
        $order_total = array('totalFull'=>zen_round($orderTotalFull, $prec), 'total'=>zen_round($order_total, $prec), 'tax'=>zen_round($order_total_tax, $prec), 'totalInclusive'=>zen_round($orderTotalInclusive, $prec));
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  2. #32
    Join Date
    Oct 2005
    Location
    Finland
    Posts
    186
    Plugin Contributions
    1

    Default Re: Coupons, some bugs?

    Quote Originally Posted by DrByte View Post
    In that scenario, with a 1000 product, and flat-rate shipping, and setting the ot_coupon module's "Include Shipping" option to false it rejects the 1000 coupon. With the "Include Shipping" option to true, it accepts the coupon.
    Yes, but then it includes shipping. And gives discount on a lower amount than intended. We normaly don't want to give discount on the shipping price, only on the products total.

    Do you follow my thinking?

    Btw! Also discovered same problem, other way around on group pricing - where the customers gets to high discount.

  3. #33
    Join Date
    Oct 2005
    Location
    Finland
    Posts
    186
    Plugin Contributions
    1

    Default Re: Coupons, some bugs?

    With include shipping the coupon will work on:
    Sub-Total: Kr.993,75,-

    Flat Rate (Best Way): Kr.6,25,-

    Discount Coupon: 10off : -Kr.100,00,-

    Incl. 25% MVA: Kr.180,00,-

    Total: Kr.900,00,-
    And when the shipping cost then is 15-25% of the order total ...

  4. #34
    Join Date
    Oct 2005
    Location
    Finland
    Posts
    186
    Plugin Contributions
    1

    Default Re: Coupons, some bugs?

    Quote Originally Posted by DrByte View Post
    If so, then the line which you subsequently commented out wouldn't be firing, thus not impacting you, and thus that line is unrelated to your problems.
    Did a test now, added:

    Code:
    print_r($this->include_shipping);
    before:

    Code:
    if ($this->include_shipping != 'true') $order_total -= $order->info['shipping_cost'];
    Output of that is 'truetruetrue', and not 'true' - seems like it's one 'true' for all shipping modules activated. Normal ...? Do you still belive it's not firing.

  5. #35
    Join Date
    Oct 2005
    Location
    Finland
    Posts
    186
    Plugin Contributions
    1

    Default Re: Coupons, some bugs?

    {Deleted content, doing new test}
    Last edited by rued; 23 Nov 2010 at 02:10 PM.

  6. #36
    Join Date
    Oct 2005
    Location
    Finland
    Posts
    186
    Plugin Contributions
    1

    Default Re: Coupons, some bugs?

    Some new tests made, with include shipping off.
    In this tests the shipping tax is Kr.30, and it seems like this is the amount giving the problems. Why it's removed from total I don't know, but it surly seems to happen without any logic in it.

    This works:
    Sub-Total: Kr.1.030,00,-
    Flat Rate (Best Way): Kr.150,00,-
    Discount Coupon: 10off : -Kr.100,00,-
    Incl. 25% MVA: Kr.215,40,-
    Total: Kr.1.080,00,-
    This works NOT:
    Sub-Total: Kr.1.029,00,-
    Flat Rate (Best Way): Kr.150,00,-
    Incl. 25% MVA: Kr.235,80,-
    Total: Kr.1.179,00,-

  7. #37
    Join Date
    Oct 2005
    Location
    Finland
    Posts
    186
    Plugin Contributions
    1

    Default Re: Coupons, some bugs?

    Another strange one.
    If setting include shipping off and include tax true (re-calculate tax none), the coupon code (10% off) will work on a product with price 1000 - but give wrong discount amount.

    Sub-Total: Kr.1.000,00,-
    Flat Rate (Best Way): Kr.150,00,-
    Discount Coupon: 10off : -Kr.120,00,-
    Incl. 25% MVA: Kr.207,00,-
    Total: Kr.1.030,00,-
    Sorry, I don't find the logic in any settings and tax handling here

  8. #38
    Join Date
    Oct 2005
    Location
    Finland
    Posts
    186
    Plugin Contributions
    1

    Default Re: Coupons, some bugs?

    New test ... When having include shipping/tax false.

    Sub-Total: Kr.1.000,00,-
    Flat Rate (Best Way): Kr.150,00,-
    Incl. 25% MVA: Kr.230,00,-
    Total: Kr.1.150,00,-
    Code:
        if ($this->include_shipping != 'true') $order_total_tax -= $order->info['shipping_tax'];
        print_r($order_total_tax);
    Outputs 200

    Code:
    //    if ($this->include_shipping != 'true') $order_total_tax -= $order->info['shipping_tax'];
        print_r($order_total_tax);
    Outputs 230

    The line is truly firing even if include shipping is false.

  9. #39
    Join Date
    Jan 2004
    Posts
    66,380
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Coupons, some bugs?

    We'll look at your shipping concerns again separately.

    How did the code fix work for your rounding concerns?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #40
    Join Date
    Oct 2005
    Location
    Finland
    Posts
    186
    Plugin Contributions
    1

    Default Re: Coupons, some bugs?

    More test, reading and debuging done ... and I think I see what you're doing wrong.

    Sub-Total: 1000

    First you remove shipping tax:
    Code:
        if ($this->include_shipping != 'true') $order_total_tax -= $order->info['shipping_tax'];
    On next line you remove all tax, including the already removed shipping tax:
    Code:
        if ($this->include_tax != 'true') $order_total -= $order->info['tax'];
    This gives us:
    include shipping = false
    order total = 770
    order total shipping = 150
    order total tax = 200
    But then you have line commented, witch we can uncomment and change to re-add the shipping tax:
    Code:
        if ($this->include_tax != "true" && $this->include_shipping != 'true') $order_total += $order->info['shipping_tax'];
    This gives us:
    include shipping = false
    order total = 800
    order total shipping = 150
    order total tax = 200
    That works for us, but I have not tested other scenarios - like tax handling in US etc..

 

 
Page 4 of 6 FirstFirst ... 23456 LastLast

Similar Threads

  1. v150 Bugs?
    By mprough in forum Bug Reports
    Replies: 1
    Last Post: 13 Jul 2012, 12:04 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