Class ProductViewModelExtensions
- Namespace
- Dynamicweb.Ecommerce.ProductCatalog
- Assembly
- Dynamicweb.Ecommerce.dll
public static class ProductViewModelExtensions
- Inheritance
-
ProductViewModelExtensions
- Inherited Members
Methods
BackInStockRegisteredForUser(ProductViewModel, string, long)
public static bool BackInStockRegisteredForUser(this ProductViewModel product, string unitId = "", long stocklocationId = 0)
Parameters
product
ProductViewModelunitId
stringstocklocationId
long
Returns
GetBomConfiguration(ProductViewModel)
public static BomConfigurationViewModel GetBomConfiguration(this ProductViewModel productViewModel)
Parameters
productViewModel
ProductViewModel
Returns
GetPrice(ProductViewModel)
public static PriceInfoViewModel GetPrice(this ProductViewModel productViewModel)
Parameters
productViewModel
ProductViewModel
Returns
GetPrice(ProductViewModel, string)
public static PriceInfoViewModel GetPrice(this ProductViewModel productViewModel, string unitId)
Parameters
productViewModel
ProductViewModelunitId
string
Returns
GetPrice(ProductViewModel, string, long)
public static PriceInfoViewModel GetPrice(this ProductViewModel productViewModel, string unitId, long stockLocationId)
Parameters
productViewModel
ProductViewModelunitId
stringstockLocationId
long
Returns
GetProductDisplayGroupFieldsByGroupSystemNames(ProductViewModel, IEnumerable<string>, bool)
Gets product display group models
public static IEnumerable<FieldGroupViewModel> GetProductDisplayGroupFieldsByGroupSystemNames(this ProductViewModel productModel, IEnumerable<string> groupSystemNames, bool hideZeroValues = false)
Parameters
productModel
ProductViewModelgroupSystemNames
IEnumerable<string>hideZeroValues
bool
Returns
GetProductLink(ProductViewModel, int, bool)
Gets the primary link to a given product using its default groupid and that groups primary page id if that is specified - otherwise the specified page id.
public static string GetProductLink(this ProductViewModel product, int pageId, bool usePrimaryGroupPageId = true)
Parameters
product
ProductViewModelThe product to create the link for
pageId
intThe pageid that should be used. If a pageid has been specified on the primary group in this shop that the product belongs to, that id will be used instead of the passed pageid.
usePrimaryGroupPageId
bool
Returns
GetRelatedProducts(ProductViewModel)
Gets a collection of ProductViewModel containing all related products from all related groups
public static IEnumerable<ProductViewModel> GetRelatedProducts(this ProductViewModel product)
Parameters
product
ProductViewModel
Returns
IsProductInCart(ProductViewModel, string)
Indicates wether the current product is placed in the context cart
public static bool IsProductInCart(this ProductViewModel product, string orderContextId = null)
Parameters
product
ProductViewModelThe product we want to check
orderContextId
stringThe order context used to find the cart
Returns
VariantCombinations(ProductViewModel)
public static List<string> VariantCombinations(this ProductViewModel productViewModel)
Parameters
productViewModel
ProductViewModel
Returns
VariantGroups(ProductViewModel)
public static List<VariantGroupViewModel> VariantGroups(this ProductViewModel productViewModel)
Parameters
productViewModel
ProductViewModel