How to add applied VAT and link for shipping costs to product page

  • Posts: 11
  • Thank you received: 0
7 years 6 months ago #269447

-- HikaShop version -- : 3.0.1

Hi,

in Germany you have to show the VAT (usually as a fixed percentage) at the product price. For example: "9,99 € (inkl. 19% MWSt)" and there should be a link to the shipping costs. I think for the shipping costs I should generate a page containing the prices and insert a link? In which file I have to add this? For the VAT topic - how can I display this?

Best regards
Holger

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 6 months ago #269457

Hi,

Regarding the display of the price on the product page, you can change it thanks to the option "show taxed prices" setting of the HikaShop configuraiton to either have the price with or without taxes or both.
You can also use translation overrides if you want to add the tax rate after the price display:
www.hikashop.com/download/languages.html#modify

Regarding the shipping costs, If you activate the "shipping price per product" of your shipping methods and set prices per product when you edit them, you can have these shipping costs directly display on the product page thanks to a setting inthe price per product plugin that you can find when you edit it via the Joomla plugins manager.
Otherwise, if you want something more static, there are several solutions based on what you really want.
It could be a custom field of the table "product" where you could select some text in each product configuration page to be displayed on the product page.
Or a fixed text you would add to all the product pages either with a custom HTML module, or a modification in the view file "show_default" via the menu Display>Views.

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

  • Posts: 11
  • Thank you received: 0
7 years 6 months ago #269562

Hi,

thanks a lot. By using of what variable I can get access to the the tax rate for the products within the show default page?

Bestr regards
Holger

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 6 months ago #269583

Hi,

In $this->element->prices you have an array of price objects (because a product can have several prices).
Then, in each price object you have attributes like price_value, price_value_with_tax and a taxes attribute which is an array of tax rates (because a price can have several tax rates applied to it. Each tax rate object has several attributes like tax_rate, tax_namekey or tax_amount.

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

  • Posts: 11
  • Thank you received: 0
7 years 6 months ago #269642

Hi,

so it is not possible to access the applied tax rate which is applied for displayed price directly? Hmm, so I have to calculate it from price with tax and price without tax...

Best regards
Holger

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 6 months ago #269656

Hi,

Where in my message did I said that ?
I said the exact opposite.
As I said, you can access the tax_rate attribute in the tax objects of the taxes array of the price object in the $this->element->prices variable. So there is nothing to calculate. Just use the variable like I explained.

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

  • Posts: 11
  • Thank you received: 0
7 years 6 months ago #269731

Got it now! Thanks a lot

Best regards
Holger

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

  • Posts: 8
  • Thank you received: 0
7 years 4 months ago #273946

-- HikaShop Business version -- : 3.1.1
-- Joomla version -- : 3.7.2
-- PHP version -- : 7.0.21

Hi,

I also need to display the Tax Rate calculate with each product, since I have 10% VAT and 15% VAT. I solved problem this adding the following code at the end of --> com_hikashop > product > listing_price.php

<br /> (inkl. <?php echo $this->row->prices[0]->taxes[0]->tax_rate*100.0; ?>% MwSt) </span>

Unfortunately, after updating HikaShop to 3.1.1. this stop working :-(

Could you please tell me with the code goes for it it work again? I tried to figure it out with your comment in this Topic but I don't get it working :-(

Thanks in advanced for the help!

Attachments:

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 4 months ago #273962

Hi,

Your code is wrong.
You're using the key '0' to access the first element of the arrays, but it's not always the case.
For the prices array, the key correspond to the minimum quantity of the price. So you usually have 0 (so that you can purchase a quantity of 1, 2, etc) and thus it should work.
However, for the taxes array, the key is not 0.
Hence, your code should be:

<br /> (inkl. <?php
$firstTax = reset($this->row->prices[0]->taxes);
 echo $firstTax->tax_rate*100.0; ?>% MwSt) </span>

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

  • Posts: 8
  • Thank you received: 0
7 years 4 months ago #273979

Thanks a lot! :-)

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

Time to create page: 0.086 seconds
Powered by Kunena Forum