osCmax v2.5 User Manual
Results 1 to 3 of 3

Order Total excluding VAT

This is a discussion on Order Total excluding VAT within the New osCommerce Contributions forums, part of the osCommerce 2.2 Forums category; I wanted to change my order total using this modification to Subtotal: Shipping: Subtotal Excl VAT Incl Shipping: VAT: Total ...

      
  1. #1
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,907
    Rep Power
    568


    Post Order Total excluding VAT

    I wanted to change my order total using this modification to

    Subtotal:
    Shipping:
    Subtotal Excl VAT Incl Shipping:
    VAT:
    Total Incl VAT:

    To give the Sub-Total ex VAT but including the shipping,

    catalog/includes/modules/order_total/ot_subtotal_ex.php

    Find:

    if (DISPLAY_PRICE_WITH_TAX == 'true')
    {
    $this->output[] = array('title' => $this->title . ':',
    'text' => $currencies->format($order->info['subtotal']-$order->info['tax'], true, $order->info['currency'], $order->info['currency_value']),
    'value' => $order->info['subtotal']);
    }
    else
    {
    $this->output[] = array('title' => $this->title . ':',
    'text' => $currencies->format($order->info['subtotal'], true, $order->info['currency'], $order->info['currency_value']),
    'value' => $order->info['subtotal']);
    }

    Change to:
    if (DISPLAY_PRICE_WITH_TAX == 'true')
    {
    // Changed to added shipping cost to the subtotal - added +$order->info['shipping_cost'] into both lines below
    $this->output[] = array('title' => $this->title . ':',
    'text' => $currencies->format($order->info['subtotal']-$order->info['tax']+$order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']),
    'value' => $order->info['subtotal']+$order->info['shipping_cost']);
    }
    else
    {
    // Changed to added shipping cost to the subtotal - added +$order->info['shipping_cost'] into both lines below
    $this->output[] = array('title' => $this->title . ':',
    'text' => $currencies->format($order->info['subtotal']+$order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']),
    'value' => $order->info['subtotal']+$order->info['shipping_cost']);
    }

    Basically you are adding +$order->info['shipping_cost'] to anywhere there is $order->info['subtotal']

    This may or may not be the correct way of doing it, but it did work for me.

    Does not include the full package. Do not copy over your file, just insert code above

    More...
    Michael Sasek
    osCMax Developer


    osCmax Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  2. #2
    Member
    Join Date
    Jul 2008
    Posts
    49
    Rep Power
    0


    Default Re: Order Total excluding VAT

    I have used this mod with customer groups and pdf invoice. The problem is that some customer groups are trade and ex-Tax, some are retail and inc-Tax. To get the correct total depending on customer group change the following in ot_subtotal_ex.php;

    from:
    if (DISPLAY_PRICE_WITH_TAX == 'true')

    to:
    if (CUSTOMERS_GROUP_SHOW_TAX == 'true')

    To show UK vat correctly for trade invoices though it needs separate 0% and 17.5% totals - luckily all my items are 17.5%

  3. #3
    Member
    Join Date
    Jul 2008
    Posts
    49
    Rep Power
    0


    Default Re: Order Total excluding VAT

    Just discovered that ot_subtotal_ex.php causes paypal not to work - all that is passed to paypal is the delivery charge. Even with the module installed but turned off there is a problem. Only by removing it and installing the original does paypal work! File comparison shows that the original has an extra piece of code after:

    function process() {
    global $order, $currencies;

    which is this:

    // BOF: LINES ADDED
    $od_amount = $_SESSION['od_amount'];
    $subtotal = $order->info['subtotal'] - $od_amount;
    $order->info['subtotal'] = $order->info['subtotal'] - $od_amount;
    // EOF: LINES ADDED

    the next lines are the if statement to check for tax included or not in the ot_subtotal_ex.php whereas the ot_subtotal.php has the same without the if / else code.
    Last edited by aquapet; 04-12-2010 at 04:02 PM.

Similar Threads

  1. Order Total excluding VAT
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 10-22-2008, 07:00 AM
  2. Order Total Priority (not really about sort order)
    By calistared in forum osCmax v2 Customization/Mods
    Replies: 1
    Last Post: 03-12-2008, 08:59 PM
  3. Order Totals: Total $ and Total Sales Count
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 04-18-2007, 09:30 AM
  4. Order Totals: Total $ and Total Sales Count
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 04-17-2007, 05:54 PM
  5. Order Totals: Total $ and Total Sales Count
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 04-17-2007, 11:15 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
  •