Aimeos filtering attributes and categories

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Doku
Posts: 2
Joined: 27 Sep 2023, 07:41

Aimeos filtering attributes and categories

Post by Doku » 27 Sep 2023, 08:04

We are using:
- TYPO3 v11
- aimeos dist 22.10.1
- aimeos 22.10.9

We have built multiple shop with aimeos in typo3 (fairly standard), the only catch is a relative large amount of products and
attributes (~15,000 products, ~ 10,000 attributes | >50,000 products, ~ 50,000 attributes).

To filter the products, we use a combination of categories and attributes.
Each shop has 3 parent categories and ~30-50 child categories, limiting the amount of attributes the shop has to work with.

To display more attributes on the loss of performance, we use following settings:

Code: Select all

# More filtered produkts in the FE
plugin.tx_aimeos.settings.mshop.common.manager.aggregate.limit = 1000000000
# More filtering attributes in the FE
plugin.tx_aimeos.settings.controller.frontend.common.max-size = 99999
These seem to have a max way below, 1000000000 and 99999.

1)
Still, aimeos won't show all attributes or just don't get the counts right when filtering attributes. (e.g. when filtering attribute [A_1 = a], A_2 -> b shows 2 products whilst there is no product with combination [A_1 = a, A_2 = b]).

2)
Furthermore, when selecting the first attributes-filter the categories is lost even using following setting:
plugin.tx_aimeos.settings.client.html.catalog.filter.tree.force-search = 1

Code: Select all

<input type="hidden" name="<?= $enc->attr( $this->formparam( ['f_catid'] ) ) ?>" value="<?= $enc->attr( $this->param( f_catid' ) ) ?>">
The above input is displayed and filled with right values (before filtering the first attribute).

Related:

Filter attributes within the currect category
help-f15/filtering-when-in-categorie-t489.html
https://github.com/aimeos/aimeos-core/c ... ccf90a7f82

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

Re: Aimeos filtering attributes and categories

Post by aimeos » 28 Sep 2023, 06:33

Doku wrote: 27 Sep 2023, 08:04

Code: Select all

# More filtered produkts in the FE
plugin.tx_aimeos.settings.mshop.common.manager.aggregate.limit = 1000000000
# More filtering attributes in the FE
plugin.tx_aimeos.settings.controller.frontend.common.max-size = 99999
These seem to have a max way below, 1000000000 and 99999.

Still, aimeos won't show all attributes or just don't get the counts right when filtering attributes. (e.g. when filtering attribute [A_1 = a], A_2 -> b shows 2 products whilst there is no product with combination [A_1 = a, A_2 = b]).
There's a hard limit in the SQL statement of 10,000 for counting, so you have to overwrite it too:
https://github.com/aimeos/aimeos-core/b ... ex.php#L79
Doku wrote: 27 Sep 2023, 08:04 Furthermore, when selecting the first attributes-filter the categories is lost even using following setting:
plugin.tx_aimeos.settings.client.html.catalog.filter.tree.force-search = 1

Code: Select all

<input type="hidden" name="<?= $enc->attr( $this->formparam( ['f_catid'] ) ) ?>" value="<?= $enc->attr( $this->param( f_catid' ) ) ?>">
The above input is displayed and filled with right values (before filtering the first attribute).
This should work because of:
- https://github.com/aimeos/ai-client-htm ... hp#L64-L72
- https://github.com/aimeos/ai-client-htm ... d.php#L269

Can you check if the f_catid value is used in the catalog/lists component?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Doku
Posts: 2
Joined: 27 Sep 2023, 07:41

Re: Aimeos filtering attributes and categories

Post by Doku » 04 Oct 2023, 08:37

aimeos wrote: 28 Sep 2023, 06:33 This should work because of:
- https://github.com/aimeos/ai-client-htm ... hp#L64-L72
- https://github.com/aimeos/ai-client-htm ... d.php#L269

Can you check if the f_catid value is used in the catalog/lists component?

Code: Select all

<input type="hidden" name="ai[f_catid]" value="25">

Code: Select all

<input type="hidden" name="ai[f_name]" value="ALPINA">

These are set correctly. But once I apply a filter based on an attribute, the category information is lost.
(The URL seems to miss this Information as well: [...]?ai%5Bf_attrid%5D%5B%5D=1452)

Code: Select all

<input type="hidden" name="ai[f_catid]" value>

Code: Select all

<input type="hidden" name="ai[f_name]" value>

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

Re: Aimeos filtering attributes and categories

Post by aimeos » 05 Oct 2023, 09:34

Do you use catalog/tree and catalog/attribute as separately plugins instead of the catalog/filter plugin? The catalog/attribute template doesn't contain the f_catid and f_name values as hidden input values and thus, the information is lost. You can add the hidden inputs in a copy of your catalog/attribute-body.php template to make it work for your case.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply