How to extend search for other db tables
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!
-
- Posts: 27
- Joined: 04 Jun 2020, 14:00
How to extend search for other db tables
Hi, I am learning aimeos now, and trying to understand how to implement search bar with default products data plus my custom data from other tables.
I would like to add the package for blog https://github.com/cnvs/canvas and search for posts and products together.
How I know, I need to create an extension, somehow override Catalog/Lists manager or create a decorator for override searchItems method, override SQL query in the config, do same with indexing.
Could you, please, help how to do it? What methods to override? Thank you!
P.S. I am trying on version 2019.10 right now, but can upgrade.
I would like to add the package for blog https://github.com/cnvs/canvas and search for posts and products together.
How I know, I need to create an extension, somehow override Catalog/Lists manager or create a decorator for override searchItems method, override SQL query in the config, do same with indexing.
Could you, please, help how to do it? What methods to override? Thank you!
P.S. I am trying on version 2019.10 right now, but can upgrade.
Re: How to extend search for other db tables
The catalog lists component only displays products and it's not recommended to change that.
Instead, you have to implement an own result page that is able to display blog and product data together. The layout will be much different because blog articles and products only share the name and an excerpt/shop description. You can use the Laravel means to build the result page which needs to search in the blog table and the mshop_index_text table. The route name for the products will be "aimeos_shop_detail" so you can also use the route() method to create the links.
Instead, you have to implement an own result page that is able to display blog and product data together. The layout will be much different because blog articles and products only share the name and an excerpt/shop description. You can use the Laravel means to build the result page which needs to search in the blog table and the mshop_index_text table. The route name for the products will be "aimeos_shop_detail" so you can also use the route() method to create the links.
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