Disable force-search not working

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
PedroLópezAndradas
Posts: 22
Joined: 16 Jan 2023, 11:30

Disable force-search not working

Post by PedroLópezAndradas » 09 Mar 2023, 09:15

Hi!

I'm trying to diable force-search on aimeos_head_search section.

I have tried setting force-search to "0" on:

client/html/catalog/filter/tree/force-search

and on

client/html/catalog/filter/search/force-search


But when I'm on a category, search results are always from that category instead of full catalogue.

It happens even when I override search-body.php template and set $enforce = false

Maybe I'm missing something?

Thanks!

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

Re: Disable force-search not working

Post by aimeos » 10 Mar 2023, 09:22

PedroLópezAndradas wrote: 09 Mar 2023, 09:15 I'm trying to diable force-search on aimeos_head_search section.
I have tried setting force-search to "0" on:

client/html/catalog/filter/tree/force-search
and on
client/html/catalog/filter/search/force-search
It's this setting:

Code: Select all

client/html/catalog/filter/search/force-search
And in ./config/shop.php:

Code: Select all

	'client' => [
		'html' => [
			'catalog' => [
				'filter' => [
					'search' => [
						'force-search' => true,
					],
				],
			],
		],
	],
See here for reference:
https://aimeos.org/docs/latest/laravel/ ... figuration
PedroLópezAndradas wrote: 09 Mar 2023, 09:15 It happens even when I override search-body.php template and set $enforce = false
It will do the same but you have another template you overwrite in your project.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
PedroLópezAndradas
Posts: 22
Joined: 16 Jan 2023, 11:30

Re: Disable force-search not working

Post by PedroLópezAndradas » 10 Mar 2023, 09:44

Hi @aimeos, thank you for your help.

I've removed all the templates that I had overrided, and it still is searching only on current category.

Code: Select all

	'client' => [
		'html' => [
			'catalog' => [
				'filter' => [
					'search' => [
						'force-search' => true
					],
					'tree' => [
						'force-search' => true
					]
				]
			]
		]
	]

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

Re: Disable force-search not working

Post by aimeos » 10 Mar 2023, 09:49

In that case it's "client/html/catalog/filter/tree/force-search" which must be FALSE.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
PedroLópezAndradas
Posts: 22
Joined: 16 Jan 2023, 11:30

Re: Disable force-search not working

Post by PedroLópezAndradas » 15 Mar 2023, 10:15

Dear aimeos, thank you for your help.

I've tested all possible combinations, and the behaviour is just the same.

When inside a category, pressing search button adds the query to de current category url:

https://midomain.xxx/shop/category~40?f_search=mammo

And the result are obviously empty. :?

Is that the expected behaviour? I think it should search on full shop, like:

https://midomain.xxx/shop/?f_search=mammo

Thanks.

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

Re: Disable force-search not working

Post by aimeos » 17 Mar 2023, 14:53

If you overwrite this template and remove adding parameters at all, it may work as you want:
https://github.com/aimeos/ai-client-htm ... dy.php#L83

The two options are only for including the f_search resp. f_catid/f_name parameters in the URL or POST when searching.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
PedroLópezAndradas
Posts: 22
Joined: 16 Jan 2023, 11:30

Re: Disable force-search not working

Post by PedroLópezAndradas » 29 Mar 2023, 06:39

I never got back to you.

Thank you so much for your guidance, it was totally helpful.

<3

Post Reply