Sorting Front-end Categories by Product Code

  • Posts: 56
  • Thank you received: 1
8 years 6 months ago #218365

-- HikaShop version -- : 2.6.0

I am looking for a way to make the sort filter for a category include the option to sort by product code. Could someone point me in the right direction please? I couldn't find anything on the forum to help me with it.

EDIT: Sorry, I keep messing up my posts and putting them in install and update, as noted in my other thread. Please move this to product and category display or wherever is appropriate.


Professional website services including website management, Linux server admin and web hosting.
www.sharphosting.uk/
Last edit: 8 years 6 months ago by NigelPeck.

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

  • Posts: 13201
  • Thank you received: 2322
8 years 6 months ago #218431

Hi,

In the Joomla menus / modules settings, edit the desired menu / module and in the HikaShop settings of the item you have options to sort the products as you want. The option ordering field allow to select the column to filter on, so you can select "product_code", and for ordering direction select if the ordering.

The following user(s) said Thank You: NigelPeck

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

  • Posts: 56
  • Thank you received: 1
8 years 6 months ago #218588

Hi Xavier,

Thanks for this. I should have been clearer. I meant I want a filter on the front-end of the site to allow visitors to sort by product code. I have the sort filter but it doesn't offer product code as an option for sorting.

Thanks
Nigel


Professional website services including website management, Linux server admin and web hosting.
www.sharphosting.uk/
Last edit: 8 years 6 months ago by NigelPeck.

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

  • Posts: 13201
  • Thank you received: 2322
8 years 6 months ago #218594

Hi,

You can potentially edit the view "filter / form_options" (backend template) and add the code:

								$this->fields['product_code'] = new stdClass();
								$this->fields['product_code']->field_namekey = 'b.product_code';
								$this->fields['product_code']->field_realname = JText::_('PRODUCT_CODE');
Before:
echo $this->product_informationType->display("data[filter][sort_by][]", @$this->element->filter_options['sort_by'], $this->fields, 'multiple="multiple" size="8"', null, true);

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

Time to create page: 0.069 seconds
Powered by Kunena Forum