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

#   HikaMarket default product category

##

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

Less More

- Posts: 43
- Thank you received: 0
-
-

11 years 4 months ago [\#206201](#206201) by [DavidThor](/forum/user/30643-davidthor "View DavidThor's Profile")  *[HikaMarket default product category](/forum/23-market-how-to/877778-hikamarket-default-product-category#206201 "-- HikaMarket version -- : 1.6.3  Hi,  Currently the standard value for product category when adding a product in HikaMarket front-end is set to 'Product categories'. How do I change that to a blank value so that every vendor doesn't also add products to the root by mistake in addition to the actual/intended product category?  Not all vendors will understand the need to remove/delete the root category.  Thanks, David")* was created by *[DavidThor](/forum/user/30643-davidthor "View DavidThor's Profile")*

-- HikaMarket version -- : 1.6.3

Hi,

Currently the standard value for product category when adding a product in HikaMarket front-end is set to 'Product categories'. How do I change that to a blank value so that every vendor doesn't also add products to the root by mistake in addition to the actual/intended product category?

Not all vendors will understand the need to remove/delete the root category.

Thanks,
David

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODc3Nzc4LWhpa2FtYXJrZXQtZGVmYXVsdC1wcm9kdWN0LWNhdGVnb3J5P3RtcGw9bWFya2Rvd24=) 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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

11 years 4 months ago [\#206204](#206204) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[HikaMarket default product category](/forum/23-market-how-to/877778-hikamarket-default-product-category#206204 "-- HikaMarket version -- : 1.6.3  Hi,  Currently the standard value for product category when adding a product in HikaMarket front-end is set to 'Product categories'. How do I change that to a blank value so that every vendor doesn't also add products to the root by mistake in addition to the actual/intended product category?  Not all vendors will understand the need to remove/delete the root category.  Thanks, David")*

Hi,

In the view "productmarket &#124; form", replace Code:

$categories = null; if(!empty($this-&gt;product-&gt;categories)) $categories = array_keys($this-&gt;product-&gt;categories);

By Code:

$categories = null; if(!empty($this-&gt;product-&gt;categories) &amp;&amp; !empty($this-&gt;product-&gt;product_id)) $categories = array_keys($this-&gt;product-&gt;categories);

Regards,

---

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

The following user(s) said Thank You: [DavidThor](/forum/user/30643-davidthor "View DavidThor's Profile")

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

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

Less More

- Posts: 43
- Thank you received: 0
-
-

11 years 4 months ago [\#206229](#206229) by [DavidThor](/forum/user/30643-davidthor "View DavidThor's Profile")  Replied by *[DavidThor](/forum/user/30643-davidthor "View DavidThor's Profile")* on topic *[HikaMarket default product category](/forum/23-market-how-to/877778-hikamarket-default-product-category#206229 "-- HikaMarket version -- : 1.6.3  Hi,  Currently the standard value for product category when adding a product in HikaMarket front-end is set to 'Product categories'. How do I change that to a blank value so that every vendor doesn't also add products to the root by mistake in addition to the actual/intended product category?  Not all vendors will understand the need to remove/delete the root category.  Thanks, David")*

Thanks. Perfect! //David

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

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

Less More

- Posts: 205
- Thank you received: 12
-
-

6 years 5 months ago [\#319889](#319889) by [liaskas](/forum/user/59465-liaskas "View liaskas's Profile")  Replied by *[liaskas](/forum/user/59465-liaskas "View liaskas's Profile")* on topic *[HikaMarket default product category](/forum/23-market-how-to/877778-hikamarket-default-product-category#319889 "-- HikaMarket version -- : 1.6.3  Hi,  Currently the standard value for product category when adding a product in HikaMarket front-end is set to 'Product categories'. How do I change that to a blank value so that every vendor doesn't also add products to the root by mistake in addition to the actual/intended product category?  Not all vendors will understand the need to remove/delete the root category.  Thanks, David")*

Sorry for bringing back a 4 years old thread.

We have the same issue exactly so we applied Jerome's suggestion and the 'Product categories' indeed disappear when creating a product!

So far, so good!

Moving a little bit further we creates a test product leaving "Product categories" blank. When we saved the new product the 'Product categories' value was assigned to the product automatically.

Our question is...

Can we set the field "Product categories" to be mandatory so that the product is not created if left blank?

Thank you

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODc3Nzc4LWhpa2FtYXJrZXQtZGVmYXVsdC1wcm9kdWN0LWNhdGVnb3J5P3RtcGw9bWFya2Rvd24=) 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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

6 years 5 months ago [\#319930](#319930) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[HikaMarket default product category](/forum/23-market-how-to/877778-hikamarket-default-product-category#319930 "-- HikaMarket version -- : 1.6.3  Hi,  Currently the standard value for product category when adding a product in HikaMarket front-end is set to 'Product categories'. How do I change that to a blank value so that every vendor doesn't also add products to the root by mistake in addition to the actual/intended product category?  Not all vendors will understand the need to remove/delete the root category.  Thanks, David")*

Hello,

The HikaMarket (and HikaShop) algorithms are made to set-up a category if nothing is specified.
By default, HikaMarket will use the current category (you were browsing the vendor product listing) or "vendor root category".
I'm afraid that to change that, it will require to modify the HikaMarket core, the usage of the trigger "onBeforeProductCreate" could work but the way to detect that HikaMarket fill that empty field could be tricky.

Regards,

---

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

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

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