Non-existing filter option gives strange result

  • Posts: 26
  • Thank you received: 0
  • Hikashop Business
8 years 9 months ago #247336

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.6.2
-- PHP version -- : 5.6.24
-- Browser(s) name and version -- : Chrome 52.0.2743.82 (64-bit)
-- Error-message(debug-mod must be tuned on) -- : no error message

I have a menu item (only accessible as administrator) showing all products from a chosen category.
Above the list of products we placed a filter.

The combination "PNP/NPN" and "M8 Quick-disconnect" should result in no products.
When you select this non-existing combination and press the button "filter" the page comes back without any products (as expected) and more options selected (not expected).




I was expecting two other things
  • Text that this combination is not possible
  • No other filter options selected

How can this be achieved?

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

  • Posts: 83933
  • Thank you received: 13588
  • MODERATOR
8 years 9 months ago #247357

Hi,

1. The fact that there is no message when no results are found is because we don't display any by default as it appears most merchants don't want one. But you can add it easily:
www.hikashop.com/support/forum/filters-s...e-result.html#232388

2. I suppose that the problem must come from the values that you're using in your custom field which must overlap and thus the filter system finds a match for the selection of the value.
Could you provide a screenshot of the setting of the custom field of that output type filter ?

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

  • Posts: 26
  • Thank you received: 0
  • Hikashop Business
8 years 9 months ago #248710

1. We've added a language override in Joomla backend > Extensions > Languages > Overrides > Site
HIKASHOP_NO_RESULT='No results found!'
Still the same issue as mentioned in my initial post.

2. See the attached files.

Attachments:

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

  • Posts: 83933
  • Thank you received: 13588
  • MODERATOR
8 years 9 months ago #248758

Hi,

1. I've tested is and it works just fine with your example. So you must have done something wrong with your override. Try adding it via the HikaShop configuration as explained in the documention link I gave you.

2. Change the code:

if(!empty($selected) && is_array($selected) && (in_array($val[0], $selected) || strpos($selected[0], $val[0]) !== false)) {
						$checked = 'checked="checked"';
						if($type == 'radio') {
							$deleteButton = '  '.parent::getDeleteButton($filter, $divName, '', $html, '', true, 'field_'.$filter->filter_id.'_'.$key.'_'.$divName);
						}
					}
to:
if(!empty($selected) && is_array($selected)){
						foreach($selected as $selectedElement){
							if(preg_match('#^('.$selectedElement.'|.*\:\:'.$selectedElement.'|'.$selectedElement.'::.*)$#',$val[0],$match)){
								$checked = 'checked="checked"';
								if($type == 'radio') {
									$deleteButton = '  '.parent::getDeleteButton($filter, $divName, '', $html, '', true, 'field_'.$filter->filter_id.'_'.$key.'_'.$divName);
								}
								break;
							}
						}
					}
in the file administrator/components/com_hikashop/classes/filter.php and that will make the system properly select the elements after the search. Regarding the fact that you see all the values after the filter, that's normal:
You're in dynamic display mode where the filters display all the values of the products in the listing. Since there are no products after the filtering, there are no values. So instead of not displaying any values in the filters, it displays all of them.

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

  • Posts: 26
  • Thank you received: 0
  • Hikashop Business
8 years 9 months ago #248886

Thank you... I've added this core hack to the mentioned Hikashop file. Will it be added to the newest release of Hikashop too?

The page mentioned is a category view with a filter on top of it.
components/com_hikashop/views/category/tmpl/listing.php
When I add ```echo 'test';``` after line 144 and refresh the page without the results I can see "test" appear in the screen.

There is no way I see the variable "HIKASHOP_NO_RESULT" in that screen. And I cannot see the relation of components/com_hikashop/views/product/tmpl/listing.php into components/com_hikashop/views/category/tmpl/listing.php

Can you help me on this one?

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

  • Posts: 83933
  • Thank you received: 13588
  • MODERATOR
8 years 9 months ago #248894

That patch has already been added for the next version as I tested it before giving it to you.

Regarding the "no results" message, I don't understand what you're talking about.
The link I gave you says that you need to add the line:
HIKASHOP_NO_RESULT=" "
in the override area of your translation file through the Languages tab of the HikaShop configuration.
There is no need to change any "listing.php" file.

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

  • Posts: 26
  • Thank you received: 0
  • Hikashop Business
8 years 8 months ago #249988

I've updated my version of Hikashop with the most recent version and my initial second question is solved.
The first is still open... I don't see my translation of HIKASHOP_NO_RESULT=" "

I've added my override to Components > Hikashop > Configuration > System > Languages > English (one language on this site) > Edit > Override > added HIKASHOP_NO_RESULT="No results with current filter. Please use other filter options."

But the created override is not visible on the frontend after using the filter. Not even when I disable all template overrides for com_hikashop. What I tried to explain is that the page I'm looking it is a category view with a filter on top of it. it is displayed using components/com_hikashop/views/CATEGORY/tmpl/listing.php
The text variable HIKASHOP_NO_RESULT does not appear in this php file. It appears in components/com_hikashop/views/PRODUCT/tmpl/listing.php.

How can I make HIKASHOP_NO_RESULT appear on a category view?

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

  • Posts: 4820
  • Thank you received: 654
  • MODERATOR
8 years 8 months ago #249994

Hello,

Let's make it in a different way, can you provide the concern page Url and a Backend Access references ?
Note : You can use our Contact us form to provide these references.

Awaiting news from you.

Regards

Last edit: 8 years 8 months ago by Philip.

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

  • Posts: 26
  • Thank you received: 0
  • Hikashop Business
8 years 7 months ago #251993

Issue has been solved by Hikashop. Thanks for that.

We found the issue and corrected it. It was coming from the fact that you're using a categories listing instead of a products listing as is usually the case for products filtering and that case wasn't properly handled by the "no results" message system.
We'll add the modification for that in the next version of HikaShop.

Last edit: 8 years 7 months ago by perfectwebteam.

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

Time to create page: 0.100 seconds
Powered by Kunena Forum