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

#   tax category not considered in the producttemplate

##

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

Less More

- Posts: 73
- Thank you received: 3
-
-

11 years 8 months ago [\#190460](#190460) by [ced1870](/forum/user/29000-ced1870 "View ced1870's Profile")  *[tax category not considered in the producttemplate](/forum/20-market-feature-requests/874935-tax-category-not-considered-in-the-producttemplate#190460 "-- HikaShop version -- : 2.3.5 -- HikaMarket version -- : 1.5.1 -- Joomla version -- : 3.3.6  Hi I have update the tax rules using the package available on hikashop.com that creates a new category &quot;Electronic goods &amp; services &quot; I have edited the product template to use this category for all new products. I have tested by creating a new product from the frontend of hikamarket and the tax category is set to &quot;none&quot;, so not according to the setting.  CEd")* was created by *[ced1870](/forum/user/29000-ced1870 "View ced1870's Profile")*

-- HikaShop version -- : 2.3.5
-- HikaMarket version -- : 1.5.1
-- Joomla version -- : 3.3.6

Hi
I have update the tax rules using the package available on hikashop.com that creates a new category "Electronic goods &amp; services "
I have edited the product template to use this category for all new products.
I have tested by creating a new product from the frontend of hikamarket and the tax category is set to "none", so not according to the setting.

CEd

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26395
- Thank you received: 4077
-
- [](http://obsi.dev)
-

11 years 8 months ago [\#190464](#190464) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[tax category not considered in the producttemplate](/forum/20-market-feature-requests/874935-tax-category-not-considered-in-the-producttemplate#190464 "-- HikaShop version -- : 2.3.5 -- HikaMarket version -- : 1.5.1 -- Joomla version -- : 3.3.6  Hi I have update the tax rules using the package available on hikashop.com that creates a new category &quot;Electronic goods &amp; services &quot; I have edited the product template to use this category for all new products. I have tested by creating a new product from the frontend of hikamarket and the tax category is set to &quot;none&quot;, so not according to the setting.  CEd")*

Hi,

Can you please edit the file "components/com_hikamarket/views/product/view.html.php" and replace Code:

if(!empty($template_id)) { $product-&gt;product_id = 0; unset($product-&gt;product_type); unset($product-&gt;product_code); }

By Code:

if(!empty($template_id)) { $product-&gt;product_id = 0; $product-&gt;product_type = 'main'; unset($product-&gt;product_code); }

So it will force the product_type instead of removing it ; so it should display the product tax category selection.

Regards,

---

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

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

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

Less More

- Posts: 73
- Thank you received: 3
-
-

11 years 8 months ago [\#190475](#190475) by [ced1870](/forum/user/29000-ced1870 "View ced1870's Profile")  Replied by *[ced1870](/forum/user/29000-ced1870 "View ced1870's Profile")* on topic *[tax category not considered in the producttemplate](/forum/20-market-feature-requests/874935-tax-category-not-considered-in-the-producttemplate#190475 "-- HikaShop version -- : 2.3.5 -- HikaMarket version -- : 1.5.1 -- Joomla version -- : 3.3.6  Hi I have update the tax rules using the package available on hikashop.com that creates a new category &quot;Electronic goods &amp; services &quot; I have edited the product template to use this category for all new products. I have tested by creating a new product from the frontend of hikamarket and the tax category is set to &quot;none&quot;, so not according to the setting.  CEd")*

I have no view "product", only the productmarket, then in the file I have these lines which are not totally the same:
l.604 Code:

if(!empty($template_id)) { $product-&gt;product_id = 0; unset($product-&gt;product_code); }

I have made the changes anyway and it does not work. My test :
- log as vendor in frontend &gt;&gt; create a new product, don't change anyting and save
- go in the admin side to check the tax rule, and still on "none"

Because the tax rule can not be changed from the vendor in frontend, it must take the default setting from the template

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26395
- Thank you received: 4077
-
- [](http://obsi.dev)
-

11 years 8 months ago [\#190482](#190482) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[tax category not considered in the producttemplate](/forum/20-market-feature-requests/874935-tax-category-not-considered-in-the-producttemplate#190482 "-- HikaShop version -- : 2.3.5 -- HikaMarket version -- : 1.5.1 -- Joomla version -- : 3.3.6  Hi I have update the tax rules using the package available on hikashop.com that creates a new category &quot;Electronic goods &amp; services &quot; I have edited the product template to use this category for all new products. I have tested by creating a new product from the frontend of hikamarket and the tax category is set to &quot;none&quot;, so not according to the setting.  CEd")*

Hi,

Okay, your problem is different than your first explanation let me think.
Regarding the current code ; I can't reproduce your issue. If there is no "product_tax_id" in the product, HikaMarket will copy the value from the product template.

In the HikaMarket product class, for the function "frontSaveForm" Code:

if(!hikamarket::acl('product_edit_tax')) { unset($product-&gt;product_tax_id); }

will remove the product_tax_id for the product if the vendor does not have the right to edit it.

Below in the function, the product template is loaded if we are creating a new product ; and the copy of the template is made in the current product Code:

if(!empty($template)) { foreach($template as $k =&gt; $v) { if(!in_array($k, array('product_code','product_alias')) &amp;&amp; !isset($product-&gt;$k)) $product-&gt;$k = $v; } }

For what I read and what I tested ; I can't reproduce your issue so I think that there is a missing information which would explain what the real problem is.

Regards,

---

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

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

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

Less More

- Posts: 73
- Thank you received: 3
-
-

11 years 8 months ago [\#190498](#190498) by [ced1870](/forum/user/29000-ced1870 "View ced1870's Profile")  Replied by *[ced1870](/forum/user/29000-ced1870 "View ced1870's Profile")* on topic *[tax category not considered in the producttemplate](/forum/20-market-feature-requests/874935-tax-category-not-considered-in-the-producttemplate#190498 "-- HikaShop version -- : 2.3.5 -- HikaMarket version -- : 1.5.1 -- Joomla version -- : 3.3.6  Hi I have update the tax rules using the package available on hikashop.com that creates a new category &quot;Electronic goods &amp; services &quot; I have edited the product template to use this category for all new products. I have tested by creating a new product from the frontend of hikamarket and the tax category is set to &quot;none&quot;, so not according to the setting.  CEd")*

ok my be my explanations were not so good ![:)](/media/kunena/emoticons/3.png ":)")

I don't know which information could be missing. Setting the tax category in the product template shall apply it when creating a new product ![:)](/media/kunena/emoticons/3.png ":)")

if I check the code in the product class, there is no tax_id on the product object
this is what I get Code:

object(stdClass)#1058 (13) { ["product_name"]=&gt; string(0) "" ["categories"]=&gt; string(1) "2" ["product_published"]=&gt; string(1) "1" ["compatibility"]=&gt; string(9) "Joomla! 3" ["responsive"]=&gt; string(1) "0" ["demo_url"]=&gt; string(0) "" ["photos_url"]=&gt; string(0) "" ["author_name"]=&gt; string(0) "" ["author_url"]=&gt; string(0) "" ["themepositions"]=&gt; string(0) "" ["product_id"]=&gt; int(0) ["product_type"]=&gt; string(4) "main" ["product_vendor_id"]=&gt; string(2) "10" }

if you tell me where to investigate to find how the tax_id is retrieved, I can try

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

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

Less More

- Posts: 73
- Thank you received: 3
-
-

11 years 8 months ago [\#190501](#190501) by [ced1870](/forum/user/29000-ced1870 "View ced1870's Profile")  Replied by *[ced1870](/forum/user/29000-ced1870 "View ced1870's Profile")* on topic *[tax category not considered in the producttemplate](/forum/20-market-feature-requests/874935-tax-category-not-considered-in-the-producttemplate#190501 "-- HikaShop version -- : 2.3.5 -- HikaMarket version -- : 1.5.1 -- Joomla version -- : 3.3.6  Hi I have update the tax rules using the package available on hikashop.com that creates a new category &quot;Electronic goods &amp; services &quot; I have edited the product template to use this category for all new products. I have tested by creating a new product from the frontend of hikamarket and the tax category is set to &quot;none&quot;, so not according to the setting.  CEd")*

update :
if I set the var_dump($product); just before the return $status, I get more in the object but still no tax_id ...

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

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

Less More

- Posts: 73
- Thank you received: 3
-
-

11 years 8 months ago [\#190504](#190504) by [ced1870](/forum/user/29000-ced1870 "View ced1870's Profile")  Replied by *[ced1870](/forum/user/29000-ced1870 "View ced1870's Profile")* on topic *[tax category not considered in the producttemplate](/forum/20-market-feature-requests/874935-tax-category-not-considered-in-the-producttemplate#190504 "-- HikaShop version -- : 2.3.5 -- HikaMarket version -- : 1.5.1 -- Joomla version -- : 3.3.6  Hi I have update the tax rules using the package available on hikashop.com that creates a new category &quot;Electronic goods &amp; services &quot; I have edited the product template to use this category for all new products. I have tested by creating a new product from the frontend of hikamarket and the tax category is set to &quot;none&quot;, so not according to the setting.  CEd")*

I have found something strange near line 320 Code:

$template_id = null; if(!empty($template_id))

template_id will always be null in this case ...so the loop Code:

foreach($template as $k =&gt; $v) { if(!in_array($k, array('product_code','product_alias')) &amp;&amp; !isset($product-&gt;$k)) $product-&gt;$k = $v; var_dump($k); }

will never be executed

The following user(s) said Thank You: [Jerome](/forum/user/80-jerome "View Jerome's Profile")

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26395
- Thank you received: 4077
-
- [](http://obsi.dev)
-

11 years 8 months ago [\#190508](#190508) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[tax category not considered in the producttemplate](/forum/20-market-feature-requests/874935-tax-category-not-considered-in-the-producttemplate#190508 "-- HikaShop version -- : 2.3.5 -- HikaMarket version -- : 1.5.1 -- Joomla version -- : 3.3.6  Hi I have update the tax rules using the package available on hikashop.com that creates a new category &quot;Electronic goods &amp; services &quot; I have edited the product template to use this category for all new products. I have tested by creating a new product from the frontend of hikamarket and the tax category is set to &quot;none&quot;, so not according to the setting.  CEd")*

Hi,

Wah, I missed that bug was in the previous release.
In line 320, please replace the Code:

$template_id = null;

By what should be his right content Code:

$template = null;

And it will fix the issue..

Sorry for the inconvenient

Regards,

---

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

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

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

Less More

- Posts: 73
- Thank you received: 3
-
-

11 years 8 months ago [\#190602](#190602) by [ced1870](/forum/user/29000-ced1870 "View ced1870's Profile")  Replied by *[ced1870](/forum/user/29000-ced1870 "View ced1870's Profile")* on topic *[tax category not considered in the producttemplate](/forum/20-market-feature-requests/874935-tax-category-not-considered-in-the-producttemplate#190602 "-- HikaShop version -- : 2.3.5 -- HikaMarket version -- : 1.5.1 -- Joomla version -- : 3.3.6  Hi I have update the tax rules using the package available on hikashop.com that creates a new category &quot;Electronic goods &amp; services &quot; I have edited the product template to use this category for all new products. I have tested by creating a new product from the frontend of hikamarket and the tax category is set to &quot;none&quot;, so not according to the setting.  CEd")*

I have changed this by my side, don't forget to update it for the next release ![;)](/media/kunena/emoticons/24.png ";)")
Have a good day
CEd

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26395
- Thank you received: 4077
-
- [](http://obsi.dev)
-

11 years 8 months ago [\#190606](#190606) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[tax category not considered in the producttemplate](/forum/20-market-feature-requests/874935-tax-category-not-considered-in-the-producttemplate#190606 "-- HikaShop version -- : 2.3.5 -- HikaMarket version -- : 1.5.1 -- Joomla version -- : 3.3.6  Hi I have update the tax rules using the package available on hikashop.com that creates a new category &quot;Electronic goods &amp; services &quot; I have edited the product template to use this category for all new products. I have tested by creating a new product from the frontend of hikamarket and the tax category is set to &quot;none&quot;, so not according to the setting.  CEd")*

Hi,

I won't ; it's already commit since several weeks ![:)](/media/kunena/emoticons/3.png ":)")
(But I though that I made a new package with that fix...)

Regards,

---

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIwLW1hcmtldC1mZWF0dXJlLXJlcXVlc3RzLzg3NDkzNS10YXgtY2F0ZWdvcnktbm90LWNvbnNpZGVyZWQtaW4tdGhlLXByb2R1Y3R0ZW1wbGF0ZT90bXBsPW1hcmtkb3du) 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?

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

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

Time to create page: 0.070 seconds

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