• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

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

New Here ,
Feb 14, 2017 Feb 14, 2017

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.

TOPICS
Newbie Corner

Views

398

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 15, 2017 Feb 15, 2017

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 16, 2017 Feb 16, 2017

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines