Page 1 of 1

Re: Adding a column from products table to searchable index so that all products with specific column value can be searc

Posted: 14 May 2022, 07:13
by aimeos
If you create a decorator for the product manager, you can also search for new properties:
https://aimeos.org/docs/latest/models/e ... /#easy-way

Code: Select all

$manager = \Aimeos\MShop::create( $context, 'product' );
$filter = $manager->filter()->add( 'tags', '==', 'Best Seller' );
$items = $manager->search( $filter );

Re: Adding a column from products table to searchable index so that all products with specific column value can be searc

Posted: 17 May 2022, 14:30
by aimeos
In that case, use the frontend product controller from your screenshot and add this for filtering by tags:

Code: Select all

->compare( '==', 'tags', 'Best seller' )
See: https://github.com/aimeos/ai-controller ... ce.php#L62

Re: Adding a column from products table to searchable index so that all products with specific column value can be searc

Posted: 19 May 2022, 06:38
by aimeos
Place your condition between the create() and search() methods in an if() condition:

Code: Select all

$cntl = \Aimeos\Controller\Frontend::create( $context, 'product' );

if( $theme = $view->param( 'f_theme' ) ) {
	$cnt->compare( '==', 'themes', $theme );
}

$products = $cntl->...()->search();