Class ProductService
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
public class ProductService : ICacheStorage<ProductKey, Product>, ICacheStorage<ProductKey>, ICacheStorage
- Inheritance
-
ProductService
- Implements
- Inherited Members
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 virtual 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 virtual void AddRelatedProduct(Product product, Product productToRelate, ProductRelatedGroup relatedProductGroup)
Parameters
productProductproductToRelateProductrelatedProductGroupProductRelatedGroup
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 virtual void AddRelatedProduct(string productId, Product relatedProduct, ProductRelatedGroup relatedProductGroup)
Parameters
productIdstringrelatedProductProductrelatedProductGroupProductRelatedGroup
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 virtual void AddVariantGroup(Product product, VariantGroup variantGroup)
Parameters
productProductvariantGroupVariantGroupThe VariantGroup object.
AreProductsTheSame(Product, Product)
public virtual bool AreProductsTheSame(Product product1, Product product2)
Parameters
Returns
ClearCache()
Resets all keys to the default value for objects stored in the object cache
public virtual void ClearCache()
ClearCache(ProductKey)
Resets the specified key to the default value for objects stored in the object cache
public virtual void ClearCache(ProductKey key)
Parameters
keyProductKeyKey to reset
ClearCache(IEnumerable<ProductKey>)
Resets the specified keys to the default value for objects stored in the object cache
public virtual void ClearCache(IEnumerable<ProductKey> keys)
Parameters
keysIEnumerable<ProductKey>Keys to reset
Clone(Product)
Clones the specified product.
public virtual Product Clone(Product product)
Parameters
productProductThe product.
Returns
Clone(Product, bool)
Clones the specified product.
public virtual Product Clone(Product product, bool forceCopyCategoryValues)
Parameters
productProductThe product.
forceCopyCategoryValuesboolSpecifies whether or not product clone should be filled with source product category field values
Returns
Delete(IEnumerable<string>)
Deletes all.
public virtual string Delete(IEnumerable<string> ids)
Parameters
idsIEnumerable<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 virtual void Delete(string productId, string variantId, string languageId)
Parameters
Exceptions
- ArgumentException
If Product does not exist in the database.
DeleteMasterProductByProductKey(ProductKey, string)
Takes two list of product keys to delete - one for all master products and one for all variants products. Iterates over master productkey collection first then variants, only deleting variants that does not belong to one of the master products already deleted.
public virtual bool DeleteMasterProductByProductKey(ProductKey masterProductKey, string defaultLanguageId)
Parameters
masterProductKeyProductKeyProductkey relating to the chosen master products
defaultLanguageIdstring
Returns
DeleteVariantByProductKey(ProductKey, IEnumerable<ProductKey>)
Continues with the flow of deleting the variant variantProductKey if the master product id is not found
in the masterProductKeysToBeDeleted collection and therefor is already deleted.
public virtual void DeleteVariantByProductKey(ProductKey variantProductKey, IEnumerable<ProductKey> masterProductKeysToBeDeleted)
Parameters
variantProductKeyProductKeymasterProductKeysToBeDeletedIEnumerable<ProductKey>
DeleteVariants(string, string)
Deletes the specified variant from all language layers.
public virtual void DeleteVariants(string productId, string productVariantId)
Parameters
productIdstringDB field name is ProductID.
productVariantIdstringDB field name is ProductVariantID.
DeleteVariantsByProductIdAndVariantIds(string, ICollection<string>)
Deletes both the variant and the variant combinations if the variantIds is not null or empty.
public virtual void DeleteVariantsByProductIdAndVariantIds(string productId, ICollection<string> variantIds)
Parameters
productIdstringvariantIdsICollection<string>Collection of variant ids to be deleted
GetActiveProducts(string, bool)
Gets the active products.
public virtual IEnumerable<Product> GetActiveProducts(string productLanguageId, bool useAssortments)
Parameters
productLanguageIdstringThe language ID to use.
useAssortmentsboolIf set to
trueassortments are used to filter products.
Returns
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 virtual IEnumerable<Product> GetAllProductsByShopId(string shopId, bool useAssortments)
Parameters
shopIdstringDB field name is ShopGroupShopID.
useAssortmentsboolIf set to
trueassortments are used to filter products.
Returns
GetByAutoIDs(IList<long>)
public virtual IEnumerable<Product> GetByAutoIDs(IList<long> autoIDs)
Parameters
Returns
GetByProductIDs(string[], bool, string, bool, bool)
public virtual 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 virtual IEnumerable<Product> GetByProductIDsAndVariantIDs(List<Tuple<string, string>> idCombinations, IEnumerable<string> productLanguageIds, bool doRefactoring, bool useAssortments)
Parameters
idCombinationsList<Tuple<string, string>>productLanguageIdsIEnumerable<string>doRefactoringbooluseAssortmentsbool
Returns
GetByProductIDsAndVariantIDs(List<Tuple<string, string>>, string, bool, bool)
public virtual IEnumerable<Product> GetByProductIDsAndVariantIDs(List<Tuple<string, string>> idCombinations, string productLanguageId, bool doRefactoring, bool useAssortments)
Parameters
idCombinationsList<Tuple<string, string>>productLanguageIdstringdoRefactoringbooluseAssortmentsbool
Returns
GetCommandBuilderConditionPartForIds(IEnumerable<Product>)
Gets the condition part of a SQL statement.
public virtual CommandBuilder GetCommandBuilderConditionPartForIds(IEnumerable<Product> products)
Parameters
productsIEnumerable<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 virtual CommandBuilder GetCommandBuilderConditionPartForIds(IEnumerable<string> ids)
Parameters
idsIEnumerable<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 virtual int GetCountOfAllProductsWithoutVariants()
Returns
GetFieldValue(Product, ProductField)
Gets the product field value.
public virtual ApplicationResponse<object> GetFieldValue(Product product, ProductField field)
Parameters
productProductfieldProductField
Returns
GetLastActiveProducts(int, string, bool)
Gets the last active products.
public virtual IEnumerable<Product> GetLastActiveProducts(int count, string productLanguageId, bool useAssortments)
Parameters
countintSelect top from selected items.
productLanguageIdstringThe language ID to use.
useAssortmentsboolIf set to
trueassortments are used to filter products.
Returns
GetLastActiveProducts(int, string[], string, bool)
Gets the last active products. Context.LanguageID is used.
public virtual IEnumerable<Product> GetLastActiveProducts(int count, string[] groupIds, string productLanguageId, bool useAssortments)
Parameters
countintSelect top from selected items.
groupIdsstring[]The array of group IDs.
productLanguageIdstringThe language ID to use.
useAssortmentsboolIf set to
trueassortments are used to filter products.
Returns
GetLatestTenCreatedProducts()
Gets a list of the latest products by time created.
public virtual IEnumerable<Product> GetLatestTenCreatedProducts()
Returns
- IEnumerable<Product>
Products ten latest products created.
GetLatestTenUpdatedProducts()
Gets a list of the latest products by time updated.
public virtual IEnumerable<Product> GetLatestTenUpdatedProducts()
Returns
- IEnumerable<Product>
Products ten latest products update.
GetPagedProductsByVariantGroup(VariantGroup, int, int)
Gets the products portion limited by page size.
public virtual IEnumerable<Product> GetPagedProductsByVariantGroup(VariantGroup variantGroup, int pageNumber, int pageSize)
Parameters
variantGroupVariantGroupThe VariantGroup object.
pageNumberintpageSizeint
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 virtual 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
productsIEnumerable<Product>The collection to be filled with products.
groupIdsstringThe groupIds of products
searchValuestringThe text search
languageIdstringThe languageId
orderBystringThe order by column name
orderByDirectionstringThe order by direction
pageSizeintThe size of paged results
pageNumberintThe page number of paged result
searchInAllFieldsboolThe value indicating whether to search through all fields
shopTypeShopType?The value indicating whether to get products only from PIM. If set to nothing result contains all - from PIM and from Ecom.
includeOrphanedProductsboolThe value indicating whether to get product not related to any group.
includeVariantsboolThe value indicating whether to include variant products together with master products.
Returns
GetProductByExternalIdAndExternalVariantId(string, string, string)
Gets the product by external id and external variant id.
public virtual Product GetProductByExternalIdAndExternalVariantId(string productExternalId, string productExternalVariantId, string productLanguageId)
Parameters
productExternalIdstringProduct external id.
productExternalVariantIdstringProduct external variant id.
productLanguageIdstringThe language id.
Returns
- Product
Product with the given external ids or null if products with the given external ids cannot be found.
GetProductById(string, string, bool)
Gets the product by ID.
public virtual Product GetProductById(string productId, string productVariantId, bool useDefaultLanguage)
Parameters
productIdstringThe product ID.
productVariantIdstringThe variant ID.
useDefaultLanguageboolif set to
true[use default language].
Returns
GetProductById(string, string, string)
Gets the product by ID.
public virtual Product GetProductById(string productId, string productVariantId, string productLanguageId)
Parameters
productIdstringThe product ID.
productVariantIdstringThe variant ID.
productLanguageIdstringThe 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 virtual Product GetProductById(string productId, string productVariantId, string productLanguageId, User user)
Parameters
productIdstringThe product ID.
productVariantIdstringThe variant ID.
productLanguageIdstringThe language ID.
userUserUser 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 virtual Product GetProductById(string productId, string productVariantId, string productLanguageId, bool useAssortments)
Parameters
productIdstringThe product ID.
productVariantIdstringThe variant ID.
productLanguageIdstringThe language ID.
useAssortmentsboolIf set to
trueuse 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 virtual Product GetProductById(string productId, string productVariantId, string productLanguageId, int userId)
Parameters
productIdstringThe product ID.
productVariantIdstringThe variant ID.
productLanguageIdstringThe language ID.
userIdintUser 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 virtual 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 virtual int GetProductCountByVariantGroup(VariantGroup variantGroup)
Parameters
variantGroupVariantGroup
Returns
GetProductFieldValue(Product, string)
Gets the product field value.
public virtual object GetProductFieldValue(Product product, string productFieldSystemName)
Parameters
productProductproductFieldSystemNamestringSystemName of the ProductField.
Returns
Exceptions
- ArgumentException
If not ProductField or ProductFieldValue exist based on the given SystemName.
GetProductKeysByProductIds(IEnumerable<string>)
public virtual IEnumerable<ProductKey> GetProductKeysByProductIds(IEnumerable<string> productIds)
Parameters
productIdsIEnumerable<string>
Returns
GetProductsAndVariantsByProduct(Product)
Gets the all products and variants with the same product ID and language ID as the given product.
public virtual IEnumerable<Product> GetProductsAndVariantsByProduct(Product product)
Parameters
productProductThe product.
Returns
GetProductsByGroup(Group, string, bool)
Gets the products from group.
public virtual IEnumerable<Product> GetProductsByGroup(Group group, string productLanguageId, bool useAssortments)
Parameters
groupGroupThe group.
productLanguageIdstringThe language ID.
useAssortmentsboolIf set to
trueassortments are used to filter products.
Returns
GetProductsByGroupId(string, bool, bool, string, bool, bool)
Gets the products.
public virtual IEnumerable<Product> GetProductsByGroupId(string groupId, bool useOrderBy, bool includeVariants, string productLanguageId, bool doRefactoring, bool useAssortments)
Parameters
groupIdstringThe group ID.
useOrderByboolif set to
truethe returned collection of product is sorted by the user defined sort order. If set tofalsethe products are returned unsorted.includeVariantsboolif set to
truegets all variants.productLanguageIdstringThe language ID.
doRefactoringboolif set to
trueremove unused products.useAssortmentsboolIf set to
trueassortments are used to filter collection.
Returns
GetProductsByGroupId(string, bool, string, bool)
Gets the product collection based on Group ID.
public virtual IEnumerable<Product> GetProductsByGroupId(string groupId, bool onlyActive, string productLanguageId, bool useAssortments)
Parameters
groupIdstringThe group ID.
onlyActiveboolif set to
trueremoves not active items from collection.productLanguageIdstringThe language ID to use.
useAssortmentsboolIf set to
trueassortments are used to filter the collection.
Returns
GetProductsByGroupId(string, int, bool, string, bool)
Gets the products. Context.LanguageID is used.
public virtual IEnumerable<Product> GetProductsByGroupId(string groupId, int top, bool doRefactoring, string productLanguageId, bool useAssortments)
Parameters
groupIdstringThe group ID.
topintIf not 0 then select only top from selected items.
doRefactoringboolif set to
trueremoves not used items.productLanguageIdstringThe language ID to use.
useAssortmentsboolIf set to
trueassortments are use to filter the collection.
Returns
GetProductsByGroupIdAndSearchValue(string, string, string, string)
Gets the products. Context.LanguageID is used.
public virtual IEnumerable<Product> GetProductsByGroupIdAndSearchValue(string groupId, string topValue, string searchValue, string productVariantId)
Parameters
groupIdstringThe group ID.
topValuestringThe top value.
searchValuestringThe search value.
productVariantIdstringThe variant ID.
Returns
GetProductsByGroupIdAndSearchValue(string, string, string, string, bool)
Gets the products. Context.LanguageID is used.
public virtual IEnumerable<Product> GetProductsByGroupIdAndSearchValue(string groupId, string topValue, string searchValue, string productVariantId, bool isFrontend)
Parameters
groupIdstringThe group ID.
topValuestringThe top value, i.e. the number of products to get.
searchValuestringThe search value.
productVariantIdstringThe variant ID.
isFrontendboolif set to
trueremoves not used items.
Returns
GetProductsByGroupIdAndSearchValue(string, string, string, string, bool, string)
Gets the products.
public virtual IEnumerable<Product> GetProductsByGroupIdAndSearchValue(string groupId, string topValue, string searchValue, string productVariantId, bool isFrontend, string productLanguageId)
Parameters
groupIdstringThe group ID.
topValuestringThe top value, i.e. the number of products to get.
searchValuestringThe search value.
productVariantIdstringThe variant ID.
isFrontendboolif set to
trueremoves not used items.productLanguageIdstringThe language ID to use.
Returns
GetProductsByGroupIdAndSearchValue(string, string, string, string, bool, string, bool)
Gets the products.
public virtual IEnumerable<Product> GetProductsByGroupIdAndSearchValue(string groupId, string topValue, string searchValue, string productVariantId, bool isFrontend, string productLanguageId, bool useAssortments)
Parameters
groupIdstringThe group ID.
topValuestringThe top value, i.e. the number of products to get.
searchValuestringThe search value.
productVariantIdstringThe variant ID.
isFrontendboolif set to
trueremoves not used items.productLanguageIdstringThe language ID to use.
useAssortmentsboolIf set to
trueassortments are used to filter collection.
Returns
GetProductsByGroups(GroupCollection, string, bool, bool)
Gets the products from groups.
public virtual IEnumerable<Product> GetProductsByGroups(GroupCollection groups, string productLanguageId, bool isFrontEnd, bool useAssortments)
Parameters
groupsGroupCollectionThe groups.
productLanguageIdstringThe language ID.
isFrontEndboolif set to
trueremoves not used items.useAssortmentsboolIf set to
trueassortments are used to filter products.
Returns
GetProductsByKeys(IEnumerable<ProductKey>)
public virtual IEnumerable<Product> GetProductsByKeys(IEnumerable<ProductKey> productKeys)
Parameters
productKeysIEnumerable<ProductKey>
Returns
GetProductsByNumber(string, string)
Gets a list of products by number.
public virtual 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 virtual IEnumerable<Product> GetProductsByProductAndVariantId(Product product, string productVariantId)
Parameters
Returns
GetProductsBySKU(string)
Gets products by SKU: product id or product number.
public virtual IEnumerable<Product> GetProductsBySKU(string productsSKU)
Parameters
productsSKUstringThe 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 virtual ProductSearchResult GetProductsBySearch(ProductSearchFilter searchFilter)
Parameters
searchFilterProductSearchFilter
Returns
GetProductsByShopId(string, string, bool)
Gets products from shop.
public virtual IEnumerable<Product> GetProductsByShopId(string shopId, string productLanguageId, bool useAssortments)
Parameters
shopIdstringDB field name is ShopGroupShopID.
productLanguageIdstringThe language ID to use.
useAssortmentsboolIf set to
trueassortments are used to filter products.
Returns
GetProductsByVariantGroup(VariantGroup)
Gets the products.
public virtual IEnumerable<Product> GetProductsByVariantGroup(VariantGroup variantGroup)
Parameters
variantGroupVariantGroupThe VariantGroup object.
Returns
GetProductsCountByGroupId(string, bool, string, string, bool, bool)
Gets the products count.
public virtual int GetProductsCountByGroupId(string groupId, bool countOnlyActive, string searchValue, string productLanguageId, bool includeVariants, bool doRefactoring)
Parameters
groupIdstringThe group ID.
countOnlyActiveboolif set to
truecount only active products.searchValuestringThe search value.
productLanguageIdstringThe language ID.
includeVariantsboolif set to
truegets all variants.doRefactoringboolif set to
trueremove unused products.
Returns
GetProductsCountByGroupId(string, string, string, bool, bool)
Gets the products count.
public virtual int GetProductsCountByGroupId(string groupId, string searchValue, string productLanguageId, bool includeVariants, bool doRefactoring)
Parameters
groupIdstringThe group ID.
searchValuestringThe search value.
productLanguageIdstringThe language ID.
includeVariantsboolif set to
truegets all variants.doRefactoringboolif set to
trueremove unused products.
Returns
GetPropertyValue(Product, string)
Gets the property value.
public virtual object GetPropertyValue(Product product, string propertyName)
Parameters
Returns
GetRelatedCountFrontend(Product, Currency, Country, StockLocation, User)
public virtual int GetRelatedCountFrontend(Product product, Currency currency, Country country, StockLocation stockLocation, User user)
Parameters
productProductcurrencyCurrencycountryCountrystockLocationStockLocationuserUser
Returns
GetVariantsByKey(ProductKey)
public virtual IEnumerable<Product> GetVariantsByKey(ProductKey productKey)
Parameters
productKeyProductKey
Returns
IsVariantMaster(Product)
Gets the value that indicates if the variant is a master.
public virtual bool IsVariantMaster(Product product)
Parameters
productProduct
Returns
MakeFullCopyToGroup(Product, string)
Makes a clone of the product and all its relations (except group relations) and saves it in the DB.
public virtual 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 virtual 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 virtual IEnumerable<string> MakeFullCopyToGroupWithLanguage(IEnumerable<ProductKey> productAndLanguageIds, string groupId, bool copyGroupRelations)
Parameters
productAndLanguageIdsIEnumerable<ProductKey>Product ID and Language ID collection.
groupIdstringThe target group ID.
copyGroupRelationsbool
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 virtual string MakeFullCopyToGroupWithLanguage(string productId, string groupId, string productLanguageId, string newProductId)
Parameters
productIdstringThe product ID.
groupIdstringThe target group ID.
productLanguageIdstringThe language ID.
newProductIdstringThe 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 virtual string MakeFullCopyToGroupWithLanguage(string productId, string groupId, string productLanguageId, string newProductId, bool copyGroupRelations)
Parameters
productIdstringThe product ID.
groupIdstringThe target group ID.
productLanguageIdstringThe language ID.
newProductIdstringThe new Product ID.
copyGroupRelationsbool
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 virtual void RemoveGroup(Product product, Group group)
Parameters
RemoveVariantGroup(Product, VariantGroup)
Removes the variant group by object reference.
public virtual void RemoveVariantGroup(Product product, VariantGroup variantGroup)
Parameters
productProductvariantGroupVariantGroupThe VariantGroup object.
RemoveVariantGroupLoop(Product, VariantGroup)
Removes the variant group by ID, LanguageID, Label and Name.
public virtual void RemoveVariantGroupLoop(Product product, VariantGroup variantGroup)
Parameters
productProductvariantGroupVariantGroupThe VariantGroup object.
Save(Product)
Saves this instance.
public virtual void Save(Product product)
Parameters
productProduct
Save(Product, bool)
Saves this instance.
public virtual void Save(Product product, bool skipExtendedSave)
Parameters
productProductskipExtendedSaveboolIf true; Extended Save of the Product is skipped. Default is false.
Save(Product, string, string)
Saves this instance.
public virtual void Save(Product product, string productId, string productVariantId)
Parameters
Save(Product, string, string, bool)
Saves this instance.
public virtual void Save(Product product, string productId, string productVariantId, bool skipExtendedSave)
Parameters
productProductproductIdstringThe product ID.
productVariantIdstringThe product variant ID.
skipExtendedSaveboolIf true; Extended Save of the Product is skipped. Default is false.
Save(Product, string, string, string)
Saves this instance.
public virtual void Save(Product product, string productId, string productVariantId, string productLanguageId)
Parameters
productProductproductIdstringThe product ID.
productVariantIdstringThe product variant ID.
productLanguageIdstringThe product language ID.
Save(Product, string, string, string, bool)
Saves this instance.
public virtual void Save(Product product, string productId, string productVariantId, string productLanguageId, bool skipExtendedSave)
Parameters
productProductproductIdstringThe product ID.
productVariantIdstringThe product variant ID.
productLanguageIdstringThe product language ID.
skipExtendedSaveboolIf true; Extended Save of the Product is skipped. Default is false.
SaveAndConfirm(Product, string, string)
Saves this instance and confirms it.
public virtual bool SaveAndConfirm(Product product, string productId, string productVariantId)
Parameters
productProductproductIdstringDB field name is ProductID.
productVariantIdstringDB field name is ProductVariantID.
Returns
SaveAndConfirm(Product, string, string, bool)
Saves this instance and confirms it.
public virtual bool SaveAndConfirm(Product product, string productId, string productVariantId, bool skipExtendedSave)
Parameters
productProductproductIdstringThe product ID.
productVariantIdstringThe product variant ID.
skipExtendedSaveboolIf true; Extended Save of the Product is skipped. Default is false.
Returns
SaveAndConfirm(Product, string, string, string)
Saves this instance and confirms it.
public virtual bool SaveAndConfirm(Product product, string productId, string productVariantId, string productLanguageId)
Parameters
productProductproductIdstringThe product ID.
productVariantIdstringThe product variant ID.
productLanguageIdstringThe product language ID.
Returns
SaveAndConfirm(Product, string, string, string, bool)
Saves this instance and confirms it.
public virtual bool SaveAndConfirm(Product product, string productId, string productVariantId, string productLanguageId, bool skipExtendedSave)
Parameters
productProductproductIdstringThe product ID.
productVariantIdstringThe product variant ID.
productLanguageIdstringThe product language ID.
skipExtendedSaveboolIf true; Extended Save of the Product is skipped. Default is false.
Returns
SaveFieldValuesForProducts(IEnumerable<ProductKey>, ProductField, object)
public virtual void SaveFieldValuesForProducts(IEnumerable<ProductKey> productKeys, ProductField productField, object fieldValue)
Parameters
productKeysIEnumerable<ProductKey>productFieldProductFieldfieldValueobject
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 virtual void SetDefaultProductFields(Product product)
Parameters
productProduct
SetFieldValue(Product, ProductField, object)
Sets the product field value.
public virtual void SetFieldValue(Product product, ProductField field, object value)
Parameters
productProductfieldProductFieldvalueobject
SetProductFieldValue(Product, string, object)
Gets the product field value.
public virtual void SetProductFieldValue(Product product, string productFieldSystemName, object value)
Parameters
productProductproductFieldSystemNamestringSystemName of the ProductField.
valueobjectThe 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 virtual int UpdateDefaultVariantId(Product product, string variantComboId)
Parameters
Returns
UpdatePriceCount(Product, int)
Updates the price counter.
public virtual int UpdatePriceCount(Product product, int priceCount)
Parameters
Returns
UpdateUnitCount(Product, int)
Updates the unit counter.
public virtual int UpdateUnitCount(Product product, int unitCount)
Parameters
Returns
UpdateVariantId(Product, string)
Updates the products variant ID.
public virtual int UpdateVariantId(Product product, string newVariantId)