Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  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,373
    Blog Entries
    7
    Plugin Contributions
    274

    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
    Mar 2006
    Location
    Rosebud, Victoria, Australia
    Posts
    310
    Plugin Contributions
    2

    Default Re: Showing price with and without tax

    G'day,

    I haven't tackled displaying the ex and inc tax prices to shoppers as I don't need that feature.

    However, I was annoyed that the admin product preview page didn't show both prices and coded a fix for that. See http://www.zen-cart.com/forum/showthread.php?t=48921

    Best Regards, Lloyd Borrett.
    Zen Cart 1.5.5e, PHP 5.3.29 MySQL 5.5.42

  8. #8
    Join Date
    Oct 2004
    Location
    Southport, UK
    Posts
    4,237
    Plugin Contributions
    20

    Default Re: Showing price with and without tax

    Is this what you're after ... www.fastlec.co.uk ?
    Development Manager @ JSWeb Ltd
    Over 15 years with Zencart

  9. #9
    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

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

    Default Re: Showing price with and without tax

    thanks for the reply mate... added that code and tested.

    It seems to ignore the if statement and just does the first oart for every product, so it shows every product as being tax free!

    Is $products_tax defined somewhere or should I redeclare it again in that page?

 

 
Page 1 of 2 12 LastLast

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

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