Guest Posted March 7, 2007 Share Posted March 7, 2007 Hello Could someone explain to me what this last function does in '/includes/classes/currencies.php'? Someone has modified it to display products in the following format "£10.00 (£11.75 inc VAT)" but this multiplier is hard coded and now I require a fix for products that are zero rated. function display_price($products_price, $products_tax, $quantity = 1) { global $customer_id; if (tep_session_is_registered('customer_id')) { return $this->format ($products_price * $quantity) . '</font></b>(' . $this->format (tep_add_tax($products_price, $products_tax)* 1.175 * $quantity) . ' inc VAT)'; } else { $return_this= $this->format ($products_price * $quantity) . '</font></b>(' . $this->format (tep_add_tax($products_price, $products_tax)* 1.175 * $quantity) . ' inc VAT)'; return $return_this; } Link to comment Share on other sites More sharing options...
omar2886 Posted March 7, 2007 Share Posted March 7, 2007 So what do you want exactely? Link to comment Share on other sites More sharing options...
Guest Posted March 7, 2007 Share Posted March 7, 2007 Okay currently... if the products tax rate is 17.5% the shop displays the following £10.00 (£11.75 inc VAT) if the products tax rate is 0% the shop displays the following £10.00 (£11.75 inc VAT) obviously this is incorrect. Is there anyway I can modify the code to take into consideration the tax rate applied to the product? regards paul Link to comment Share on other sites More sharing options...
omar2886 Posted March 7, 2007 Share Posted March 7, 2007 ok, so the code must be changed, because what you have in this code is that independiently of the tax you put in the admin panel, it'll be allways 17.5%. I recommend you to let me correct your currencies.php code to show allways the prices with the tax you set in the panel admin or if you want not to show it till the user start the buy process just tell me. So what? Link to comment Share on other sites More sharing options...
Guest Posted March 7, 2007 Share Posted March 7, 2007 to show allways the prices with the tax you set in the panel admin please :D Link to comment Share on other sites More sharing options...
omar2886 Posted March 7, 2007 Share Posted March 7, 2007 Ok, so you'll have to replace this code in currencies.php: function display_price($products_price, $products_tax, $quantity = 1) {global $customer_id; if (tep_session_is_registered('customer_id')) { return $this->format ($products_price * $quantity) . '</font></b>(' . $this->format (tep_add_tax($products_price, $products_tax)* 1.175 * $quantity) . ' inc VAT)'; } else { $return_this= $this->format ($products_price * $quantity) . '</font></b>(' . $this->format (tep_add_tax($products_price, $products_tax)* 1.175 * $quantity) . ' inc VAT)';return $return_this; } By this one: function display_price($products_price, $products_tax, $quantity = 1) { return $this->format(tep_add_tax($products_price, $products_tax) * $quantity); } Then, you'll have to enter in the panel admin, here: admin/configuration.php?gID=1&cID=18&action=edit&osCAdminID=57ebfefee777d04ed7bebde25449cfdb And set value true. After this, you can go here: admin/tax_rates.php?osCAdminID=57ebfefee777d04ed7bebde25449cfdb And set the Tax percentaje you want. I think it's all. Link to comment Share on other sites More sharing options...
Guest Posted March 7, 2007 Share Posted March 7, 2007 many thanks! great solution... Link to comment Share on other sites More sharing options...
Guest Posted March 7, 2007 Share Posted March 7, 2007 I have just spotted one last problem. In my order total I have the following How should I display the VAT element? As it stands it looks like it should be added to the sub total... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.