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
my solution is:
- Fields Tab: in Related Fields section add Product-Price multi field
- Field sTab: check field_product:commerce_price:amount_decimal for index (integer)
- Filters Tab: enable aggregated fields.
- Filters Tab: add aggregated field: name - your custom label, type of aggregation - first, Contained fields - Price > Amount (decimal)
- Fields Tab: check your new aggregated field for index (integer)
- 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.
-
-
what exactly doesn't work? in my project this solution works fine– fantomCommented Apr 29, 2014 at 10:10