Posted on 18/02/2026 14:45:08
Hi Jelle
In Swift-v2_ProductPrice.cshtml it should already be supported. The product contains a variantinfo that holds that information:
string? priceMin = product?.VariantInfo?.PriceMin?.PriceFormatted;
string? priceMax = product?.VariantInfo?.PriceMax?.PriceFormatted;
string price = !string.IsNullOrEmpty(unitId) ? product.GetPrice(unitId).Price.PriceFormatted : product?.Price.PriceFormatted;
price = priceMin != priceMax ? price = priceMin + " - " + priceMax : price;
The 'price' variable is the one we render.
The product viewmodel it self contains a sub viewmodel called variantinfo where you can drill down to the variants of a product - e.g. Color, material and sizes. It is a tree structure - the variantinfo contains information about the minimum or maxprice further down the tree. E.g. the cheapest and most expensive variant of a t-shirt will be on the top variantinfo sitting on the product viewmodel. Drilling further down you can get the cheapest/most expensive of the green t-shirt and the same for the red t-shirt - given that green and red t-shirts comes in different sizes or e.g. materials where the price differes. Hope that makes sense...