Show minimum to maximum price range on product page
From AbleCommerce Wiki
Show minimum to maximum price range on product page
For example you have a product let's say T-Shirt with three different sizes Small, Medium, Large. Every size has a different price. Now on product display page you want the customer to see a price range showing minimum available price to maximum available price.
This customization considers that you are using one option with product. This customization will not handle tax inclusive price display, no variants considerations and no kitting handling.
- Edit your website/conlib/utility/ProductPrice.ascx.cs file and locate following line of code
else { Price.Text = string.Format(_PriceFormat, priceWithVAT); }
and update it as below
else { LSDecimal maxPrice = 0; foreach(ProductOption po in _Product.ProductOptions) { foreach (OptionChoice oc in po.Option.Choices) { if (oc.PriceModifier > maxPrice) maxPrice = oc.PriceModifier; } } if (_Product.ProductOptions.Count > 0) Price.Text = string.Format(_PriceFormat, _Product.Price)+string.Format(" - {0}",_Product.Price+maxPrice); else Price.Text = string.Format(_PriceFormat, priceWithVAT); }
- Now create a Product with one option and then when adding its option choices specify price modifiers for each choice. Finally open the product page from retail side to see the changes.