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

#   Improve category assignation

##

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

Less More

- Posts: 640
- Thank you received: 16
-
-

11 years 2 months ago -  11 years 2 months ago [\#212897](#212897) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  *[Improve category assignation](/forum/23-market-how-to/879022-improve-category-assignation#212897 "-- HikaShop version -- : 2.6.5 -- HikaMarket version -- : 1.6.5  In the frontend product edition I would like to make the category tree chooser larger and with some category already unfolded so for massive maintenance it makes life easier for the data entry user.  This post is with double purpose:  First, could you advise on how could change the tree window size? I tried with several CSS editing but wasn't successful.  Second. is it possible to assign some (or all) category to be already unfolded once I open the category tree?  Second purpose, if not possible with simple file editing then I would like to suggest this as product improvements for future editions.  Indeed would be great if I could assign in the category itself if I want it to be shown already unfolded when showing in frontend or backend.  Thank you.")* was created by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")*

-- HikaShop version -- : 2.6.5
-- HikaMarket version -- : 1.6.5

In the frontend product edition I would like to make the category tree chooser larger and with some category already unfolded so for massive maintenance it makes life easier for the data entry user.

This post is with double purpose:

First, could you advise on how could change the tree window size? I tried with several CSS editing but wasn't successful.

Second. is it possible to assign some (or all) category to be already unfolded once I open the category tree?

Second purpose, if not possible with simple file editing then I would like to suggest this as product improvements for future editions.

Indeed would be great if I could assign in the category itself if I want it to be shown already unfolded when showing in frontend or backend.

Thank you.

[ ![FrontEdition-Category-tree.jpg](/forum/attachment/26201) ](/forum/attachment/26201 "...egory-tree.jpg")

- [ ![FrontEdition-Category-tree.jpg](/forum/attachment/26201) ](/forum/attachment/26201 "...egory-tree.jpg") [ ](/forum/attachment/26201?download=1 "...egory-tree.jpg")

Last edit: 11 years 2 months ago by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile"). Reason: Added missing image

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODc5MDIyLWltcHJvdmUtY2F0ZWdvcnktYXNzaWduYXRpb24/dG1wbD1tYXJrZG93bg==) 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 2 months ago [\#212908](#212908) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Improve category assignation](/forum/23-market-how-to/879022-improve-category-assignation#212908 "-- HikaShop version -- : 2.6.5 -- HikaMarket version -- : 1.6.5  In the frontend product edition I would like to make the category tree chooser larger and with some category already unfolded so for massive maintenance it makes life easier for the data entry user.  This post is with double purpose:  First, could you advise on how could change the tree window size? I tried with several CSS editing but wasn't successful.  Second. is it possible to assign some (or all) category to be already unfolded once I open the category tree?  Second purpose, if not possible with simple file editing then I would like to suggest this as product improvements for future editions.  Indeed would be great if I could assign in the category itself if I want it to be shown already unfolded when showing in frontend or backend.  Thank you.")*

Hi,

The category selector is using the namebox system.
The width of the "popup" is 100% of the container and the height is by default 130px.
You can change it using the CSS selector Code:

div.namebox-popup div.namebox-popup-content { }

For the loading of the content ; you can use an override in order to change the depth number (which is 1 by default). Code:

echo $this-&gt;nameboxType-&gt;display( 'data[product][categories]', $categories, hikamarketNameboxType::NAMEBOX_MULTIPLE, 'category', array( 'delete' =&gt; true, 'sort' =&gt; true, 'depth' =&gt; 2, 'root' =&gt; $this-&gt;vendorCategories, 'default_text' =&gt; '&lt;em&gt;'.JText::_('HIKA_NONE').'&lt;/em&gt;', ) );

The categories of the "product category" will be automatically loaded and the "product category" will be in open state.

Regards,

---

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

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

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

Less More

- Posts: 640
- Thank you received: 16
-
-

11 years 2 months ago [\#212919](#212919) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  Replied by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")* on topic *[Improve category assignation](/forum/23-market-how-to/879022-improve-category-assignation#212919 "-- HikaShop version -- : 2.6.5 -- HikaMarket version -- : 1.6.5  In the frontend product edition I would like to make the category tree chooser larger and with some category already unfolded so for massive maintenance it makes life easier for the data entry user.  This post is with double purpose:  First, could you advise on how could change the tree window size? I tried with several CSS editing but wasn't successful.  Second. is it possible to assign some (or all) category to be already unfolded once I open the category tree?  Second purpose, if not possible with simple file editing then I would like to suggest this as product improvements for future editions.  Indeed would be great if I could assign in the category itself if I want it to be shown already unfolded when showing in frontend or backend.  Thank you.")*

Thank you very much, I will dig in your suggestions and report when I am successful.

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

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

Less More

- Posts: 640
- Thank you received: 16
-
-

10 years 11 months ago -  10 years 11 months ago [\#224158](#224158) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  Replied by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")* on topic *[Improve category assignation](/forum/23-market-how-to/879022-improve-category-assignation#224158 "-- HikaShop version -- : 2.6.5 -- HikaMarket version -- : 1.6.5  In the frontend product edition I would like to make the category tree chooser larger and with some category already unfolded so for massive maintenance it makes life easier for the data entry user.  This post is with double purpose:  First, could you advise on how could change the tree window size? I tried with several CSS editing but wasn't successful.  Second. is it possible to assign some (or all) category to be already unfolded once I open the category tree?  Second purpose, if not possible with simple file editing then I would like to suggest this as product improvements for future editions.  Indeed would be great if I could assign in the category itself if I want it to be shown already unfolded when showing in frontend or backend.  Thank you.")*

The "unfolding by default' worked perfectly for product categories tree but now I want to do the same with product tree for Options and for Related products fields and I am not successful using the **depth** parameter:
Code:

echo $this-&gt;nameboxType-&gt;display( 'data[product][options]', @$this-&gt;product-&gt;options, hikamarketNameboxType::NAMEBOX_MULTIPLE, 'product', array( 'delete' =&gt; true, 'sort' =&gt; true, 'depth' =&gt; 4, /* ADDED DEPTH OPENING TREE CATEGORIES */ 'root' =&gt; 2, 'allvendors' =&gt; (int)$this-&gt;config-&gt;get('options_all_vendors', 0), 'default_text' =&gt; '&lt;em&gt;'.JText::_('HIKA_NONE').'&lt;/em&gt;', ) );

I tried with depth value from 2 to 4 and no error is displaying but also no unfolding by default.

Am I wrong expecting depth parameter to work for product selection trees?

Last edit: 10 years 11 months ago by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile"). Reason: Arranged code to be better readable

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

10 years 11 months ago [\#224160](#224160) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Improve category assignation](/forum/23-market-how-to/879022-improve-category-assignation#224160 "-- HikaShop version -- : 2.6.5 -- HikaMarket version -- : 1.6.5  In the frontend product edition I would like to make the category tree chooser larger and with some category already unfolded so for massive maintenance it makes life easier for the data entry user.  This post is with double purpose:  First, could you advise on how could change the tree window size? I tried with several CSS editing but wasn't successful.  Second. is it possible to assign some (or all) category to be already unfolded once I open the category tree?  Second purpose, if not possible with simple file editing then I would like to suggest this as product improvements for future editions.  Indeed would be great if I could assign in the category itself if I want it to be shown already unfolded when showing in frontend or backend.  Thank you.")*

Hi,

The "depth" setting in "product" just allow to load the data but does not unfold the categories by default.
In order to manage the "depth" for the "product" ; it requires some code in the getNameboxData of the HikaMarket product class.
The automatic unfold was not added for the products because it could display a big tree. The usage of the depth is more to pre-load data than display them directly to the user.
But we can see to add a setting for that unfolding.

In the file, you can replace Code:

$limit = (int)@$options['limit'];

By Code:

$limit = (int)@$options['limit']; $unfold = (int)@$options['unfold'];

And then Code:

if($depth &gt; 1 &amp;&amp; $v-&gt;category_depth &lt; $base_depth) { $lookup_categories[$k] = $k; $o-&gt;status = 1; }

By Code:

if($depth &gt; 1 &amp;&amp; $v-&gt;category_depth &lt; $base_depth) { $lookup_categories[$k] = $k; $o-&gt;status = $unfold ? 2: 1; }

So, you can now use the setting "unfold" with the other parameters (depth, root, ...)

Regards,

---

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

The following user(s) said Thank You: [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")

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

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

Less More

- Posts: 640
- Thank you received: 16
-
-

10 years 11 months ago [\#224190](#224190) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  Replied by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")* on topic *[Improve category assignation](/forum/23-market-how-to/879022-improve-category-assignation#224190 "-- HikaShop version -- : 2.6.5 -- HikaMarket version -- : 1.6.5  In the frontend product edition I would like to make the category tree chooser larger and with some category already unfolded so for massive maintenance it makes life easier for the data entry user.  This post is with double purpose:  First, could you advise on how could change the tree window size? I tried with several CSS editing but wasn't successful.  Second. is it possible to assign some (or all) category to be already unfolded once I open the category tree?  Second purpose, if not possible with simple file editing then I would like to suggest this as product improvements for future editions.  Indeed would be great if I could assign in the category itself if I want it to be shown already unfolded when showing in frontend or backend.  Thank you.")*

Applied successfully!

BIG THANK YOU!

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

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