show Price with options incl and excl tax

  • Posts: 27
  • Thank you received: 0
12 years 2 months ago #62020

Hi price with options is displayed with tax. How can I display both, price with option incl and excl tax. Thanks christoph

Please Log in or Create an account to join the conversation.

  • Posts: 82819
  • Thank you received: 13366
  • MODERATOR
12 years 2 months ago #62139

Hi,

You would need to edit the file "option_price" via the menu Display->Views and change the line:
echo '<span class="hikashop_option_price_title">'.JText::_('PRICE_WITH_OPTIONS').':</span> <span class="hikashop_option_price_value">'.$currency->format($price, hikashop_getCurrency()).'</span>';

to:
echo '<span class="hikashop_option_price_title">'.JText::_('PRICE_WITH_OPTIONS').':</span> <span class="hikashop_option_price_value">'.$currency->format($price, hikashop_getCurrency()).' ('.$currency->format($currency->getUntaxedPrice($price,hikashop_getZone(),XXX,2), hikashop_getCurrency()).')</span>';

where XXX is the id of the tax category you're using in your products.

Please Log in or Create an account to join the conversation.

  • Posts: 27
  • Thank you received: 0
12 years 2 months ago #62249

Hi Nicolas,
thanks for your quick reply.
Can´t find the code mentioned.My option_price.php includes the following code only:
<?php
if(!headers_sent()){
header('Content-Type: text/css; charset=utf-8');
}
$price = JRequest::getVar( 'price', 0 );
$currency = hikashop_get('class.currency');
echo JText::_('PRICE_AFTER_TAX').': '.$currency->format($price, hikashop_getCurrency());
exit;

I use Hikashop Business 1.5.8. - has this .php file been updated? I would prefer not to update (if there is one) as I want to launch my page in the next few days and there is a potential risk for errors as I changed alot of files (some of them not properly). Can you pls let me know what to do?
Thanks Christoph

Please Log in or Create an account to join the conversation.

  • Posts: 82819
  • Thank you received: 13366
  • MODERATOR
12 years 2 months ago #62356

Hi,

That file has been updated yes.
You should try to replace:
echo JText::_('PRICE_AFTER_TAX').': '.$currency->format($price, hikashop_getCurrency());
with:
echo JText::_('PRICE_AFTER_TAX').': '.$currency->format($price, hikashop_getCurrency()).' ('.$currency->format($currency->getUntaxedPrice($price,hikashop_getZone(),XXX,2), hikashop_getCurrency()).')';

Last edit: 12 years 2 months ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 27
  • Thank you received: 0
12 years 2 months ago #62426

Hi Nicolas,
does not work. new code results in "undefined" instead of text+price - I used ID of tax category as per yr advise and tried tax zone as well but did not work.
christoph

Please Log in or Create an account to join the conversation.

  • Posts: 82819
  • Thank you received: 13366
  • MODERATOR
12 years 2 months ago #62481

Try like that instead:
echo JText::_('PRICE_AFTER_TAX').': '.$currency->format($price, hikashop_getCurrency()).' ('.$currency->format($currency->getUntaxedPrice($price,hikashop_getZone(),XXX,2), hikashop_getCurrency()).')';

Please Log in or Create an account to join the conversation.

  • Posts: 27
  • Thank you received: 0
12 years 2 months ago #62685

Many thanks Nicolas , that works! To all visitors: you need to change the code via the views tab (as always mentioned in this forum) and Not in an external editor. I tried that as well and it crashes the layout of the complete website. Rg christoph B)

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum