Change category product sorting

115 views
Skip to first unread message

Stephen Phillips

unread,
May 17, 2021, 12:24:45 PM5/17/21
to XMPie Interest Group
Ideally we want to display the newest items in any category at the top for 30 days then the others older than 30 days are sorted alphabetically.

Thoughts?

couch

unread,
May 17, 2021, 7:11:40 PM5/17/21
to XMPie Interest Group
uStore backoffice does not provide any control over the sorting the products if you are using NG themes. In the old legacy mode, you could choose between date or alphabetical sorting of the products (but still not a combination of both).

If you are interested in developing your own custom theme, then you, or a web developer, could create the scenario you describe.

Stephen Phillips

unread,
May 18, 2021, 9:11:14 AM5/18/21
to XMPie Interest Group
I do use a custom theme. I was going to dig into but any direction on where to start looking first would be great.



 Stephen Phillips
 Senior Web Developer

415 Spence Lane  | Nashville, TN 37210
615-361-7118 Phone  |  615-399-0157 Fax
ste...@nashvilleprinting.com  |   www.nashvilleprinting.com

We Value your feedback! Please take a moment to tell us how we are doing. 

Click Here to leave us a review.



--
You received this message because you are subscribed to the Google Groups "XMPie Interest Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xmpie-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xmpie-users/78d0451d-d2b4-4b8e-91dc-2c90c85056b3n%40googlegroups.com.

west-digital.fr

unread,
May 18, 2021, 10:05:32 AM5/18/21
to XMPie Interest Group
In my understanding, the product list is generated by "src/route/Category.js" - see around "ScrollableGallery title={galleryTitle}".
However, the component it uses ("src/core-components/ScrollableGallery.js") may also be used by other components or routes, so any hard change applied here could have some unwanted side effects on the rest of the application.
Maybe you want to duplicate "ScrollableGallery.js" into your own "ScrollableGalleryWithSmartSort", apply your changes there, then call the new component from Category.js?

Stephen Phillips

unread,
May 18, 2021, 2:15:57 PM5/18/21
to XMPie Interest Group
True, just not seeing where it gets the order from anywhere.

couch

unread,
May 18, 2021, 6:42:06 PM5/18/21
to XMPie Interest Group
By default the UI simply lists the products in the order that is passed by the REST API (and can be seen using react/redux browser dev tools). In the theme code, you will see it is simply displayed with: .map(model)
If you do some google searches you will find it is possible for react to dynamically sort and/or filter the array of objects before the .map().

Stephen Phillips

unread,
May 19, 2021, 10:27:52 AM5/19/21
to XMPie Interest Group
Thank you. I'll look into it. New to react.




 Stephen Phillips
 Senior Web Developer

415 Spence Lane  | Nashville, TN 37210
615-361-7118 Phone  |  615-399-0157 Fax
ste...@nashvilleprinting.com  |   www.nashvilleprinting.com

We Value your feedback! Please take a moment to tell us how we are doing. 

Click Here to leave us a review.


Stephen Phillips

unread,
May 19, 2021, 1:52:48 PM5/19/21
to XMPie Interest Group
Looking at model using Redux it does not appear the products in the category have any field to denote date created.




 Stephen Phillips
 Senior Web Developer

415 Spence Lane  | Nashville, TN 37210
615-361-7118 Phone  |  615-399-0157 Fax
ste...@nashvilleprinting.com  |   www.nashvilleprinting.com

We Value your feedback! Please take a moment to tell us how we are doing. 

Click Here to leave us a review.


On Tue, May 18, 2021 at 5:42 PM couch <sco...@gmail.com> wrote:

couch

unread,
May 19, 2021, 6:26:38 PM5/19/21
to XMPie Interest Group
Bummer! - In that case your task is more complicated. You will need to build a REST API to deliver the required product information to the page. 
The alternative is to log a feature request to XMPie to include this data OOTB, which of course may take some time to be implemented.

Wayne Butcher

unread,
May 20, 2021, 2:52:54 AM5/20/21
to xmpie...@googlegroups.com
Alternatively you could apply the sorting required in the SQL Stored Procedure used by uStoreWebAPI to list products.

Regards,
Wayne
Reply all
Reply to author
Forward
0 new messages