Change search functionality and override files in vendor

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
GagDalakyan
Posts: 17
Joined: 03 Dec 2020, 13:13

Change search functionality and override files in vendor

Post by GagDalakyan » 01 Mar 2021, 11:37

Hi. Thanks for your great package and support.
I want to change search functionality, as you described in post13756.html#p13756 to search products by category name.

I want to know may i override
aimeos-core/lib/mshoplib/config/mshop/index.php,
aimeos-core/lib/mshoplib/src/MShop/Index/Manager/Text/Standard.php
files or i shall edit it in vendor folder.

Thanks.

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

Re: Change search functionality and override files in vendor

Post by aimeos » 01 Mar 2021, 11:43

Always extend the orginal classes in your own extension, never overwrite core files! Otherwise, your changes would be lost if you run "composer update".
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
GagDalakyan
Posts: 17
Joined: 03 Dec 2020, 13:13

Re: Change search functionality and override files in vendor

Post by GagDalakyan » 01 Mar 2021, 11:50

Ok. But how i must override for example "aimeos-core/lib/mshoplib/config/mshop/index.php" this file?
If i create index.php file in config, it don`t work.

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

Re: Change search functionality and override files in vendor

Post by aimeos » 03 Mar 2021, 09:14

The directory structure within the ./config folder of your extension is also important. To overwrite the "domains" setting add a folder named "mshop" and then add the index.php file within.

The easier way is to add it to the ./config/shop.php file of your Laravel application:

Code: Select all

'mshop' => [
	'index' => [
		'manager' => [
			'standard' => [
				'domains' => [
					'catalog' => ['text'],
					'attribute' => 'attribute',
					'product' => ['default'],
					'price' => ['default'],
					'text' => 'text',
				]
			]
		]
	]
],	
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply