Table of Contents

Class ProductService

Namespace
Dynamicweb.Ecommerce.Products
Assembly
Dynamicweb.Ecommerce.dll
public class ProductService : ICacheStorage<ProductKey, Product>, ICacheStorage<ProductKey>, ICacheStorage
Inheritance
ProductService
Implements
Inherited Members

Constructors

ProductService()

public ProductService()

Methods

AddGroup(Product, Group)

Adds the group to the products Groups collection. Also creates the ProductGroupRelation in the database if it does not already exist and group.ID is exists.

public void AddGroup(Product product, Group group)

Parameters

product Product
group Group

The group.

AddRelatedProduct(Product, Product, ProductRelatedGroup)

Adds a related product to this product and saves it to the database.

public void AddRelatedProduct(Product product, Product productToRelate, ProductRelatedGroup relatedProductGroup)

Parameters

product Product
productToRelate Product
relatedProductGroup ProductRelatedGroup

Exceptions

ArgumentException

If this instance is not saved first.

ArgumentException

If the related product is not saved first.

ArgumentException

If the relation group is not saved first.

AddRelatedProduct(string, Product, ProductRelatedGroup)

Adds a related product to this product and saves it to the database.

public void AddRelatedProduct(string productId, Product relatedProduct, ProductRelatedGroup relatedProductGroup)

Parameters

productId string
relatedProduct Product
relatedProductGroup ProductRelatedGroup

Exceptions

ArgumentException

If this instance is not saved first.

ArgumentException

If the related product is not saved first.

ArgumentException

If the relation group is not saved first.

AddVariantGroup(Product, VariantGroup)

Adds the variant group.

public void AddVariantGroup(Product product, VariantGroup variantGroup)

Parameters

product Product
variantGroup VariantGroup

The VariantGroup object.

AreProductsTheSame(Product, Product)

public bool AreProductsTheSame(Product product1, Product product2)

Parameters

product1 Product
product2 Product

Returns

bool

ClearCache()

Resets all keys to the default value for objects stored in the object cache

public void ClearCache()

ClearCache(ProductKey)

Resets the specified key to the default value for objects stored in the object cache

public void ClearCache(ProductKey key)

Parameters

key ProductKey

Key to reset

ClearCache(IEnumerable<ProductKey>)

Resets the specified keys to the default value for objects stored in the object cache

public void ClearCache(IEnumerable<ProductKey> keys)

Parameters

keys IEnumerable<ProductKey>

Keys to reset

Clone(Product)

Clones the specified product.

public Product Clone(Product product)

Parameters

product Product

The product.

Returns

Product

Clone(Product, bool)

Clones the specified product.

public Product Clone(Product product, bool forceCopyCategoryValues)

Parameters

product Product

The product.

forceCopyCategoryValues bool

Specifies whether or not product clone should be filled with source product category field values

Returns

Product

Delete(IEnumerable<string>)

Deletes all.

public string Delete(IEnumerable<string> ids)

Parameters

ids IEnumerable<string>

The list of IDs.

Returns

string

The SQL query

Delete(string, string, string)

Deletes this Product. If this instance is a Variant or a specific language version, then only this instance is deleted. Requires the product to be in the Database or exception is thrown.

public void Delete(string productId, string variantId, string languageId)

Parameters

productId string
variantId string
languageId string

Exceptions

ArgumentException

If Product does not exist in the database.

DeleteVariants(string, string)

Deletes the specified variant from all language layers.

public void DeleteVariants(string productId, string productVariantId)

Parameters

productId string

DB field name is ProductID.

productVariantId string

DB field name is ProductVariantID.

GetActiveProducts(string, bool)

Gets the active products.

public IEnumerable<Product> GetActiveProducts(string productLanguageId, bool useAssortments)

Parameters

productLanguageId string

The language ID to use.

useAssortments bool

If set to true assortments are used to filter products.

Returns

IEnumerable<Product>

GetAllProductVersions(string)

Gets all versions for the product include versions for any variants and any versions.

public IEnumerable<VersionData> GetAllProductVersions(string productId)

Parameters

productId string

The product ID.

Returns

IEnumerable<VersionData>

The collection of the VersionData.

GetAllProductsByShopId(string, bool)

Gets all products from shop. No language filter is applied meaning all language version of all products in the shop are returned.

public IEnumerable<Product> GetAllProductsByShopId(string shopId, bool useAssortments)

Parameters

shopId string

DB field name is ShopGroupShopID.

useAssortments bool

If set to true assortments are used to filter products.

Returns

IEnumerable<Product>

GetByAutoIDs(IList<long>)

public IEnumerable<Product> GetByAutoIDs(IList<long> autoIDs)

Parameters

autoIDs IList<long>

Returns

IEnumerable<Product>

GetByProductIDs(string[], bool, string, bool, bool)

public IEnumerable<Product> GetByProductIDs(string[] productIds, bool doRefactoring, string productLanguageId, bool bulkFill, bool useAssortments)

Parameters

productIds string[]
doRefactoring bool
productLanguageId string
bulkFill bool
useAssortments bool

Returns

IEnumerable<Product>

GetByProductIDsAndVariantIDs(List<Tuple<string, string>>, IEnumerable<string>, bool, bool)

public IEnumerable<Product> GetByProductIDsAndVariantIDs(List<Tuple<string, string>> idCombinations, IEnumerable<string> productLanguageIds, bool doRefactoring, bool useAssortments)

Parameters

idCombinations List<Tuple<string, string>>
productLanguageIds IEnumerable<string>
doRefactoring bool
useAssortments bool

Returns

IEnumerable<Product>

GetByProductIDsAndVariantIDs(List<Tuple<string, string>>, string, bool, bool)

public IEnumerable<Product> GetByProductIDsAndVariantIDs(List<Tuple<string, string>> idCombinations, string productLanguageId, bool doRefactoring, bool useAssortments)

Parameters

idCombinations List<Tuple<string, string>>
productLanguageId string
doRefactoring bool
useAssortments bool

Returns

IEnumerable<Product>

GetCommandBuilderConditionPartForIds(IEnumerable<Product>)

Gets the condition part of a SQL statement.

public CommandBuilder GetCommandBuilderConditionPartForIds(IEnumerable<Product> products)

Parameters

products IEnumerable<Product>

The products.

Returns

CommandBuilder

The condition part of a SQL statement based on the given products

GetCommandBuilderConditionPartForIds(IEnumerable<string>)

Gets the condition part of a SQL statement.

public CommandBuilder GetCommandBuilderConditionPartForIds(IEnumerable<string> ids)

Parameters

ids IEnumerable<string>

The ID or IDs. Multiple IDs must be separated by ', ' or ','.

Returns

CommandBuilder

The condition part of a SQL statement based on the given ID or IDs

GetCountOfAllProductsWithoutVariants()

public int GetCountOfAllProductsWithoutVariants()

Returns

int

GetFieldValue(Product, ProductField)

Gets the product field value.

public ApplicationResponse<object> GetFieldValue(Product product, ProductField field)

Parameters

product Product
field ProductField

Returns

ApplicationResponse<object>

GetLastActiveProducts(int, string, bool)

Gets the last active products.

public IEnumerable<Product> GetLastActiveProducts(int count, string productLanguageId, bool useAssortments)

Parameters

count int

Select top from selected items.

productLanguageId string

The language ID to use.

useAssortments bool

If set to true assortments are used to filter products.

Returns

IEnumerable<Product>

GetLastActiveProducts(int, string[], string, bool)

Gets the last active products. Context.LanguageID is used.

public IEnumerable<Product> GetLastActiveProducts(int count, string[] groupIds, string productLanguageId, bool useAssortments)

Parameters

count int

Select top from selected items.

groupIds string[]

The array of group IDs.

productLanguageId string

The language ID to use.

useAssortments bool

If set to true assortments are used to filter products.

Returns

IEnumerable<Product>

GetLatestTenCreatedProducts()

Gets a list of the latest products by time created.

public IEnumerable<Product> GetLatestTenCreatedProducts()

Returns

IEnumerable<Product>

Products ten latest products created.

GetLatestTenUpdatedProducts()

Gets a list of the latest products by time updated.

public IEnumerable<Product> GetLatestTenUpdatedProducts()

Returns

IEnumerable<Product>

Products ten latest products update.

GetPagedProductsByVariantGroup(VariantGroup, int, int)

Gets the products portion limited by page size.

public IEnumerable<Product> GetPagedProductsByVariantGroup(VariantGroup variantGroup, int pageNumber, int pageSize)

Parameters

variantGroup VariantGroup

The VariantGroup object.

pageNumber int
pageSize int

Returns

IEnumerable<Product>

GetPagedProductsWithCount(ref IEnumerable<Product>, string, string, string, string, string, int, int, bool, ShopType?, bool, bool)

Fills the product collection with specified page of results and return the total results count

public int GetPagedProductsWithCount(ref IEnumerable<Product> products, string groupIds, string searchValue, string languageId, string orderBy, string orderByDirection, int pageSize, int pageNumber, bool searchInAllFields, ShopType? shopType, bool includeOrphanedProducts, bool includeVariants)

Parameters

products IEnumerable<Product>

The collection to be filled with products.

groupIds string

The groupIds of products

searchValue string

The text search

languageId string

The languageId

orderBy string

The order by column name

orderByDirection string

The order by direction

pageSize int

The size of paged results

pageNumber int

The page number of paged result

searchInAllFields bool

The value indicating whether to search through all fields

shopType ShopType?

The value indicating whether to get products only from PIM. If set to nothing result contains all - from PIM and from Ecom.

includeOrphanedProducts bool

The value indicating whether to get product not related to any group.

includeVariants bool

The value indicating whether to include variant products together with master products.

Returns

int

GetProductById(string, string, bool)

Gets the product by ID.

public Product GetProductById(string productId, string productVariantId, bool useDefaultLanguage)

Parameters

productId string

The product ID.

productVariantId string

The variant ID.

useDefaultLanguage bool

if set to true [use default language].

Returns

Product

GetProductById(string, string, string)

Gets the product by ID.

public Product GetProductById(string productId, string productVariantId, string productLanguageId)

Parameters

productId string

The product ID.

productVariantId string

The variant ID.

productLanguageId string

The language ID.

Returns

Product

Remarks

When specified product with variant id and language not equal Common.Context.LanguageID not found returns product with variant id from Common.Context.LanguageID

GetProductById(string, string, string, User)

Gets the product by ID.

public Product GetProductById(string productId, string productVariantId, string productLanguageId, User user)

Parameters

productId string

The product ID.

productVariantId string

The variant ID.

productLanguageId string

The language ID.

user User

User that needs access to the product

Returns

Product

Remarks

When specified product with variant id and language not equal Common.Context.LanguageID not found returns product with variant id from Common.Context.LanguageID

GetProductById(string, string, string, bool)

Gets the product by ID.

public Product GetProductById(string productId, string productVariantId, string productLanguageId, bool useAssortments)

Parameters

productId string

The product ID.

productVariantId string

The variant ID.

productLanguageId string

The language ID.

useAssortments bool

If set to true use assortments.

Returns

Product

Remarks

When specified product with variant id and language not equal Common.Context.LanguageID not found returns product with variant id from Common.Context.LanguageID

GetProductById(string, string, string, int)

Gets the product by ID.

public Product GetProductById(string productId, string productVariantId, string productLanguageId, int userId)

Parameters

productId string

The product ID.

productVariantId string

The variant ID.

productLanguageId string

The language ID.

userId int

User id that needs access to the product

Returns

Product

Remarks

When specified product with variant id and language not equal Common.Context.LanguageID not found returns product with variant id from Common.Context.LanguageID

GetProductByNumber(string, string)

Gets the product by number.

public Product GetProductByNumber(string productNumber, string productLanguageId)

Parameters

productNumber string

Product number.

productLanguageId string

The language ID.

Returns

Product

Product with the given number or null (Nothing in Visual Basic) if product with the given number cannot be found.

GetProductCountByVariantGroup(VariantGroup)

public int GetProductCountByVariantGroup(VariantGroup variantGroup)

Parameters

variantGroup VariantGroup

Returns

int

GetProductFieldValue(Product, string)

Gets the product field value.

public object GetProductFieldValue(Product product, string productFieldSystemName)

Parameters

product Product
productFieldSystemName string

SystemName of the ProductField.

Returns

object

Exceptions

ArgumentException

If not ProductField or ProductFieldValue exist based on the given SystemName.

GetProductKeysByProductIds(IEnumerable<string>)

public IEnumerable<ProductKey> GetProductKeysByProductIds(IEnumerable<string> productIds)

Parameters

productIds IEnumerable<string>

Returns

IEnumerable<ProductKey>

GetProductsAndVariantsByProduct(Product)

Gets the all products and variants with the same product ID and language ID as the given product.

public IEnumerable<Product> GetProductsAndVariantsByProduct(Product product)

Parameters

product Product

The product.

Returns

IEnumerable<Product>

GetProductsByGroup(Group, string, bool)

Gets the products from group.

public IEnumerable<Product> GetProductsByGroup(Group group, string productLanguageId, bool useAssortments)

Parameters

group Group

The group.

productLanguageId string

The language ID.

useAssortments bool

If set to true assortments are used to filter products.

Returns

IEnumerable<Product>

GetProductsByGroupId(string, bool, bool, string, bool, bool)

Gets the products.

public IEnumerable<Product> GetProductsByGroupId(string groupId, bool useOrderBy, bool includeVariants, string productLanguageId, bool doRefactoring, bool useAssortments)

Parameters

groupId string

The group ID.

useOrderBy bool

if set to true the returned collection of product is sorted by the user defined sort order. If set to false the products are returned unsorted.

includeVariants bool

if set to true gets all variants.

productLanguageId string

The language ID.

doRefactoring bool

if set to true remove unused products.

useAssortments bool

If set to true assortments are used to filter collection.

Returns

IEnumerable<Product>

GetProductsByGroupId(string, bool, string, bool)

Gets the product collection based on Group ID.

public IEnumerable<Product> GetProductsByGroupId(string groupId, bool onlyActive, string productLanguageId, bool useAssortments)

Parameters

groupId string

The group ID.

onlyActive bool

if set to true removes not active items from collection.

productLanguageId string

The language ID to use.

useAssortments bool

If set to true assortments are used to filter the collection.

Returns

IEnumerable<Product>

GetProductsByGroupId(string, int, bool, string, bool)

Gets the products. Context.LanguageID is used.

public IEnumerable<Product> GetProductsByGroupId(string groupId, int top, bool doRefactoring, string productLanguageId, bool useAssortments)

Parameters

groupId string

The group ID.

top int

If not 0 then select only top from selected items.

doRefactoring bool

if set to true removes not used items.

productLanguageId string

The language ID to use.

useAssortments bool

If set to true assortments are use to filter the collection.

Returns

IEnumerable<Product>

GetProductsByGroupIdAndSearchValue(string, string, string, string)

Gets the products. Context.LanguageID is used.

public IEnumerable<Product> GetProductsByGroupIdAndSearchValue(string groupId, string topValue, string searchValue, string productVariantId)

Parameters

groupId string

The group ID.

topValue string

The top value.

searchValue string

The search value.

productVariantId string

The variant ID.

Returns

IEnumerable<Product>

GetProductsByGroupIdAndSearchValue(string, string, string, string, bool)

Gets the products. Context.LanguageID is used.

public IEnumerable<Product> GetProductsByGroupIdAndSearchValue(string groupId, string topValue, string searchValue, string productVariantId, bool isFrontend)

Parameters

groupId string

The group ID.

topValue string

The top value, i.e. the number of products to get.

searchValue string

The search value.

productVariantId string

The variant ID.

isFrontend bool

if set to true removes not used items.

Returns

IEnumerable<Product>

GetProductsByGroupIdAndSearchValue(string, string, string, string, bool, string)

Gets the products.

public IEnumerable<Product> GetProductsByGroupIdAndSearchValue(string groupId, string topValue, string searchValue, string productVariantId, bool isFrontend, string productLanguageId)

Parameters

groupId string

The group ID.

topValue string

The top value, i.e. the number of products to get.

searchValue string

The search value.

productVariantId string

The variant ID.

isFrontend bool

if set to true removes not used items.

productLanguageId string

The language ID to use.

Returns

IEnumerable<Product>

GetProductsByGroupIdAndSearchValue(string, string, string, string, bool, string, bool)

Gets the products.

public IEnumerable<Product> GetProductsByGroupIdAndSearchValue(string groupId, string topValue, string searchValue, string productVariantId, bool isFrontend, string productLanguageId, bool useAssortments)

Parameters

groupId string

The group ID.

topValue string

The top value, i.e. the number of products to get.

searchValue string

The search value.

productVariantId string

The variant ID.

isFrontend bool

if set to true removes not used items.

productLanguageId string

The language ID to use.

useAssortments bool

If set to true assortments are used to filter collection.

Returns

IEnumerable<Product>

GetProductsByGroups(GroupCollection, string, bool, bool)

Gets the products from groups.

public IEnumerable<Product> GetProductsByGroups(GroupCollection groups, string productLanguageId, bool isFrontEnd, bool useAssortments)

Parameters

groups GroupCollection

The groups.

productLanguageId string

The language ID.

isFrontEnd bool

if set to true removes not used items.

useAssortments bool

If set to true assortments are used to filter products.

Returns

IEnumerable<Product>

GetProductsByKeys(IEnumerable<ProductKey>)

public IEnumerable<Product> GetProductsByKeys(IEnumerable<ProductKey> productKeys)

Parameters

productKeys IEnumerable<ProductKey>

Returns

IEnumerable<Product>

GetProductsByNumber(string, string)

Gets a list of products by number.

public IEnumerable<Product> GetProductsByNumber(string productNumber, string productLanguageId)

Parameters

productNumber string

Product number.

productLanguageId string

The language ID.

Returns

IEnumerable<Product>

Products with the given number or null if products with the given number cannot be found.

GetProductsByProductAndVariantId(Product, string)

Gets the products.

public IEnumerable<Product> GetProductsByProductAndVariantId(Product product, string productVariantId)

Parameters

product Product

The product.

productVariantId string

The variant ID.

Returns

IEnumerable<Product>

GetProductsBySKU(string)

Gets products by SKU: product id or product number.

public IEnumerable<Product> GetProductsBySKU(string productsSKU)

Parameters

productsSKU string

The line with product SKUs, which are separated from each other by any of the following characters: " " (space), "," (comma), ";" (semicolon), or new line symbol.

Returns

IEnumerable<Product>

GetProductsBySearch(ProductSearchFilter)

public ProductSearchResult GetProductsBySearch(ProductSearchFilter searchFilter)

Parameters

searchFilter ProductSearchFilter

Returns

ProductSearchResult

GetProductsByShopId(string, string, bool)

Gets products from shop.

public IEnumerable<Product> GetProductsByShopId(string shopId, string productLanguageId, bool useAssortments)

Parameters

shopId string

DB field name is ShopGroupShopID.

productLanguageId string

The language ID to use.

useAssortments bool

If set to true assortments are used to filter products.

Returns

IEnumerable<Product>

GetProductsByVariantGroup(VariantGroup)

Gets the products.

public IEnumerable<Product> GetProductsByVariantGroup(VariantGroup variantGroup)

Parameters

variantGroup VariantGroup

The VariantGroup object.

Returns

IEnumerable<Product>

GetProductsCountByGroupId(string, bool, string, string, bool, bool)

Gets the products count.

public int GetProductsCountByGroupId(string groupId, bool countOnlyActive, string searchValue, string productLanguageId, bool includeVariants, bool doRefactoring)

Parameters

groupId string

The group ID.

countOnlyActive bool

if set to true count only active products.

searchValue string

The search value.

productLanguageId string

The language ID.

includeVariants bool

if set to true gets all variants.

doRefactoring bool

if set to true remove unused products.

Returns

int

GetProductsCountByGroupId(string, string, string, bool, bool)

Gets the products count.

public int GetProductsCountByGroupId(string groupId, string searchValue, string productLanguageId, bool includeVariants, bool doRefactoring)

Parameters

groupId string

The group ID.

searchValue string

The search value.

productLanguageId string

The language ID.

includeVariants bool

if set to true gets all variants.

doRefactoring bool

if set to true remove unused products.

Returns

int

GetPropertyValue(Product, string)

Gets the property value.

public object GetPropertyValue(Product product, string propertyName)

Parameters

product Product
propertyName string

Name of the property.

Returns

object

GetRelatedCountFrontend(Product, Currency, Country, StockLocation, User)

public int GetRelatedCountFrontend(Product product, Currency currency, Country country, StockLocation stockLocation, User user)

Parameters

product Product
currency Currency
country Country
stockLocation StockLocation
user User

Returns

int

GetVariantsByKey(ProductKey)

public virtual IEnumerable<Product> GetVariantsByKey(ProductKey productKey)

Parameters

productKey ProductKey

Returns

IEnumerable<Product>

GetVersionProduct(VersionData)

Gets product which stored in versionData.

public Product GetVersionProduct(VersionData version)

Parameters

version VersionData

The version.

Returns

Product

The draft product.

IsVariantMaster(Product)

Gets the value that indicates if the variant is a master.

public bool IsVariantMaster(Product product)

Parameters

product Product

Returns

bool

MakeFullCopyToGroup(Product, string)

Makes a clone of the product and all its relations (except group relations) and saves it in the DB.

public void MakeFullCopyToGroup(Product product, string groupId)

Parameters

product Product

The product.

groupId string

The target group ID.

MakeFullCopyToGroup(string, string)

Makes a clone of the product and all its relations (except group relations) and saves it in the DB.

public void MakeFullCopyToGroup(string productId, string groupId)

Parameters

productId string

The product ID.

groupId string

The target group ID.

MakeFullCopyToGroupWithLanguage(IEnumerable<ProductKey>, string, bool)

Makes a clone of the products and all those relations for specified languages and saves it in the DB.

public IEnumerable<string> MakeFullCopyToGroupWithLanguage(IEnumerable<ProductKey> productAndLanguageIds, string groupId, bool copyGroupRelations)

Parameters

productAndLanguageIds IEnumerable<ProductKey>

Product ID and Language ID collection.

groupId string

The target group ID.

copyGroupRelations bool

Returns

IEnumerable<string>

The collection of new Product IDs.

MakeFullCopyToGroupWithLanguage(string, string, string, string)

Makes a clone of the product and all its relations (except group relations) for specified languages and saves it in the DB.

public string MakeFullCopyToGroupWithLanguage(string productId, string groupId, string productLanguageId, string newProductId)

Parameters

productId string

The product ID.

groupId string

The target group ID.

productLanguageId string

The language ID.

newProductId string

The new Product ID.

Returns

string

The new Product ID.

MakeFullCopyToGroupWithLanguage(string, string, string, string, bool)

Makes a clone of the product and all its relations for specified languages and saves it in the DB.

public string MakeFullCopyToGroupWithLanguage(string productId, string groupId, string productLanguageId, string newProductId, bool copyGroupRelations)

Parameters

productId string

The product ID.

groupId string

The target group ID.

productLanguageId string

The language ID.

newProductId string

The new Product ID.

copyGroupRelations bool

Returns

string

The new Product ID.

RemoveGroup(Product, Group)

Removes the group from the products Groups collection. Also deletes the ProductGroupRelation from the database if group.ID exists.

public void RemoveGroup(Product product, Group group)

Parameters

product Product
group Group

The group.

RemoveVariantGroup(Product, VariantGroup)

Removes the variant group by object reference.

public void RemoveVariantGroup(Product product, VariantGroup variantGroup)

Parameters

product Product
variantGroup VariantGroup

The VariantGroup object.

RemoveVariantGroupLoop(Product, VariantGroup)

Removes the variant group by ID, LanguageID, Label and Name.

public void RemoveVariantGroupLoop(Product product, VariantGroup variantGroup)

Parameters

product Product
variantGroup VariantGroup

The VariantGroup object.

Save(Product)

Saves this instance.

public void Save(Product product)

Parameters

product Product

Save(Product, bool)

Saves this instance.

public void Save(Product product, bool skipExtendedSave)

Parameters

product Product
skipExtendedSave bool

If true; Extended Save of the Product is skipped. Default is false.

Save(Product, string, string)

Saves this instance.

public void Save(Product product, string productId, string productVariantId)

Parameters

product Product
productId string

The product ID.

productVariantId string

The product variant ID.

Save(Product, string, string, bool)

Saves this instance.

public void Save(Product product, string productId, string productVariantId, bool skipExtendedSave)

Parameters

product Product
productId string

The product ID.

productVariantId string

The product variant ID.

skipExtendedSave bool

If true; Extended Save of the Product is skipped. Default is false.

Save(Product, string, string, string)

Saves this instance.

public void Save(Product product, string productId, string productVariantId, string productLanguageId)

Parameters

product Product
productId string

The product ID.

productVariantId string

The product variant ID.

productLanguageId string

The product language ID.

Save(Product, string, string, string, bool)

Saves this instance.

public void Save(Product product, string productId, string productVariantId, string productLanguageId, bool skipExtendedSave)

Parameters

product Product
productId string

The product ID.

productVariantId string

The product variant ID.

productLanguageId string

The product language ID.

skipExtendedSave bool

If true; Extended Save of the Product is skipped. Default is false.

SaveAndConfirm(Product, string, string)

Saves this instance and confirms it.

public bool SaveAndConfirm(Product product, string productId, string productVariantId)

Parameters

product Product
productId string

DB field name is ProductID.

productVariantId string

DB field name is ProductVariantID.

Returns

bool

SaveAndConfirm(Product, string, string, bool)

Saves this instance and confirms it.

public bool SaveAndConfirm(Product product, string productId, string productVariantId, bool skipExtendedSave)

Parameters

product Product
productId string

The product ID.

productVariantId string

The product variant ID.

skipExtendedSave bool

If true; Extended Save of the Product is skipped. Default is false.

Returns

bool

SaveAndConfirm(Product, string, string, string)

Saves this instance and confirms it.

public bool SaveAndConfirm(Product product, string productId, string productVariantId, string productLanguageId)

Parameters

product Product
productId string

The product ID.

productVariantId string

The product variant ID.

productLanguageId string

The product language ID.

Returns

bool

SaveAndConfirm(Product, string, string, string, bool)

Saves this instance and confirms it.

public bool SaveAndConfirm(Product product, string productId, string productVariantId, string productLanguageId, bool skipExtendedSave)

Parameters

product Product
productId string

The product ID.

productVariantId string

The product variant ID.

productLanguageId string

The product language ID.

skipExtendedSave bool

If true; Extended Save of the Product is skipped. Default is false.

Returns

bool

SetDefaultProductFields(Product)

Initializes or reinitializes the ProductFieldValues property with all current ProductFields in the system and null values. This method is explicitly called by the constructor.

public void SetDefaultProductFields(Product product)

Parameters

product Product

SetFieldValue(Product, ProductField, object)

Sets the product field value.

public void SetFieldValue(Product product, ProductField field, object value)

Parameters

product Product
field ProductField
value object

SetProductFieldValue(Product, string, object)

Gets the product field value.

public void SetProductFieldValue(Product product, string productFieldSystemName, object value)

Parameters

product Product
productFieldSystemName string

SystemName of the ProductField.

value object

The value to set.

Exceptions

ArgumentException

If not ProductField or ProductFieldValue exist based on the given SystemName.

UpdateDefaultVariantId(Product, string)

Updates the default variant ID.

public int UpdateDefaultVariantId(Product product, string variantComboId)

Parameters

product Product

The product.

variantComboId string

The variant combo ID.

Returns

int

UpdatePriceCount(Product, int)

Updates the price counter.

public int UpdatePriceCount(Product product, int priceCount)

Parameters

product Product

The product.

priceCount int

The price counter.

Returns

int

UpdateUnitCount(Product, int)

Updates the unit counter.

public int UpdateUnitCount(Product product, int unitCount)

Parameters

product Product

The product.

unitCount int

The unit counter.

Returns

int
To top