How to move product filters?

  • Posts: 23
  • Thank you received: 0
12 years 11 months ago #31453

Is it possible to move the product filters, so they don't appear at the top of the product listing page? Ideally I would like to move them to the sidebar Joomla position I created, such as you would assign a module a position.

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
12 years 11 months ago #31470

In that case you should use the HikaShop filter module that you can configure via the joomla modules manager.

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

  • Posts: 23
  • Thank you received: 0
12 years 11 months ago #31787

Thanks for your reply. I did try using the Hikshop Filtering Module, but I guess I don't understand how it works. I select my filters in the module, and they show up fine, however they don't seem to work the same way the page filters do. First, they are not showing as dynamic, like the inline page filters are. Second, the filter button seems to submit to a category page, while I need it to just filter the results of the page I'm on. Can you explain how this module works?

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
12 years 11 months ago #31832

What do you mean by "they are not showing as dynamic" ? Could you do some screenshots maybe ?

For your second point: indeed, the module redirects to a category page instead of staying on the listing if it's already on a listing.
You should change the line:
if(!empty($this->params) && $this->params->get('module') == 'mod_hikashop_filter' && empty($cid)){
to:
if(!empty($this->params) && $this->params->get('module') == 'mod_hikashop_filter' && empty($this->currentId)){
in the file "filter" of the view "product" via the menu Display->Views
and add the line:
$this->assignRef('currentId',$cid);
before the line:
$this->assignRef('displayedFilters',$displayedFilters);
in the file components/com_hikashop/views/product/view.html.php
and that should avoid that the module redirects to another page when not needed.

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

  • Posts: 23
  • Thank you received: 0
12 years 11 months ago #31925

Thanks for the help. By "dynamic", I mean that when setting up a filter you have the "dynamic filter" option, which is great as it will base the options of the filter on the products in the current page. The filter module though seems to ignore this setting and shows all options no matter what page you're on.

I updated the code where you suggested and it seemed to work, but I'm getting many errors when I try to filter:

Warning: in_array() expects parameter 2 to be array, string given in .../administrator/components/com_hikashop/classes/filter.php on line 593
Notice: Uninitialized string offset: 0 in .../administrator/components/com_hikashop/classes/filter.php on line 1141

Also one more question: I set up my filters for a category. I want them to display in the sidebar, so I used the filter module as you suggested. How, then, do I hide the other filters that display within the category? If I disable them, then they are disabled for the module as well. Is there a better option than just hiding the display with a display:none?

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
12 years 11 months ago #31945

The dynamic options should work the same for all the filters regardless of the place where they are displayed.

For the error messages, it's just some missing checks. Normally, you should not see them on a production server.

They will be corrected properly in next version which will be out during the week. In the mean time, you can replace the file administrator\components\com_hikashop\classes\filter.php by the one in the archive enclosed to fix them errors.

Using a display none is a good way. You should also use a display block for the module's filters. So like that:
.hikashop_filter_main_div{display:none;}
.hikashop_filter_module .hikashop_filter_main_div{display:block !important;}

File Attachment:

File Name: filter.zip
File Size:12 KB

Attachments:

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

  • Posts: 23
  • Thank you received: 0
12 years 11 months ago #32006

The new filter.php file did help, thanks. I'm still having errors, however. When I click an option to filter, it comes back with the delete button but it doesn't tell me what I selected. I also get an error: Warning: substr() expects parameter 1 to be string, array given in /Users/core101/Sites/mcgard-corporate/administrator/components/com_hikashop/classes/filter.php on line 759 The lines are:

$html=substr($html,0,-2);
$val=substr($val,0,-1);


Screenshot is attached. Could you help with this? Thanks!

Attachments:
Last edit: 12 years 11 months ago by mmccarthy. Reason: added error lines

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
12 years 11 months ago #32032

Could you try to update to version 1.5.5 of HikaShop ? You can download it here when logged on our website:
www.hikashop.com/en/account/your-subscriptions.html

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

Time to create page: 0.065 seconds
Powered by Kunena Forum