Filter products by category id

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

Filter products by category id

Post by ahmed31916 » 06 Aug 2022, 14:08

Hello Aimeos,

Would you tell me how can I filter products by category id?
Attribute, supplier, and price filters are very clear to use. I just add f_attrid in the form and send it.
However, searching by category id need "f_catid" and "f_name"?

Why we need "f_name"!
Isn't "f_catid" enough to search?
How can I search by category just in "f_catid"?

Best Regards

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

Re: Filter products by category id

Post by aimeos » 08 Aug 2022, 07:06

If you use the aimeos_shop_list route (the list/search page), you can use f_catid only. For aimeos_shop_tree (the category page), you need f_catid and f_name.
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: Filter products by category id

Post by ahmed31916 » 08 Aug 2022, 08:52

Unfortunately it does not work. It returns an error:

Code: Select all

/en/shop
Missing required parameter for [Route: aimeos_shop_tree] [URI: {locale}/shop/{f_name}~{f_catid}] [Missing parameter: f_name].
This is my form:

Code: Select all

<form method="GET" action="<?= airoute('aimeos_shop_list') ?>">
	<select name="f_catid">
		<?php foreach ($this->get('Model_categories') as $id => $item) : ?>
			<option value="<?= $id ?>"><?= $item->label ?></option>
		<?php endforeach ?>
	</select>
</form>

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

Re: Filter products by category id

Post by ahmed31916 » 09 Aug 2022, 10:12

@aimeos help me, please!

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

Re: Filter products by category id

Post by aimeos » 10 Aug 2022, 11:00

Somewhere, aimeos_shop_tree is still used and for that route, you need f_name too.
Try to find out where aimeos_shop_tree is used and see if you can remove it or add the f_name parameter.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply