Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
You running a custom module_data output here or an eCommerce module or the default product listing in the eCommerce overalllayout?
Copy link to clipboard
Copied
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
both ascending (asc)or descending (desc)
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).
Hope it helps