Table of Contents

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 ProductViewModel
unitId string
stocklocationId long

Returns

bool

GetBomConfiguration(ProductViewModel)

public static BomConfigurationViewModel GetBomConfiguration(this ProductViewModel productViewModel)

Parameters

productViewModel ProductViewModel

Returns

BomConfigurationViewModel

GetPrice(ProductViewModel)

public static PriceInfoViewModel GetPrice(this ProductViewModel productViewModel)

Parameters

productViewModel ProductViewModel

Returns

PriceInfoViewModel

GetPrice(ProductViewModel, string)

public static PriceInfoViewModel GetPrice(this ProductViewModel productViewModel, string unitId)

Parameters

productViewModel ProductViewModel
unitId string

Returns

PriceInfoViewModel

GetPrice(ProductViewModel, string, long)

public static PriceInfoViewModel GetPrice(this ProductViewModel productViewModel, string unitId, long stockLocationId)

Parameters

productViewModel ProductViewModel
unitId string
stockLocationId long

Returns

PriceInfoViewModel

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 ProductViewModel
groupSystemNames IEnumerable<string>
hideZeroValues bool

Returns

IEnumerable<FieldGroupViewModel>

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 ProductViewModel

The product to create the link for

pageId int

The 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

string

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

IEnumerable<ProductViewModel>

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 ProductViewModel

The product we want to check

orderContextId string

The order context used to find the cart

Returns

bool

VariantCombinations(ProductViewModel)

public static List<string> VariantCombinations(this ProductViewModel productViewModel)

Parameters

productViewModel ProductViewModel

Returns

List<string>

VariantGroups(ProductViewModel)

public static List<VariantGroupViewModel> VariantGroups(this ProductViewModel productViewModel)

Parameters

productViewModel ProductViewModel

Returns

List<VariantGroupViewModel>
To top