Results 1 to 10 of 20

Hybrid View

  1. #1
    Join Date
    May 2006
    Posts
    24
    Plugin Contributions
    0

    Default Showing price with and without tax

    Hi all,

    Is it possible to display two different prices for a product, one with tax and the other without? I know in the configure store I can select to either show the price with and without, but what if I want to show both prices for the product? For example, show both of the following for each product:

    9.95 (without tax)
    10.70 (with tax)


    Thanks,

    Ray

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Showing price with and without tax

    Displaying more than one price at a time is not a built-in feature of Zen Cart at the present time.

    If you wanted to code it yourself, I just noted that there are 1807 references to "price" in the code, and 994 references to "tax". Might be an all-nighter...
    .

    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.

  3. #3
    Join Date
    May 2006
    Posts
    24
    Plugin Contributions
    0

    Default Re: Showing price with and without tax

    Ah, bummer.....well, I will try and deal with one price...:).

    Thanks for your help.

    Ray

  4. #4
    Join Date
    Oct 2006
    Posts
    10
    Plugin Contributions
    0

    Default Re: Showing price with and without tax

    Right
    There is a way to code this into currencies (probably not the cleanest way but it works)

    OK here's what to do

    Set up Zen cart to (Display Prices with Tax = false)

    Then

    Change the order totals to

    Shipping to 200
    Subtotal to 300
    VAT to 400
    Total to 500

    Then open \includes\classes\currencies.php
    look for around line 71

    PHP Code:
     function display_price($products_price$products_tax$quantity 1) {
          return 
    $this->format(zen_add_tax($products_price$products_tax) * $quantity);
        }
      } 
    change to

    PHP Code:
     function display_price($products_price$products_tax$quantity 1) {
      return 
    $this->format ($products_price $quantity) . '&nbsp;ex. <img border="0" src="images/pixel_trans.gif" width="2%" height="1"><span class="incvat">' $this->format (zen_add_tax($products_price$products_tax)* 1.175$quantity) . ' inc.' '</span>';
    return 
    $return_this;
          }
        } 
    then open
    \includes\modules\order_total\ot_subtotal.php

    look for around line 35
    PHP Code:
        function process() {
          global 
    $order$currencies;
          
    $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

    PHP Code:
     function process() {
          global 
    $order$currencies;
          
    $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']);
        } 
    PLEASE ENSURE THAT YOU BACKUP BEFORE CHANGING ANY OF THE FILES

    Hope this helps

    Dave

  5. #5
    Join Date
    Oct 2005
    Location
    UK - London
    Posts
    68
    Plugin Contributions
    4

    Default Re: Showing price with and without tax

    thats a good fix and almost solves my problems too, thanks for kicking me down the correct path :) prob is... now every product has vat applied to it and not all of my shop items are taxable

    Any ideas how

    PHP Code:
    function display_price($products_price$products_tax$quantity 1) {
      return 
    $this->format ($products_price $quantity) . '&nbsp;ex. <img border="0" src="images/pixel_trans.gif" width="2%" height="1"><span class="incvat">' $this->format (zen_add_tax($products_price$products_tax)* 1.175$quantity) . ' inc.' '</span>';
    return 
    $return_this;
          }
        } 
    Can have a test statement in it to see whether the product has a tax class or not?

    Thanks

  6. #6
    Join Date
    May 2006
    Posts
    24
    Plugin Contributions
    0

    Default Re: Showing price with and without tax

    Hi Dave71,

    Awesome, thanks for the solution. I will give that a try on my install.

    Ray

  7. #7
    Join Date
    Oct 2006
    Posts
    10
    Plugin Contributions
    0

    Default Re: Showing price with and without tax

    Quote Originally Posted by sn0ut View Post
    thats a good fix and almost solves my problems too, thanks for kicking me down the correct path :) prob is... now every product has vat applied to it and not all of my shop items are taxable

    Any ideas how

    PHP Code:
    function display_price($products_price$products_tax$quantity 1) {
      return 
    $this->format ($products_price $quantity) . '&nbsp;ex. <img border="0" src="images/pixel_trans.gif" width="2%" height="1"><span class="incvat">' $this->format (zen_add_tax($products_price$products_tax)* 1.175$quantity) . ' inc.' '</span>';
    return 
    $return_this;
          }
        } 
    Can have a test statement in it to see whether the product has a tax class or not?
    Thanks


    Try this......

    PHP Code:
    function display_price($products_price$products_tax$quantity 1) {
    if (
    $products_tax ='ENTER TAX CLASS ID HERE FOR NON TAXABLE ITEM THIS IS A NUMBER'){
     return 
    $this->format ($products_price $quantity) . '&nbsp; No Tax'
     }else{
      return 
    $this->format ($products_price $quantity) . '&nbsp;ex. <img border="0" src="images/pixel_trans.gif" width="2%" height="1"><span class="incvat">' $this->format (zen_add_tax($products_price$products_tax)* 1.175$quantity) . ' inc.' '</span>';
    return 
    $return_this;
          }
        }  

    As above (obviously changing the text No tax, to what is appropriate) should do what you want it to (Changing the tax class to a number which corresponds to a non taxable ID)

    Let me know how you get on

  8. #8
    Join Date
    Jun 2008
    Posts
    6
    Plugin Contributions
    0

    Default Re: Showing price with and without tax

    ..might be an allnighter... hiih. nice one

  9. #9
    Join Date
    Jul 2010
    Location
    Kent UK
    Posts
    50
    Plugin Contributions
    0

    Default Re: Showing price with and without tax

    This seems like a primitive method of doing this, especially as vat has now gone up to 20%! you should maybe try to use variables instead of hardcoding the current tax rate of one country. You have also failed to take into account other currencies and wont be able to use the european tax module.....

  10. #10
    Join Date
    Jan 2011
    Posts
    58
    Plugin Contributions
    0

    Default Re: Showing price with and without tax

    Hi.

    I did try the code Dave1 gave, it works only for one currency.

    When I change my currency code, i got a blank screen.

    Also, I use attribute pricing bt it displays the price with VAT also..
    How to make attribute pricing not affected by the VAT stuff?

    I really need a quick fix for it!!

    HELLLLPPPPP!!!

    Thanks

    Liizz

 

 

Similar Threads

  1. Replies: 1
    Last Post: 21 Jul 2009, 10:40 PM
  2. Show price with and without tax
    By roscoeh in forum Basic Configuration
    Replies: 0
    Last Post: 14 Jan 2008, 09:18 AM

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