2 Replies Latest reply on Feb 16, 2017 1:08 AM by Eworks-WSI

    Sort products by weight then by name - HOW???

    Elle Zirwanda Level 1

      Hello, I am a total novice at liquid but surely i should be able to sort my e-commerce products by weight then by name?

      I want all the products to display in alpha order, but I want to force the first 6 "popular" items to the top.

      As far as I can tell I can sort by weight OR sort by name. Anyone?

      My dev solved this by having two lists - but they show in separate rows, they don't run on.

        • 1. Re: Sort products by weight then by name - HOW???
          Liam Dilley Adobe Community Professional & MVP

          You running a custom module_data output here or an eCommerce module or the default product listing in the eCommerce overalllayout?

          • 2. Re: Sort products by weight then by name - HOW???
            Eworks-WSI Level 2

            You can achieve this with the tag {tag_productlist,4,,24,,true,} in the Online Shop overall layout.

             

            The BC documentation does not mention it (yet), but the products can be sorted by

            • weight
            • name
            • price
            • releasedate
            • expirydate
            • date

            both ascending (asc)or descending (desc)

             

            Overall-product-layout-productlist.png

             

            Now if you do not specify the sort type (or insert an invalid argument) the products are displayed in alphabetical order but do respect their weighting:

            All products with a weight first (in weighted order), then all others in alphabetical order.

             

            If you specify 'name' as sort type they will be sorted in alphabetical order but not respecting their weighting.

             

            Example here: Livres pour adultes

            The Méditerranée moderne book has a weight of 100 (displayed first), all other books have no weight (displayed in alphabetical order).

             

            labal-sort.png

            Hope it helps