Filter element: show only existing values

  • Posts: 24
  • Thank you received: 0
7 years 9 months ago #260937

-- url of the page with the problem -- : www.matabikeshop.com/

Hello.
Into filter setting, I'd like to know if there is a configuration which allows to limit the number of filter values, as a function of the product shown into page.
For example:
- I have a shoe market
- I create a page where I list all category products
- I create a characteristic called SIZE, where I insert all existing show size (from 36 to 54, for example)
- I have a filter based on SIZE characteristic, for filter shoe by a specific size number
- I inserted in all pages the SIZE filter
- When I create a category product page, I desire to limit the number of SIZE filter elements, by only the size present into the category of the page opened.

This kind of configuration is possible or I have to modify Hikashop PHP files?

Thanks for your support.

BR

MatteoS

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 9 months ago #260963

Hi,

The filter system allow you to get dynamic values for some filters.
Thanks to that, you can only get the values for existing products.

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.

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

  • Posts: 24
  • Thank you received: 0
7 years 9 months ago #261172

Thanks for the reply, but in my site this isn't true:
- I created a test characteristic, with 3 values (COLORS => WHITE, BLACK, BLUE)
- I associate to one product only 2 values of the characteristic (PRODUCT => COLOR-WHITE, COLOR-BLACK)
- I created a test filter linked to COLOR characteristic; I published this filter on all product categories pages; the product with COLOR characteristic is present in only one page but I see all characteristic values in all pages, when I have to see this filter (or its values) only in the page that contains the product with COLOR characteristic ... or at least I have to see only the color characteristic values associated to the product (then, WHITE and BLACK).
Is this behavior automatic in hikashop filters or I have to set something?
Do I make myself clear?

Thanks for your support.

BR

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

  • Posts: 4747
  • Thank you received: 644
  • MODERATOR
7 years 9 months ago #261190

Hello,

I think I get it, you want a filter that only process visible products on the visible listing, right ?

So, if yes, follow this different points:

First in your filter backend edition:



See, the Category that will limited the search only in this specific category.

Second step, Use a module with Menu Assignment like on this screenshot and select your required Filter:



And so here, this module will only display ONLY on the required products listing.



You have just to repeat this kind of configuratoion for each listing.

Note: The limit to this way to proceed is that you have to use a Module in order to restrict his display on the required listing.
Maybe you have to select a good position for your module and some Css to have your filter IN your listing.

Hope this will fit your needs.

Regards

Attachments:
Last edit: 7 years 9 months ago by Philip.

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

  • Posts: 24
  • Thank you received: 0
7 years 9 months ago #261247

Really thank you !!!
I'll follow your instruction: I'll let you know the result of my operations.
Thanks !!!

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

  • Posts: 24
  • Thank you received: 0
7 years 9 months ago #263415

Hi.
I'm sorry but it doesn't work: my filters show also the characteristics not associated with any product.
I made a test: I create a new color called 00-NEW. This color, obviusly, is doesn't associated with any product: I expect not to see its. But it doesn't happen: I see it inside my color filter list.
This is my site configuration:
- IMAGE 1: my HIKASHOP filter module configuration. I set the MENU parameter with the menu id where is possible to see the filter
- IMAGE 2: the menu item where is shown the filter module, on the left side of the page. In this page, is possible to see the product of category BICICLETTE
- I associated the characteristic COLORE to this product category
- IMAGE 3: the filter configuration. I create a filter called COLORE (=color in english); I set the category BICICLETTE, the same of the menu; the characteristic associated is COLORE (parameter on the right of the image), I included the subcategory;
- IMAGE 4: the characteristic COLORE, where is possible to see the test value 00-NEW
- IMAGE 5: the hikashop filter, that doesn't limit the list with only filters value associated with one product at least. You can see the value 00-NEW, that it doesn't associated to any product.

Where's the problem?

What can we do for test together the behavior of my filters?

Thanks for you support.

Bye.

MatteoS

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
7 years 9 months ago #263429

Hi,

I don't have the problem on our end.
Could you provide a backend access so that we could check your settings ?
A FTP access might be needed as well if we need to debug the situation.
You can provide that along with a link to this thread via our contact form and we'll have a look at the problem:
www.hikashop.com/support/contact-us.html

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

  • Posts: 24
  • Thank you received: 0
7 years 8 months ago #263882

Of course: I'm sure is my problem !!! I need your help for setting up the site.
I immediately write to support via contact form.
Thanks.

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

  • Posts: 4747
  • Thank you received: 644
  • MODERATOR
7 years 8 months ago #263896

Hello,

We process some tests and have a look on your configuration, and it seems that there is maybe a bug for a specific case.
Hard to go more more far now, in order to progress on this subject, can you provide as asked an Ftp access, please ?

Use our contact us form and notify us by posting on this topic.
Awaiting news from you.

Regards

Last edit: 7 years 8 months ago by Philip.

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

  • Posts: 24
  • Thank you received: 0
7 years 8 months ago #263976

Of course: I send to you the ftp access.
Thanks for your support.

Bye

MatteoS

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

  • Posts: 24
  • Thank you received: 0
7 years 8 months ago #264020

IP sended ... I look forward to hearing from you.

BR

MatteoS

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
7 years 8 months ago #264036

Hi,

The issue is that you customized the "filter" file of the view "product" and commented out the line:
$datas=$this->filterClass->getProductList($this, $filters);
It's this line which allows the filters system to activate the "dynamic display" of the filters and display only the values used in the products of the listing. If you uncomment that line, it will display like it should.

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

  • Posts: 24
  • Thank you received: 0
7 years 8 months ago #264104

It works ... incredibile !!! Really thank you !!!

Characteristic filters work correctly but now I have problems with CATEGORY filters, insiede the same filters structure: probably there are another template customization that crash the system.

Could you make another check?

I attached three images:
- one about the filter configuration, where you can see where I selected TELAI category;



- one about the selection filter into module filter.


- one about the category menu


The filter configuration is correct?
Considers that I would create ONE filter for every category menu; for this reason, into filter configuration, I selected the main category. I expect to see, in the filter, the list of subcategory of the corresponding category menu page.

Really thank you for the support.

BR

MatteoS

Attachments:
Last edit: 7 years 8 months ago by simtheo.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
7 years 8 months ago #264282

Hi,

The settings look fine.
However, when I look at the listing with the filter activated, I'm getting redirected to a strange URL: /index.php?option=com_content&view=article&id=15&Itemid=343
Without any error message.
I suppose that this indicates that there is an error and that is catched by something to display your custom 404 error page.
Could you turn that off so that we could see the error message ?
Or even better, could you provide that error message ?

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

  • Posts: 24
  • Thank you received: 0
7 years 8 months ago #264368

This is new for me ... I never thought about this ...
Here's the error:

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-Misura_211 ON Brand-Misura_211.variant_product_id=c.product_id WHERE (b.product' at line 1 SQL=SELECT DISTINCT b.* FROM #__hikashop_product AS b LEFT JOIN #__hikashop_product AS c ON b.product_id=c.product_parent_id LEFT JOIN #__hikashop_variant AS Brand-Misura_211 ON Brand-Misura_211.variant_product_id=c.product_id WHERE (b.product_published=1) AND (b.product_type = 'main') AND (b.product_manufacturer_id IN (400)) AND ((b.product_access = 'all' OR b.product_access LIKE '%,9,%')) AND ( Brand-Misura_211.variant_characteristic_id IN (83) ) AND ( c.product_quantity!=0 ) ORDER BY b.product_name ASC LIMIT 0, 40

Let me know.

Really thank you.

BR

MatteoS

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
7 years 8 months ago #264375

Hi,

Great ! I've added a patch on our end for that.
It comes from the fact that you have (had ?) a dash in the filter name and that is used in the MySQL query as part of a table alias but dashes are not allowed. I've modified the code to convert dashes into underscores to avoid the problem.
So either you can update your HikaShop by downloading it on our website and installing it on your website, or you can delete the filter and recreate it with a name without a dash to circumvent the problem.

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

  • Posts: 24
  • Thank you received: 0
7 years 8 months ago #264745

Really thank you !!! It correctly works !!! I renamed all filters and now they work correctly.
My mistake, but it would never happen with a control system into filters creation ;-) ... I'm kidding !!!
Really thank you for the support !!!

Best regards !!!

MatteoS

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
7 years 8 months ago #264747

Hi,

There actually is a control system for the filter creation. The thing is that dashes were not a problem before because the alias of the filters were not used in the queries like that before. And when we switched that, we didn't thought about that possibility.

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

Time to create page: 0.113 seconds
Powered by Kunena Forum