Good way to filter

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Bevi
Posts: 33
Joined: 25 Sep 2017, 20:57

Good way to filter

Post by Bevi » 09 Nov 2017, 16:48

Laravel 2017.10

Hello sir, :)
I would like to make a filter to search words inside my description field.

Let's say I have a description field that says "blue silk socks" and I want to make a query that filter the word "socks."
What should I do to put a filtered word in an anchor?

I already have an anchor for the category "clothes"

Code: Select all

 <li><a class="btn btn-default"href="/list?f_name=clothes&f_catid=2">Clothes</a></li>
Now I want another anchor that does something like "/list?f_name=clothes&f_catid=2 and "socks" in field description"

I hope you understand what I wanna do.

Thanks in advance :D

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Good way to filter

Post by aimeos » 09 Nov 2017, 22:13

Use the "f_search" parameter like used in the input field of the full text search (catalog filter component, search subpart).
Here you can find all used parameter names: https://aimeos.org/docs/Developers/Html ... eter_names
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Bevi
Posts: 33
Joined: 25 Sep 2017, 20:57

Re: Good way to filter

Post by Bevi » 10 Nov 2017, 16:06

Ok, I made some anchors like

Code: Select all

<li><a class="btn btn-default"href="/list?f_search=socks">Socks</a></li>
It's working fine but the f_search content gets injected into the searchbar
Is there a way to clear the searchbar after clicking the anchor without losing the filtered content? :geek:

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Good way to filter

Post by aimeos » 12 Nov 2017, 11:29

You can overwrite this template and don't show the content of the f_search parameter:
https://github.com/aimeos/ai-client-htm ... lt.php#L10
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Bevi
Posts: 33
Joined: 25 Sep 2017, 20:57

Re: Good way to filter

Post by Bevi » 27 Nov 2017, 15:39

Hello again, Sir.
Is there a way to create sub-categories?

Let's say I have a category called "cars", and then I need 2 subcategories called "electric cars" and "essence cars."

If the client clicks on cars, he'll see both of the subcategories, if he clicks "electric cars" he'll only display electric cars.

I would like to handle these using anchors instead of many checkboxes.

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Good way to filter

Post by aimeos » 27 Nov 2017, 22:12

What does "anchors" vs. "checkboxes" mean?

You can configure showing products also from sub-categories in parent categories:
https://aimeos.org/docs/Configuration/C ... sts/levels

If you want to have more control, you can add your products to both categories (parent and child)
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply