You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Adding a additional sort option in product collection page

edited Apr 29, 2021 2:14PM in Commerce 2 comments

Summary

How to add additional sort option based on a sku property in Product Listing Js

Content

Hi,

We have a sort by dropdown with standard sort option Price Low to high and Price High to Low, we need to add additional sort options "Capacity High to Low" which should take value from a sku variant property.

How do we access the sku property to provide in the "id"  field below :

 var sortOptions = [{
          "id": "???",
          "displayText": "Capacity Low to High",
          "order": ko.observable("asc"),
          "maintainSortOrder": true,
          "serverOnly": true
        }]

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!