How to extend search for other db tables

Help for integrating the Laravel package
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!
mr.zherart
Posts: 27
Joined: 04 Jun 2020, 14:00

How to extend search for other db tables

Post by mr.zherart » 04 Jun 2020, 14:58

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.

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

Re: How to extend search for other db tables

Post by aimeos » 05 Jun 2020, 14:42

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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply