Backend Categories Productlist Sort
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!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 38
- Joined: 10 Oct 2024, 12:51
Backend Categories Productlist Sort
Hello, in the past you could sort the products or search for specific words via the table header, has this been permanently removed?

We would like to adjust the sorting, currently the same article comes directly after the promotional article. We would like to have the promotional items first and then simply sorted by count afterwards.

In which controller are the items added to the productlist.php/where can I adjust the sorting?
Thank you for your Time.

We would like to adjust the sorting, currently the same article comes directly after the promotional article. We would like to have the promotional items first and then simply sorted by count afterwards.

In which controller are the items added to the productlist.php/where can I adjust the sorting?
Thank you for your Time.
Re: Backend Categories Productlist Sort
Since we've fixed the catalog product sub-panel to work with document-oriented storage like ElasticSearch too, it's no longer possible to sort the product list by the list items referencing the categories inside the products.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

-
- Posts: 38
- Joined: 10 Oct 2024, 12:51
Re: Backend Categories Productlist Sort
However, if we needed this option, what would be the best option here?
Can we perhaps simply display all products without pagination and add a sorting function for the table using JS?
Can we perhaps simply display all products without pagination and add a sorting function for the table using JS?
Last edited by randomdennis on 07 May 2025, 13:29, edited 2 times in total.
-
- Posts: 38
- Joined: 10 Oct 2024, 12:51
Re: Backend Categories Productlist Sort
I have extended the productlist.js with a sorting function and also use two template loops in the productlist.php to display only promotional items and then standard items afterwards. I have removed pagination for this, removed limit and display all products.
Code: Select all
productlist.php
<!-- Promotion -->
<template v-for="(item, idx) in sortedFilteredLists(items,refid,'promotion')" v-bind:key="idx">
<template
v-for="(litem, index) in (item.lists[domain] || []).filter(l => l.type === 'promotion')"
v-bind:key="index"
>
<!-- Standard -->
<template v-for="(item, idx) in sortedFilteredLists(items,refid,'default')" v-bind:key="idx">
<template
v-for="(litem, index) in (item.lists[domain] || []).filter(l => l.type === 'default')"
v-bind:key="index"
>
<!--nav class="list-page">
<page-offset v-model="offset" v-bind:limit="limit" v-bind:total="total" tabindex="<?= $enc->attr( $this->get( 'tabindex', 1 ) ) ?>"></page-offset>
<page-limit v-model="limit" tabindex="<?= $enc->attr( $this->get( 'tabindex', 1 ) ) ?>"></page-limit>
</nav-->
productlist.js
sortedFilteredLists(items,catid, type) {
var listafter = items.slice().sort((a, b) => {
const entryA = a.lists.catalog.find(x => x.type === type && x.refid === catid);
const entryB = b.lists.catalog.find(x => x.type === type && x.refid === catid);
const posA = entryA ? entryA.position : Number.POSITIVE_INFINITY;
const posB = entryB ? entryB.position : Number.POSITIVE_INFINITY;
return posA - posB;
});
return listafter;
},
searchIndex(filter: ` + JSON.stringify(JSON.stringify(filter)) + `, include: ["` + this.domain + `"], sort: ["sort:index.` + this.domain + `:position()"], offset: ` + this.offset + `, limit: ` + 5000 + `) {
Re: Backend Categories Productlist Sort
Please keep in mind, that only 100 products are loaded by default if you just remove the existing limit and it doesn't work if you have thousands of product in one category.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
