category names in search result
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
- GülsümAkça
- Posts: 57
- Joined: 20 Nov 2020, 13:30
category names in search result
How can I show category names in search result?
Thank you
Thank you
Re: category names in search result
Yes, you can use this configuration to add the categories to the products:
https://aimeos.org/docs/2020.x/config/c ... s/#domains
This will include the localized category name too. Then, you have to overwrite the product partial and add:
at https://github.com/aimeos/ai-client-htm ... #L168-L170
How to overwrite templates:
https://aimeos.org/docs/2020.x/frontend ... templates/
https://aimeos.org/docs/2020.x/config/c ... s/#domains
Code: Select all
'client' => [
'html' => [
'catalog' => [
'lists' => [
'domains' => ['media', 'price', 'text', 'catalog' => ['text']]
]
]
]
]
)
Code: Select all
<?php if( !( $categories = $productItem->getCatalogItems() )->isEmpty() ) : ?>
<h3 class="category"><?= $enc->html( $categories->getName()->first(), $enc::TRUST ); ?></h3>
<?php endif ?>
How to overwrite templates:
https://aimeos.org/docs/2020.x/frontend ... templates/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
- GülsümAkça
- Posts: 57
- Joined: 20 Nov 2020, 13:30
Re: category names in search result
thank you for your help,
But I guess I couldn't express myself correctly. sorry
If I search for a word, I can see the suggest products under the search bar without clicking the search button or press the enter.
just like this, if I search for a category name, I want to show the category as suggestion under the search bar.
Is it possible to do this?
But I guess I couldn't express myself correctly. sorry
If I search for a word, I can see the suggest products under the search bar without clicking the search button or press the enter.
just like this, if I search for a category name, I want to show the category as suggestion under the search bar.
Is it possible to do this?
Re: category names in search result
There's currently no configuration option to enable such a behavior and you have to implement it yourself.
You can add a decorator for the catalog/suggest HTML client which searches for the text string in the "label" column in the "mshop_catalog" table:
https://github.com/aimeos/ai-client-htm ... #L310-L382
How to implement a decorator:
https://aimeos.org/docs/latest/frontend ... omponents/
You can add a decorator for the catalog/suggest HTML client which searches for the text string in the "label" column in the "mshop_catalog" table:
https://github.com/aimeos/ai-client-htm ... #L310-L382
How to implement a decorator:
https://aimeos.org/docs/latest/frontend ... omponents/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star