Search filter issue

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!
User avatar
ahmed31916
Advanced
Posts: 148
Joined: 14 Apr 2022, 12:15

Search filter issue

Post by ahmed31916 » 04 Jun 2022, 21:06

Hello,

How can I get list of products with attribute id = 20 and price id = 67 (multiple search filter)? I tried this, but it returns "Invalid name "index.price.value"", why?

Code: Select all

$productManager = \Aimeos\MShop::create( app('aimeos.context')->get(), 'index' ) ;
$search = $productManager->filter( true )->slice( 0, 10000 );
$search->setConditions( $search->compare( '==', 'index.attribute.id', '20' ) );
$search->setConditions( $search->compare( '==', 'index.price.value', '67' ) );

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

Re: Search filter issue

Post by aimeos » 06 Jun 2022, 06:55

The correct search name for product prices in the index is "index.price:value":
https://github.com/aimeos/aimeos-core/b ... hp#L35-L42
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
ahmed31916
Advanced
Posts: 148
Joined: 14 Apr 2022, 12:15

Re: Search filter issue

Post by ahmed31916 » 06 Jun 2022, 09:25

thanks, it works.

Post Reply