SCENARIO:
- A Size attribute field has been added to a Product Type at /admin/commerce/products/types/PRODUCT-TYPE/fields and "Enable this field to function as an attribute field on Add to Cart forms." option has been checked.
- Two products have been created at admin/commerce/products/add/PRODUCT-TYPE. Size attribute Large at a price of $20 and Small at a price of $10 respectively.
- One Content Type display node has been created at node/add/CONTENT-TYPE. The two sized product variants were attached to the Product Reference field.
- A Search API Index for the product nodes has been created at admin/config/search/search_api/index/PRODUCT-INDEX.
- A Search API - Product Index View has been created at admin/structure/views/add.
- The Size Attribute has been added as an Exposed Filter Criteria to the view. One could also use the Size Facet.
ISSUE:
The filtering works just fine. The issue lies on the product field values displayed, like price for instance, that do not align with the filtering criteria.
Regardless of which size has been applied as filter, the price displayed on the view represents the first product attached to Product Field reference on the product display node.
In our case scenario, the Large size product is first on the list of products attached to the Product Field Reference. If size Small is applied as filter, it displays the price of $20 on the view display. This is troubling because $10 should be displayed instead.
Is there a way to fix it? That is, the price + other product fields will display the variant values accordingly to size attribute being applied as filter?
UPDATE:
This question here addresses the same issue wrapped into a different context.