Backend Categories Productlist Sort

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!
randomdennis
Posts: 38
Joined: 10 Oct 2024, 12:51

Backend Categories Productlist Sort

Post by randomdennis » 30 Apr 2025, 12:37

Hello, in the past you could sort the products or search for specific words via the table header, has this been permanently removed?
Image

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.

Image

In which controller are the items added to the productlist.php/where can I adjust the sorting?

Thank you for your Time.

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

Re: Backend Categories Productlist Sort

Post by aimeos » 30 Apr 2025, 21:26

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, Image give us a star

randomdennis
Posts: 38
Joined: 10 Oct 2024, 12:51

Re: Backend Categories Productlist Sort

Post by randomdennis » 05 May 2025, 10:46

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?
Last edited by randomdennis on 07 May 2025, 13:29, edited 2 times in total.

randomdennis
Posts: 38
Joined: 10 Oct 2024, 12:51

Re: Backend Categories Productlist Sort

Post by randomdennis » 07 May 2025, 13:28

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 + `) {
	

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

Re: Backend Categories Productlist Sort

Post by aimeos » 07 May 2025, 15:58

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, Image give us a star

Post Reply