Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2004
    Location
    Southport, UK
    Posts
    4,237
    Plugin Contributions
    20

    Default Where is the specials price calculated?

    Client wants prices shown with both VAT and ex-VAT on product info page. I can do that with a simple calculation at the time of display, but when a Specials price is in force, the calculation returns 0.

    So where does the display of the special price come from..or even better, how do I overcome this problem?

    This is my section of code from tpl_product_info_display.php which displays the base price with and without tax:
    Code:
    <?php
    
    //tax inclusive price
    $withtax=zen_get_products_display_price((int)$_GET['products_id']);
    $withtax = substr($withtax, 7); //removes £ symbol
    $withtax=ereg_replace(',','',$withtax);//removes commas from thousands
      
      
    // base price
      if ($show_onetime_charges_description == 'true') {
        $one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />';
      } else {
        $one_time = '';
      }
      echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']).'&nbsp;(&pound;';
      printf ("%01.2f", round($withtax/1.175,2));
      echo ' exc VAT)';
    
    
      
    ?>
    Development Manager @ JSWeb Ltd
    Over 15 years with Zencart

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Where is the specials price calculated?

    The first 2 functions in the functions_prices.php file drive those pricing components.
    .

    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
    Oct 2004
    Posts
    12
    Plugin Contributions
    0

    Default Re: Where is the specials price calculated?

    I am having the same problem, where I need to display the special price inc VAT, the original price exc VAT, and the sales price exc VAT. I am using some amended code to calculate and display the VAT pricing which works fine for normal products but when you add one of these products to the specials section then the main display price inc VAT is £0.00, however the exc VAT prices display correctly.

    I have had a look at the functions_prices files as suggested but have not been able to work out what elements need changing if any or whether there is something else I need to do.

    This is how my pricing is being displayed:

    £0.00 inc VAT
    (£57.02 £45.62 exc VAT)

    this is the code I am using in the product_info_display file:

    <?php
    // base price
    if ($show_onetime_charges_description == 'true') {
    $one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />';
    } else {
    $one_time = '';
    }
    echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
    //tax inclusive price

    $withtax=zen_get_products_display_price((int)$_GET['products_id']);
    $withtax = substr($withtax, 1);
    $withtax=round($withtax + ($withtax * 175/1000),2);//alter 175/1000 to match your own tax rate
    echo '<br />'.'<span style="font-size:8px">'.'(£';
    printf ("%01.2f",$withtax);//printf - the bit between % and f inserts the correct leading/trailing zeros
    echo ' inc VAT)'.'</span>';
    ?>

    The functions_prices file is currently un-altered.

    Any help with this would be greatly appreciated.

  4. #4
    Join Date
    Nov 2007
    Posts
    4
    Plugin Contributions
    0

    Default Re: Where is the specials price calculated?

    Hi,

    I also need to know how to display a with VAT total in a specials box - I have a customer who needs this as a matter of priority.

    Many thanks for any assitance

    Julian

 

 

Similar Threads

  1. Onetime charges calculated in the total price
    By ShockRaver in forum Customization from the Admin
    Replies: 1
    Last Post: 26 Aug 2013, 04:12 PM
  2. Replies: 1
    Last Post: 23 Jun 2013, 01:59 AM
  3. Where is the "Total" calculated?
    By chillout_buddha in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 30 Jul 2008, 03:26 AM
  4. Include specials end date to under specials price?
    By this side up in forum Setting Up Specials and SaleMaker
    Replies: 7
    Last Post: 13 Jun 2007, 04:47 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR