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
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
ProductproductToRelate
ProductrelatedProductGroup
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
stringrelatedProduct
ProductrelatedProductGroup
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
ProductvariantGroup
VariantGroupThe VariantGroup object.
AreProductsTheSame(Product, Product)
public bool AreProductsTheSame(Product product1, Product product2)
Parameters
Returns
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
ProductKeyKey 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
ProductThe product.
Returns
Clone(Product, bool)
Clones the specified product.
public Product Clone(Product product, bool forceCopyCategoryValues)
Parameters
product
ProductThe product.
forceCopyCategoryValues
boolSpecifies whether or not product clone should be filled with source product category field values
Returns
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
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
stringDB field name is ProductID.
productVariantId
stringDB field name is ProductVariantID.
GetActiveProducts(string, bool)
Gets the active products.
public IEnumerable<Product> GetActiveProducts(string productLanguageId, bool useAssortments)
Parameters
productLanguageId
stringThe language ID to use.
useAssortments
boolIf set to
true
assortments are used to filter products.
Returns
GetAllProductVersions(string)
Gets all versions for the product include versions for any variants and any versions.
public IEnumerable<VersionData> GetAllProductVersions(string productId)
Parameters
productId
stringThe 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
stringDB field name is ShopGroupShopID.
useAssortments
boolIf set to
true
assortments are used to filter products.
Returns
GetByAutoIDs(IList<long>)
public IEnumerable<Product> GetByAutoIDs(IList<long> autoIDs)
Parameters
Returns
GetByProductIDs(string[], bool, string, bool, bool)
public IEnumerable<Product> GetByProductIDs(string[] productIds, bool doRefactoring, string productLanguageId, bool bulkFill, bool useAssortments)
Parameters
Returns
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
booluseAssortments
bool
Returns
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
stringdoRefactoring
booluseAssortments
bool
Returns
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
GetFieldValue(Product, ProductField)
Gets the product field value.
public ApplicationResponse<object> GetFieldValue(Product product, ProductField field)
Parameters
product
Productfield
ProductField
Returns
GetLastActiveProducts(int, string, bool)
Gets the last active products.
public IEnumerable<Product> GetLastActiveProducts(int count, string productLanguageId, bool useAssortments)
Parameters
count
intSelect top from selected items.
productLanguageId
stringThe language ID to use.
useAssortments
boolIf set to
true
assortments are used to filter products.
Returns
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
intSelect top from selected items.
groupIds
string[]The array of group IDs.
productLanguageId
stringThe language ID to use.
useAssortments
boolIf set to
true
assortments are used to filter products.
Returns
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
VariantGroupThe VariantGroup object.
pageNumber
intpageSize
int
Returns
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
stringThe groupIds of products
searchValue
stringThe text search
languageId
stringThe languageId
orderBy
stringThe order by column name
orderByDirection
stringThe order by direction
pageSize
intThe size of paged results
pageNumber
intThe page number of paged result
searchInAllFields
boolThe 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
boolThe value indicating whether to get product not related to any group.
includeVariants
boolThe value indicating whether to include variant products together with master products.
Returns
GetProductById(string, string, bool)
Gets the product by ID.
public Product GetProductById(string productId, string productVariantId, bool useDefaultLanguage)
Parameters
productId
stringThe product ID.
productVariantId
stringThe variant ID.
useDefaultLanguage
boolif set to
true
[use default language].
Returns
GetProductById(string, string, string)
Gets the product by ID.
public Product GetProductById(string productId, string productVariantId, string productLanguageId)
Parameters
productId
stringThe product ID.
productVariantId
stringThe variant ID.
productLanguageId
stringThe language ID.
Returns
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
stringThe product ID.
productVariantId
stringThe variant ID.
productLanguageId
stringThe language ID.
user
UserUser that needs access to the product
Returns
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
stringThe product ID.
productVariantId
stringThe variant ID.
productLanguageId
stringThe language ID.
useAssortments
boolIf set to
true
use assortments.
Returns
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
stringThe product ID.
productVariantId
stringThe variant ID.
productLanguageId
stringThe language ID.
userId
intUser id that needs access to the product
Returns
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
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
GetProductFieldValue(Product, string)
Gets the product field value.
public object GetProductFieldValue(Product product, string productFieldSystemName)
Parameters
product
ProductproductFieldSystemName
stringSystemName of the ProductField.
Returns
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
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
ProductThe product.
Returns
GetProductsByGroup(Group, string, bool)
Gets the products from group.
public IEnumerable<Product> GetProductsByGroup(Group group, string productLanguageId, bool useAssortments)
Parameters
group
GroupThe group.
productLanguageId
stringThe language ID.
useAssortments
boolIf set to
true
assortments are used to filter products.
Returns
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
stringThe group ID.
useOrderBy
boolif set to
true
the returned collection of product is sorted by the user defined sort order. If set tofalse
the products are returned unsorted.includeVariants
boolif set to
true
gets all variants.productLanguageId
stringThe language ID.
doRefactoring
boolif set to
true
remove unused products.useAssortments
boolIf set to
true
assortments are used to filter collection.
Returns
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
stringThe group ID.
onlyActive
boolif set to
true
removes not active items from collection.productLanguageId
stringThe language ID to use.
useAssortments
boolIf set to
true
assortments are used to filter the collection.
Returns
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
stringThe group ID.
top
intIf not 0 then select only top from selected items.
doRefactoring
boolif set to
true
removes not used items.productLanguageId
stringThe language ID to use.
useAssortments
boolIf set to
true
assortments are use to filter the collection.
Returns
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
stringThe group ID.
topValue
stringThe top value.
searchValue
stringThe search value.
productVariantId
stringThe variant ID.
Returns
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
stringThe group ID.
topValue
stringThe top value, i.e. the number of products to get.
searchValue
stringThe search value.
productVariantId
stringThe variant ID.
isFrontend
boolif set to
true
removes not used items.
Returns
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
stringThe group ID.
topValue
stringThe top value, i.e. the number of products to get.
searchValue
stringThe search value.
productVariantId
stringThe variant ID.
isFrontend
boolif set to
true
removes not used items.productLanguageId
stringThe language ID to use.
Returns
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
stringThe group ID.
topValue
stringThe top value, i.e. the number of products to get.
searchValue
stringThe search value.
productVariantId
stringThe variant ID.
isFrontend
boolif set to
true
removes not used items.productLanguageId
stringThe language ID to use.
useAssortments
boolIf set to
true
assortments are used to filter collection.
Returns
GetProductsByGroups(GroupCollection, string, bool, bool)
Gets the products from groups.
public IEnumerable<Product> GetProductsByGroups(GroupCollection groups, string productLanguageId, bool isFrontEnd, bool useAssortments)
Parameters
groups
GroupCollectionThe groups.
productLanguageId
stringThe language ID.
isFrontEnd
boolif set to
true
removes not used items.useAssortments
boolIf set to
true
assortments are used to filter products.
Returns
GetProductsByKeys(IEnumerable<ProductKey>)
public IEnumerable<Product> GetProductsByKeys(IEnumerable<ProductKey> productKeys)
Parameters
productKeys
IEnumerable<ProductKey>
Returns
GetProductsByNumber(string, string)
Gets a list of products by number.
public IEnumerable<Product> GetProductsByNumber(string productNumber, string productLanguageId)
Parameters
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
Returns
GetProductsBySKU(string)
Gets products by SKU: product id or product number.
public IEnumerable<Product> GetProductsBySKU(string productsSKU)
Parameters
productsSKU
stringThe line with product SKUs, which are separated from each other by any of the following characters: " " (space), "," (comma), ";" (semicolon), or new line symbol.
Returns
GetProductsBySearch(ProductSearchFilter)
public ProductSearchResult GetProductsBySearch(ProductSearchFilter searchFilter)
Parameters
searchFilter
ProductSearchFilter
Returns
GetProductsByShopId(string, string, bool)
Gets products from shop.
public IEnumerable<Product> GetProductsByShopId(string shopId, string productLanguageId, bool useAssortments)
Parameters
shopId
stringDB field name is ShopGroupShopID.
productLanguageId
stringThe language ID to use.
useAssortments
boolIf set to
true
assortments are used to filter products.
Returns
GetProductsByVariantGroup(VariantGroup)
Gets the products.
public IEnumerable<Product> GetProductsByVariantGroup(VariantGroup variantGroup)
Parameters
variantGroup
VariantGroupThe VariantGroup object.
Returns
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
stringThe group ID.
countOnlyActive
boolif set to
true
count only active products.searchValue
stringThe search value.
productLanguageId
stringThe language ID.
includeVariants
boolif set to
true
gets all variants.doRefactoring
boolif set to
true
remove unused products.
Returns
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
stringThe group ID.
searchValue
stringThe search value.
productLanguageId
stringThe language ID.
includeVariants
boolif set to
true
gets all variants.doRefactoring
boolif set to
true
remove unused products.
Returns
GetPropertyValue(Product, string)
Gets the property value.
public object GetPropertyValue(Product product, string propertyName)
Parameters
Returns
GetRelatedCountFrontend(Product, Currency, Country, StockLocation, User)
public int GetRelatedCountFrontend(Product product, Currency currency, Country country, StockLocation stockLocation, User user)
Parameters
product
Productcurrency
Currencycountry
CountrystockLocation
StockLocationuser
User
Returns
GetVariantsByKey(ProductKey)
public virtual IEnumerable<Product> GetVariantsByKey(ProductKey productKey)
Parameters
productKey
ProductKey
Returns
GetVersionProduct(VersionData)
Gets product which stored in versionData.
public Product GetVersionProduct(VersionData version)
Parameters
version
VersionDataThe 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
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
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
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
stringThe 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
stringThe product ID.
groupId
stringThe target group ID.
productLanguageId
stringThe language ID.
newProductId
stringThe 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
stringThe product ID.
groupId
stringThe target group ID.
productLanguageId
stringThe language ID.
newProductId
stringThe 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
RemoveVariantGroup(Product, VariantGroup)
Removes the variant group by object reference.
public void RemoveVariantGroup(Product product, VariantGroup variantGroup)
Parameters
product
ProductvariantGroup
VariantGroupThe VariantGroup object.
RemoveVariantGroupLoop(Product, VariantGroup)
Removes the variant group by ID, LanguageID, Label and Name.
public void RemoveVariantGroupLoop(Product product, VariantGroup variantGroup)
Parameters
product
ProductvariantGroup
VariantGroupThe 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
ProductskipExtendedSave
boolIf 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
Save(Product, string, string, bool)
Saves this instance.
public void Save(Product product, string productId, string productVariantId, bool skipExtendedSave)
Parameters
product
ProductproductId
stringThe product ID.
productVariantId
stringThe product variant ID.
skipExtendedSave
boolIf 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
ProductproductId
stringThe product ID.
productVariantId
stringThe product variant ID.
productLanguageId
stringThe 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
ProductproductId
stringThe product ID.
productVariantId
stringThe product variant ID.
productLanguageId
stringThe product language ID.
skipExtendedSave
boolIf 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
ProductproductId
stringDB field name is ProductID.
productVariantId
stringDB field name is ProductVariantID.
Returns
SaveAndConfirm(Product, string, string, bool)
Saves this instance and confirms it.
public bool SaveAndConfirm(Product product, string productId, string productVariantId, bool skipExtendedSave)
Parameters
product
ProductproductId
stringThe product ID.
productVariantId
stringThe product variant ID.
skipExtendedSave
boolIf true; Extended Save of the Product is skipped. Default is false.
Returns
SaveAndConfirm(Product, string, string, string)
Saves this instance and confirms it.
public bool SaveAndConfirm(Product product, string productId, string productVariantId, string productLanguageId)
Parameters
product
ProductproductId
stringThe product ID.
productVariantId
stringThe product variant ID.
productLanguageId
stringThe product language ID.
Returns
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
ProductproductId
stringThe product ID.
productVariantId
stringThe product variant ID.
productLanguageId
stringThe product language ID.
skipExtendedSave
boolIf true; Extended Save of the Product is skipped. Default is false.
Returns
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
Productfield
ProductFieldvalue
object
SetProductFieldValue(Product, string, object)
Gets the product field value.
public void SetProductFieldValue(Product product, string productFieldSystemName, object value)
Parameters
product
ProductproductFieldSystemName
stringSystemName of the ProductField.
value
objectThe 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
Returns
UpdatePriceCount(Product, int)
Updates the price counter.
public int UpdatePriceCount(Product product, int priceCount)
Parameters
Returns
UpdateUnitCount(Product, int)
Updates the unit counter.
public int UpdateUnitCount(Product product, int unitCount)