TransWikia.com

Views + Search API not properly sorting by Commerce Price (seems random)

Drupal Answers Asked by quantumized on October 26, 2021

I have a search index View of product variations. The commerce_price field is indexed and exposed as sort option. However, when sorting by the price it appears mostly in order (Asc or Desc) but some items are not in the proper order (see screenshot)

I’ve tried indexing the price field as an integer, decimal, and string but it always has the same effect.

There are no additional sort items.
There are not any price adjustments or custom calculations.
There is no custom code affecting the Views or pricing.
I’ve tried wiping and rebuilding the index multiple times.
The View is using Better Exposed Filters.

Any ideas how I can get the products to sort by price correctly?

enter image description here

enter image description here

enter image description here

One Answer

Resolved. Not sure exactly what is/was going on but the price sorting is now working. There was another identically named commerce price field in Views. Adding that field and removing the first one fixed the issue. I know, something unusual appears to be going on but at least the sorting is working now.

Answered by quantumized on October 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP