how can i display the tax percent product listings, details and checkout?

  • Posts: 103
  • Thank you received: 5
5 years 5 months ago #300562

-- HikaShop version -- : 4.0.1
-- Joomla version -- : 3.8
-- PHP version -- : 7.2
-- Browser(s) name and version -- : chrome

hi.
have searched this forum but is looks like there is no answer right now for this:
in germany or austria you have to display the VAT on the product.
how can i display the percentages on the product listings, detail and of course the checkout?



i followed some answers here in the forum, but non of them helpt me here:
www.hikashop.com/forum/checkout/892798-p...checkout.html#282630
www.hikashop.com/support/documentation/5...nfig.html#main_taxes

Attachments:

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

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
5 years 5 months ago #300572

Hi,

If you have only one tax rate, then you can change the "per unit" text that you have by default next to the price with a translation override in order to include that text:
www.hikashop.com/download/languages.html#modify
That's for the products listing/product page.
On the checkout, you should already have the tax rate namekey next to the tax amount just before the total of the cart. So you can incldue the percentage in that namekey. If you already have a tax rate, you'll want to create another one with the name you want and then switch the tax rate to the new one in your tax rules via the menu System>Taxes.

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

  • Posts: 103
  • Thank you received: 5
5 years 5 months ago #300597

thank you for jumping in here.

nicolas wrote: If you have only one tax rate, then you can change the "per unit" text that you have by default next to the price with a translation override in order to include that text:
www.hikashop.com/download/languages.html#modify
That's for the products listing/product page.

no, i have set a store default tax rate for my base country. also i use different tax for normal products and reduced tax products. also the products are sold throughout the EU.
i need the store base tax (default tax or reduced) listed on the products (listings and detail views, also modules (checkout). so i think it is not possible to change the tax to a singe tax value.
the tax must checked from the defined tax rule of the main tax zone of the store, how is that possible. i assume it could be done with few clicks but i did not find it.

nicolas wrote: On the checkout, you should already have the tax rate namekey next to the tax amount just before the total of the cart. So you can incldue the percentage in that namekey. If you already have a tax rate, you'll want to create another one with the name you want and then switch the tax rate to the new one in your tax rules via the menu System>Taxes.

on this i need to display the "percentage" of the tax too. i looked at the namekey's, as you sad there are all the percentage values. now the question is how do i get the values displayed too and not only the namekey?

i find this very curious to display the tax percent are not done by default. because it is mostly a EU wide regulation how eCommerce has to be done.

Attachments:

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
5 years 5 months ago #300612

Hello,

In the context of the product page, you have access to the product prices.
In these prices, you have the full detail of the taxes (for each price).

$this->element->prices[0]->taxes;
By reading the data in the first price, you can retrieve various elements such as the tax rate, the tax namekey, etc.

Afterwards, it would require a view override to put the PHP code where you want to display such information.
www.hikashop.com/support/documentation/1...-display.html#layout
Do not hesitate to use the "display view files" advanced setting to know which view you want to override.
And also to use "var_dump" or "print_r" to get the details of a PHP variable.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 103
  • Thank you received: 5
5 years 5 months ago #300652

Hi Jerome.
Thank you for your answer.

i tested some code variants based on your snippet, but could not get it to run for me.
i could manage the half way with this code snippet:

echo $tax->tax_rate;
but here I have a decimal problem on the percentage with that.

maybe you could guide me in the right direction where i have adjust the code on your sample to get the right percentage out?

i also noticed maybe some bug about the input form for the namekey on the taxes:

right now i can't change the namekeys for the taxes - is this intentional or a mistake on my website?

Attachments:

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
5 years 5 months ago #300654

Hello,

The tip I gave you for the product page ; not the cart.
The cart already have code to display the taxes ; as Nicolas already wrote.

Please understand that it would require some PHP/Development skills ; if you cannot do it yourself, do not hesitate to contact someone.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 103
  • Thank you received: 5
5 years 5 months ago #300697

Jerome wrote: The cart already have code to display the taxes ; as Nicolas already wrote.

nicolas wrote: On the checkout, you should already have the tax rate namekey next to the tax amount just before the total of the cart. So you can incldue the percentage in that namekey. If you already have a tax rate, you'll want to create another one with the name you want and then switch the tax rate to the new one in your tax rules via the menu System>Taxes.


yes i did understand that, and i wanted to do this. as you see in my post before, the INPUT field is set to hidden. How should i change this when i cannot see the input field!?

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
5 years 4 months ago #300698

Hello,

Once you created a tax, you cannot change its namekey.
The namekey is used in the cart/order tax details.

But you can use the translation system to change how that tax name will be display in the front-end (and backend).
CF : www.hikashop.com/forum/10-translation/89...-invoice.html#297341

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.092 seconds
Powered by Kunena Forum