Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2006
    Posts
    6
    Plugin Contributions
    0

    Default order quantity discount calculation

    hi guys and gals
    Running zc 1.3.6
    Installed order quantity mod which seems to work fine untill you manually add the totals up and relize it dont add up correctly
    eg
    Sub total $81.45 correct
    shippin: $12.10 correct
    discount -$8.14 correct
    tax @10% $7.69 correct
    total $84.60 incorrect when you add this up it should be $85.41

    my settings are
    uantity Discount
    This module is installed - version 1.3
    true
    Sort Order
    295
    Include Tax
    true
    Re-calculate Tax
    Standard
    Discount Units
    percentage
    Discount Basis
    Total Items in Cart
    Discount Level 1
    5
    Discount Amount 1
    10

    Now if I change recalulate tax to "none" this changes my total to correct amount but obviously leaves my tax at original calculated amount
    Sub total $81.45 correct
    shippin: $12.10 correct
    discount -$8.14 correct
    tax @10% $8.50 correct
    total $85.41
    any ideas
    thanks

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    4,478
    Plugin Contributions
    121

    Default Re: order quantity discount calculation

    I can't dup this. Using your settings, I get the right numbers.

    Do you display prices with taxes included? Any other non-US style
    settings I may not have tested?

    Scott
    Attached Images Attached Images  
    Scott C Wilson, That Software Guy, Plugin Moderator
    Contributions: Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.

  3. #3
    Join Date
    Oct 2006
    Posts
    6
    Plugin Contributions
    0

    Default Re: order quantity discount calculation

    I do display prices including tax
    Have only one tax setup in one zone which is 10%


    Arhhh just spotted wats happening!! not that i know how to fix it but you guys might.
    It seems that when i choose to recalulate tax (which is 10%) its adding 10% to the discount price even though it doesnt show it then taking that figure off thoe total price.
    EG
    $362.00
    Sub-Total:


    $12.10
    Flat Rate (Best Way):


    -$36.19 if you were to add 10% here $39.80 so 362+12.10-39.80= 334.30

    Quantity Discount:


    $30.39
    GST 10%:


    $334.29 this should be 337.91

    Total:

    Hope this is explained ok
    Also i have another zen cart setup and i just installed this mod there and it does the same thing??
    Thanx in advanced
    Michael

  4. #4
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    4,478
    Plugin Contributions
    121

    Default Re: order quantity discount calculation

    OK. Try replacing process() in ot_quantity_discount.php with this:

    Code:
        function process() {
           global $db, $order, $currencies;
           $od_amount = $this->calculate_deductions();
           if ($od_amount['total'] > 0) {
             $show_amt = $od_amount['total'];
             reset($order->info['tax_groups']);
             while (list($key, $value) = each($order->info['tax_groups'])) {
               $tax_rate = zen_get_tax_rate_from_desc($key);
               if ($od_amount[$key]) {
                 $order->info['tax_groups'][$key] -= $od_amount[$key];
                 if (DISPLAY_PRICE_WITH_TAX == 'true') {
                    $show_amt += $od_amount[$key];
                    $tax_deduct = $od_amount[$key] - ($od_amount[$key] * $tax_rate/100);
                    $order->info['total'] -=  $tax_deduct;
                 } else {
                    $order->info['total'] -=  $od_amount[$key];
                 }
               }
             }
             $order->info['total'] = $order->info['total'] - $show_amt;
             $this->title = '<a href="javascript:alert(\'' . $this->explanation . '\');">' . $this->title . '</a>';
             $this->output[] = array('title' => $this->title . ':',
             'text' => '-' . $currencies->format($show_amt, true, $order->info['currency'], $order->info['currency_value']),
             'value' => $od_amount['total']);
           }
        }
    Scott C Wilson, That Software Guy, Plugin Moderator
    Contributions: Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.

  5. #5
    Join Date
    Oct 2006
    Posts
    6
    Plugin Contributions
    0

    Default Re: order quantity discount calculation

    thanks for the reply
    seems you are sorta getting closer to the answer
    ok still the discount is a little off
    eg
    sub total 100
    disc. -10
    tax 10% 8.18
    total 89.18

    as you can see the total is still out not by much but the more you add the more it is out

    the tax seems to be calculating on the correct total amount of the total eg we work out the gst by total
    $90/11 =8.18
    90-8.18=81.82 exclusive
    81.82+10%=90inclusive
    thanks again for your time

    ps a quick explaination in the code so i know what why this is happening would be great unless it is more than just a couple of lines

 

 

Similar Threads

  1. Discount Coupon AND Group Discount Tax Problem
    By mrkrinkle in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 11
    Last Post: 5 Apr 2007, 12:16 PM
  2. Need quantity discount advice
    By skylarker in forum Basic Configuration
    Replies: 12
    Last Post: 1 Dec 2006, 07:19 PM
  3. Error in group discount calculation at checkout
    By Fred Philpott in forum Creating Discounts/Coupons, Gift Certificates, Newsletters
    Replies: 4
    Last Post: 4 Jul 2006, 01:29 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
  •