Class PriceListViewModel
- Namespace
- Dynamicweb.Ecommerce.ProductCatalog
- Assembly
- Dynamicweb.Ecommerce.dll
Represents a single quantity-price tier for a product, enabling volume-discount price tables in Razor templates.
public class PriceListViewModel : FillableViewModelBase
- Inheritance
-
PriceListViewModel
- Inherited Members
- Extension Methods
Remarks
A product's quantity prices are exposed as ProductViewModel.Prices — a list of
PriceListViewModel entries ordered by quantity threshold. For example, a product might have
tiers of 1 unit at $110 and 10 units at $100. Use this to render a pricing table:
@foreach (var tier in Model.Prices)
{
<tr>
<td>@tier.Quantity+</td>
<td>@tier.Price.PriceFormatted</td>
</tr>
}
Properties
Price
Gets or sets the price for this quantity tier, including formatted and VAT variants.
public PriceViewModel? Price { get; set; }
Property Value
Quantity
Gets or sets the minimum quantity at which this price tier applies
(e.g. 10 means the tier price is used when 10 or more units are ordered).
public double Quantity { get; set; }
Property Value
StockLocationId
Gets or sets the stock location ID this tier is associated with.
0 means the tier applies to the default stock location.
public long StockLocationId { get; set; }
Property Value
UnitId
Gets or sets the unit ID this tier applies to (e.g. "pcs").
An empty string means the tier applies to the product's default unit.
public string? UnitId { get; set; }
Property Value
ValidFrom
Gets or sets the start date from which this price tier is valid, or null if it has no start date.
public DateTime? ValidFrom { get; set; }
Property Value
ValidTo
Gets or sets the end date until which this price tier is valid, or null if it has no end date.
public DateTime? ValidTo { get; set; }