[SOLVED] Display price option with & without tax

  • Posts: 307
  • Thank you received: 22
9 years 1 week ago #249545

-- HikaShop version -- : 3.6.4
-- Joomla version -- : 3.6.2
-- PHP version -- : 7.0.10

Hi,
I would like to have the "Price with options: 549,00 €" displayed like on this url : product with options to be displayed both without and with tax.

Having a little trouble with adding the exact code to the view for this.

In my current view I allready have the initial product prive displayed both with and without tax but this price can be removed after I display the price with options the right way.
Or is this bringing trouble for products without options ?

Thanks for any tips.

Last edit: 8 years 11 months ago by nico.van.leeuwen. Reason: solved

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

  • Posts: 84313
  • Thank you received: 13705
  • MODERATOR
9 years 1 week ago #249546

Hi,

The price with options is displayed dynamically by an ajax routine which just send the calculated price and gets back the display.
It uses for that the file "option_price" for that.
However, that view file only knows the amount to display, no other information.
If you have only one tax rate and it always apply, then it will be easy to modify the option_price view file.
Otherwise, you'll have to also modify the "option" view file to adapt the javascript code calculating the total in order to send more information to the option_price view file in orde to be able to display both amounts.

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

  • Posts: 307
  • Thank you received: 22
8 years 11 months ago #250718

Hi Nicolas,

Thanks for this reply, I understand what your saying.
Indeed I have only 1 tax rate so I can try modifying the option_price view.
Question for me is how can I find the right value to display the price with options both with and without tax?
This is not easy when your not really good at PHP like me :-)

I have set default to show both prices (with and without tax).
Now it shows the price only without the tax and I would like to add the price with the taxt also.

Thanks

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

  • Posts: 84313
  • Thank you received: 13705
  • MODERATOR
8 years 11 months ago #250747

Hi,

You could add a line:

echo '<span class="hikashop_option_price_title">'.JText::_('PRICE_WITH_OPTIONS').':</span> <span class="hikashop_option_price_value">'.$currency->format($price*1.21, hikashop_getCurrency()).'</span>';
supposing that the tax rate is 21%

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

  • Posts: 307
  • Thank you received: 22
8 years 11 months ago #250760

Thanks Nicolas, this works great !

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

Time to create page: 0.061 seconds
Powered by Kunena Forum