Brand selection during product creation

  • Posts: 205
  • Thank you received: 12
3 years 1 month ago #328975

-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.24
-- PHP version -- : 7.4.14

We have created our Brands categories exactly the same way with our products categories because we need to have only the corresponding manufacturers of each product category when creating a product.
example....

Products categories
category 1
- subcategory 1-1
- subcategory 1-2
category 2
- subcategory 2-1
- subcategory 2-2

Brands
category 1
- subcategory 1-1
- subcategory 1-2
category 2
- subcategory 2-1
- subcategory 2-2

The problem is that when we create a new product, we see the product categories as a directory tree that we can browse and select from (this is fine), but in the Brand selection we see all the categories as links (including top level categories, subcategories, everything)

How can we have the same selection method for Brands as we have for product categories?





Thank you

Attachments:

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
3 years 1 month ago #328976

Hi,

In the file administrator/components/com_hikashop/types/namebox.php, you have this code near line 40:

'brand' => array(
			'class' => 'class.category',
			'name' => 'category_name',
			'mode' => 'list',
			'params' => array(
				'category_type' => 'manufacturer',
				'filters' => array(
					'c.category_depth > 1'
				),
				'key' => 'category_id',
			),
			'url' => 'category&task=findList&category_type=manufacturer',
			'options' => array(
				'tree_url' => 'category&task=getTree&category_type=manufacturer&category_id={ID}',
				'tree_key' => '{ID}',
			),
		),
This code defines how the brands selector works. Change the mode to "tree" instead of "list" and it will display like the categories selector.

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

  • Posts: 205
  • Thank you received: 12
3 years 1 month ago #328988

Thank you Nicolas!

This worked pretty nine for the backend.

In our case we are using both hikashop and hikamarket. Can we apply this solution somewhere so that vendors also see the "tree" mode in the brands selector when creating or editing a product (frontend)?

Forgive me for asking about hikamarket on a hikashop thread, but i really do not know which component this question is related to.

Last edit: 3 years 1 month ago by liaskas.

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

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
3 years 1 month ago #329023

Hello,

You can try the same patch but for the "administrator/components/com_hikamarket/types/namebox.php" file instead.

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.
The following user(s) said Thank You: liaskas

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

  • Posts: 205
  • Thank you received: 12
3 years 1 month ago #329043

Thank you Jerome. Works fine.

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

Time to create page: 0.076 seconds
Powered by Kunena Forum