Order of brand names in product edition

  • Posts: 2143
  • Thank you received: 747
8 years 9 months ago #208276

-- HikaMarket version -- : 1.6.4

Hi Jerome,

Got another question:
When selecting a brand during product edition, how can the brand names in the (dropdown) list be displayed in alphabetical order?

Default is "ordering", obviously. Been through a bunch of files to see where it could be changed, but no luck. Your help is appreciated, as always.

Thanks!


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
8 years 9 months ago #208278

Hi,

As you can see on our demo website, the brands namebox is already displaying brands in alphabetical order:
take.ms/48b6q

Thus, I suppose that you say that because you modified the product edition to not use nameboxes with the code I provided there:
www.hikashop.com/forum/20-market-feature...frontend.html#208117
Unfortunately, the normal brand dropdown has no dynamic option that you can change to change the ordering (unlike the namebox system).
So the only solution is to directly hack in the file administrator/components/com_hikashop/types/categorysub.php and change the line:
$query .= ' WHERE a.category_type = \''.$this->type.'\' AND a.category_parent_id!='.$parent.' ORDER BY a.category_ordering ASC';
to:
$query .= ' WHERE a.category_type = \''.$this->type.'\' AND a.category_parent_id!='.$parent.' ORDER BY a.category_name ASC';
Please note however that this will have repercussions on all the dropdowns used for category type elements (order status dropdowns, tax category dropdowns, etc).

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

  • Posts: 2143
  • Thank you received: 747
8 years 9 months ago #208359

Thank you, Nicolas, for helping the fool here building his exceptional case.

Yup, it's as you say: brands in single dropdown... of course. And I hear you regarding nameboxes - again, haha... ;)

Obviously, I'm anything but a script pro, but can't it be made with a

if(.....category_type == 'manufacturer') {
  $query............a.category_name ASC';
}else{
  $query............a.category_ordering ASC';
}
or so? Guess I'm kidding, lol. If it were possible, you had done so already.

But then nothing to worry, I'm good with the order statuses being "the wrong way" now... a small price to pay.

On a side note, I apologise for not having noticed it being you in the other thread, too. Just so used to seeing Jerome here as the lonesome HM warrior!

Thanks again.


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
8 years 9 months ago #208360

Hi,

You can have such condition if you want. We don't need it on our end since we changed the system completely now and we're using nameboxes :)

No problem, I'm helping Jerome while he is in holidays.

Last edit: 8 years 9 months ago by nicolas.
The following user(s) said Thank You: lousyfool

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

Moderators: Obsidev
Time to create page: 0.059 seconds
Powered by Kunena Forum