Zen Cart Logo
Forums / Setting Up Specials and SaleMaker / Where is the specials price calculated?

Where is the specials price calculated?

Locked

Views: 3,102

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
23 Aug 2006, 10:01 AM
#1
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

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:

<?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']).' (£';
  printf ("%01.2f", round($withtax/1.175,2));
  echo ' exc VAT)';


  
?>
23 Aug 2006, 11:01 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Where is the specials price calculated?

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

13 Oct 2006, 12:21 PM
#3
jameshart85 avatar

jameshart85

New Zenner

Join Date:
Oct 2004
Posts:
9
Plugin Contributions:
0

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.

27 Nov 2007, 11:04 AM
#4
ficba avatar

ficba

New Zenner

Join Date:
Nov 2007
Posts:
4
Plugin Contributions:
0

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