[Skip to main content](#vessel-content)

#   Assign a specific tax rate to a category

##

- **[hielkio](/forum/user/42119-hielkio "View hielkio's Profile")**
- [![hielkio's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar42119.png)](/forum/user/42119-hielkio "View hielkio's Profile") Topic Author
- [ Offline](/forum/user/42119-hielkio)

Less More

- Posts: 44
- Thank you received: 2
-
-

10 years 5 months ago [\#242667](#242667) by [hielkio](/forum/user/42119-hielkio "View hielkio's Profile")  *[Assign a specific tax rate to a category](/forum/40-taxes/885012-assign-a-specific-tax-rate-to-a-category#242667 "-- url of the page with the problem -- :   www.koffiematters.nl  -- HikaShop version -- : 2.6.3  Hi people,  I can't figure it out .. I hope you guys can help me out here :) What I'd like to achieve is this: - Assign a taxrate to a category (including the existing products) - Show &quot;Marge product&quot; under the productprice (instead of incl. VAT)  Thank you very much for thinking with me :)")* was created by *[hielkio](/forum/user/42119-hielkio "View hielkio's Profile")*

-- url of the page with the problem -- : [ www.koffiematters.nl](http://www.koffiematters.nl)
-- HikaShop version -- : 2.6.3

Hi people,

I can't figure it out .. I hope you guys can help me out here ![:)](/media/kunena/emoticons/3.png ":)")
What I'd like to achieve is this:
- Assign a taxrate to a category (including the existing products)
- Show "Marge product" under the productprice (instead of incl. VAT)

Thank you very much for thinking with me ![:)](/media/kunena/emoticons/3.png ":)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQwLXRheGVzLzg4NTAxMi1hc3NpZ24tYS1zcGVjaWZpYy10YXgtcmF0ZS10by1hLWNhdGVnb3J5P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

10 years 5 months ago [\#242684](#242684) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Assign a specific tax rate to a category](/forum/40-taxes/885012-assign-a-specific-tax-rate-to-a-category#242684 "-- url of the page with the problem -- :   www.koffiematters.nl  -- HikaShop version -- : 2.6.3  Hi people,  I can't figure it out .. I hope you guys can help me out here :) What I'd like to achieve is this: - Assign a taxrate to a category (including the existing products) - Show &quot;Marge product&quot; under the productprice (instead of incl. VAT)  Thank you very much for thinking with me :)")*

Hello,
The solution will be to :
- Create another tax category via "Hikashop-&gt;System-&gt;Taxes-&gt;'Manage tax categories'"
- Create a new tax with that tax category and a specific rate via "Hikashop-&gt;System-&gt;Taxes"
- Edit all the products of your category and set the "Tax category" option of the "Prices and Taxes" tab to the tax category you created.

The following user(s) said Thank You: [hielkio](/forum/user/42119-hielkio "View hielkio's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQwLXRheGVzLzg4NTAxMi1hc3NpZ24tYS1zcGVjaWZpYy10YXgtcmF0ZS10by1hLWNhdGVnb3J5P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[hielkio](/forum/user/42119-hielkio "View hielkio's Profile")**
- [![hielkio's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar42119.png)](/forum/user/42119-hielkio "View hielkio's Profile") Topic Author
- [ Offline](/forum/user/42119-hielkio)

Less More

- Posts: 44
- Thank you received: 2
-
-

10 years 5 months ago [\#242943](#242943) by [hielkio](/forum/user/42119-hielkio "View hielkio's Profile")  Replied by *[hielkio](/forum/user/42119-hielkio "View hielkio's Profile")* on topic *[Assign a specific tax rate to a category](/forum/40-taxes/885012-assign-a-specific-tax-rate-to-a-category#242943 "-- url of the page with the problem -- :   www.koffiematters.nl  -- HikaShop version -- : 2.6.3  Hi people,  I can't figure it out .. I hope you guys can help me out here :) What I'd like to achieve is this: - Assign a taxrate to a category (including the existing products) - Show &quot;Marge product&quot; under the productprice (instead of incl. VAT)  Thank you very much for thinking with me :)")*

I think I wasn't clear enough, sorry :huh:
The right tax-rate / category was assigned to the products, but ...
I'd like to show the tax description (Incl. TAX or No TAX) under the productprice.

[ ![&#91;img](http://image.prntscr.com/image/bbfd22244c2a4755a91e70bbcadd386b.png) ](http://image.prntscr.com/image/bbfd22244c2a4755a91e70bbcadd386b.png "&#91;img")

I added a static text "Incl. TAX" in listing_price.php before, but now we've got products that don't have any TAX on it.
Maybe a stupid or simple question / solution, is there a way to echo the TAX description or TAX category what assigned is to the product?

Hope you can help me out ![:)](/media/kunena/emoticons/3.png ":)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQwLXRheGVzLzg4NTAxMi1hc3NpZ24tYS1zcGVjaWZpYy10YXgtcmF0ZS10by1hLWNhdGVnb3J5P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Philip](/forum/user/34318-philip "View Philip's Profile")**
- [![Philip's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34318-philip "View Philip's Profile")
- [ Offline](/forum/user/34318-philip)

Less More

- Posts: 4820
- Thank you received: 652
-
-

10 years 5 months ago -  10 years 5 months ago [\#242953](#242953) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Assign a specific tax rate to a category](/forum/40-taxes/885012-assign-a-specific-tax-rate-to-a-category#242953 "-- url of the page with the problem -- :   www.koffiematters.nl  -- HikaShop version -- : 2.6.3  Hi people,  I can't figure it out .. I hope you guys can help me out here :) What I'd like to achieve is this: - Assign a taxrate to a category (including the existing products) - Show &quot;Marge product&quot; under the productprice (instead of incl. VAT)  Thank you very much for thinking with me :)")*

Hello,

You have to add a **check** in order to **only apply** your "custom code" on required category product listing.
More precisely, you can get the **category Id** and only display your required value if this is the wanted categorie Id.
See this code sample :
Code:

$YourPrice="YourValue"; // Check if the categories is setted : if (isset($this-&gt;row-&gt;categories) ) { // Read all categories IF the product have several categories setted foreach ($this-&gt;row-&gt;categories as $key =&gt; $value) { // Required category found, display your price : if ($value-&gt;category_id == '12' ) $YourPrice="YourValue"; echo '&lt;span class="hikashop_product_price_with_YOUR_TAX"&gt;' . $YourPrice . "&lt;/span&gt;"; } }

Hope this will help you.

Regards

Last edit: 10 years 5 months ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQwLXRheGVzLzg4NTAxMi1hc3NpZ24tYS1zcGVjaWZpYy10YXgtcmF0ZS10by1hLWNhdGVnb3J5P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[hielkio](/forum/user/42119-hielkio "View hielkio's Profile")**
- [![hielkio's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar42119.png)](/forum/user/42119-hielkio "View hielkio's Profile") Topic Author
- [ Offline](/forum/user/42119-hielkio)

Less More

- Posts: 44
- Thank you received: 2
-
-

10 years 1 month ago [\#250961](#250961) by [hielkio](/forum/user/42119-hielkio "View hielkio's Profile")  Replied by *[hielkio](/forum/user/42119-hielkio "View hielkio's Profile")* on topic *[Assign a specific tax rate to a category](/forum/40-taxes/885012-assign-a-specific-tax-rate-to-a-category#250961 "-- url of the page with the problem -- :   www.koffiematters.nl  -- HikaShop version -- : 2.6.3  Hi people,  I can't figure it out .. I hope you guys can help me out here :) What I'd like to achieve is this: - Assign a taxrate to a category (including the existing products) - Show &quot;Marge product&quot; under the productprice (instead of incl. VAT)  Thank you very much for thinking with me :)")*

It was working before, but now it isn't anymore ![:unsure:](/media/kunena/emoticons/18.png ":unsure:")

This is the code I used:
Code:

$displayValue = ""; // Check if the categories is setted : if (isset($this-&gt;row-&gt;categories) ) { // Read all categories IF the product have several categories setted foreach ($this-&gt;row-&gt;categories as $key =&gt; $value) { // Required category found, display your price : if ($value-&gt;category_id == '13' ) $YourPrice="Marge product"; else $YourPrice="Incl. BTW"; $displayValue = '&lt;span&gt;' . $YourPrice . "&lt;/span&gt;"; } echo $displayValue;

The 'problem' is, that the products are assigned to 2 categories, in this case "Jura Occasions" AND the parent category "Coffeemachines".

For the php folks among us, it's very simple to solve I think :silly:
In my code, it's checking if there's another category, if it is, he uses the ELSE value (or am I wrong?)
Wouldn't it be simpler to just check 1 category and if the product is member of it, it will apply the condition.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQwLXRheGVzLzg4NTAxMi1hc3NpZ24tYS1zcGVjaWZpYy10YXgtcmF0ZS10by1hLWNhdGVnb3J5P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

10 years 1 month ago [\#250966](#250966) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Assign a specific tax rate to a category](/forum/40-taxes/885012-assign-a-specific-tax-rate-to-a-category#250966 "-- url of the page with the problem -- :   www.koffiematters.nl  -- HikaShop version -- : 2.6.3  Hi people,  I can't figure it out .. I hope you guys can help me out here :) What I'd like to achieve is this: - Assign a taxrate to a category (including the existing products) - Show &quot;Marge product&quot; under the productprice (instead of incl. VAT)  Thank you very much for thinking with me :)")*

Hi,

How about doing instead: Code:

$displayValue = ""; // Required category found, display your price : if ($this-&gt;element-&gt;category_id == '13' ) $YourPrice="Marge product"; else $YourPrice="Incl. BTW"; $displayValue = '&lt;span&gt;' . $YourPrice . "&lt;/span&gt;"; echo $displayValue;

That way, it will use the curent category of the listing instead of checking in the categories of each product.

The following user(s) said Thank You: [hielkio](/forum/user/42119-hielkio "View hielkio's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQwLXRheGVzLzg4NTAxMi1hc3NpZ24tYS1zcGVjaWZpYy10YXgtcmF0ZS10by1hLWNhdGVnb3J5P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[hielkio](/forum/user/42119-hielkio "View hielkio's Profile")**
- [![hielkio's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar42119.png)](/forum/user/42119-hielkio "View hielkio's Profile") Topic Author
- [ Offline](/forum/user/42119-hielkio)

Less More

- Posts: 44
- Thank you received: 2
-
-

10 years 1 month ago [\#251044](#251044) by [hielkio](/forum/user/42119-hielkio "View hielkio's Profile")  Replied by *[hielkio](/forum/user/42119-hielkio "View hielkio's Profile")* on topic *[Assign a specific tax rate to a category](/forum/40-taxes/885012-assign-a-specific-tax-rate-to-a-category#251044 "-- url of the page with the problem -- :   www.koffiematters.nl  -- HikaShop version -- : 2.6.3  Hi people,  I can't figure it out .. I hope you guys can help me out here :) What I'd like to achieve is this: - Assign a taxrate to a category (including the existing products) - Show &quot;Marge product&quot; under the productprice (instead of incl. VAT)  Thank you very much for thinking with me :)")*

Wow! You're my hero ![:)](/media/kunena/emoticons/3.png ":)")
Thank you very much .. it works like a charm!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQwLXRheGVzLzg4NTAxMi1hc3NpZ24tYS1zcGVjaWZpYy10YXgtcmF0ZS10by1hLWNhdGVnb3J5P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.066 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
