1

Actually I want to do the same behaviour as in commerce kickstart 2 for sorting my products by price. I'm using search api, search api db, search api sorts, search api ranges, commerce search api modules. I have created indexed node view with views and it is working fine. I can range nodes by price... I indexed the field "field_tshirt_commerce_price_amount_decimal_asc" with my node (my product type is called tshirt). And I want to see it in my sorts, but it just writes "There are currently no fields for which sorts can be displayed." Am I missing something?

1 Answer 1

2

my solution is:

  1. Fields Tab: in Related Fields section add Product-Price multi field
  2. Field sTab: check field_product:commerce_price:amount_decimal for index (integer)
  3. Filters Tab: enable aggregated fields.
  4. Filters Tab: add aggregated field: name - your custom label, type of aggregation - first, Contained fields - Price > Amount (decimal)
  5. Fields Tab: check your new aggregated field for index (integer)
  6. Sorts Tab: now your custom aggregated field available for sort

Be sure you are using latest dev version of the Search API sorts because of the https://drupal.org/node/2202093 issue.

2
  • I followed your steps and it still doesn't work...
    – Saulius
    Commented Apr 24, 2014 at 20:31
  • what exactly doesn't work? in my project this solution works fine
    – fantom
    Commented Apr 29, 2014 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.