Table of Contents

Class Product

Namespace
Dynamicweb.Ecommerce.Products
Assembly
Dynamicweb.Ecommerce.dll
Represents information about a product.
[Serializable]
public class Product : IWithPrice
Inheritance
Product
Implements
Inherited Members

Examples

using Dynamicweb.Ecommerce.Products;
using Dynamicweb.Rendering;

namespace Dynamicweb.Ecommerce.Examples.Products
{
    class BomConfiguratorSample
    {
        private Template _template;
        private ProductCollection _bomProducts;
        private ProductItemCollection _configurators;
        private Product _product;

        public void SplitBom()
        {
            //### Split BOM items from configurators
            _bomProducts = new ProductCollection();
            _configurators = new ProductItemCollection();
            _product = new Product();
            _template = new Template();

            if (_template.LoopExists("BOMConfigurators") || _template.LoopExists("BOMProducts"))
            {
                foreach (ProductItem item in _product.Items)
                {
                    if (item.BomGroupId == string.Empty)
                    {
                        _bomProducts.Add(item.Products[0]);
                    }
                    else
                    {
                        _configurators.Add(item);
                    }
                }
            }
        }
    }
}

Constructors

Product()

Initializes a new instance of the Product class.
public Product()

Product(IDataReader)

Initializes a new instance of the Product class.
[Obsolete("This method is no longer used.")]
public Product(IDataReader dataReader)

Parameters

dataReader IDataReader

Fields

FormatOperator

Plus or Minus.
public static readonly string[] FormatOperator

Field Value

string[]

Properties

Active

Gets or sets the value that indicates if the product is active or not.
public bool Active { get; set; }

Property Value

bool

ApprovalState

Gets or sets the state of the approval.
public ProductApprovalStateType ApprovalState { get; set; }

Property Value

ProductApprovalStateType
The state of the approval.

AutoId

public long AutoId { get; set; }

Property Value

long

CommentCount

Gets or sets the count of comments.
public int CommentCount { get; set; }

Property Value

int
The count of comments.

Cost

Gets or sets the default cost.
public double Cost { get; set; }

Property Value

double
The default cost.

Created

Gets or sets the date when the product was created.
public DateTime Created { get; set; }

Property Value

DateTime

DefaultGroup

Gets primary or default group
public Group DefaultGroup { get; }

Property Value

Group
Primary or default group

DefaultPoints

Gets or sets product default loyalty reward points
public double DefaultPoints { get; set; }

Property Value

double

DefaultPrice

Gets or sets the default price. This price is a basis for calculating the final price that is displayed in the frontend.
public double DefaultPrice { get; set; }

Property Value

double
The default price.

DefaultShopId

Gets or sets the default shop ID.
public string DefaultShopId { get; set; }

Property Value

string
The default shop ID.

DefaultUnit

Gets the default unit.
public StockUnit DefaultUnit { get; }

Property Value

StockUnit

DefaultUnitId

Gets or sets the default ID of the unit.
public string DefaultUnitId { get; set; }

Property Value

string

DefaultVariantComboId

Gets or sets the default VariantComboID.
public string DefaultVariantComboId { get; set; }

Property Value

string

Depth

Gets or sets product depth
public double Depth { get; set; }

Property Value

double

Remarks

Related field ProductDepth

Details

Gets or sets the detail collection.
public IEnumerable<Detail> Details { get; }

Property Value

IEnumerable<Detail>

Discontinued

Gets or sets value indicating that product is discontinued
public bool Discontinued { get; set; }

Property Value

bool

DiscontinuedAction

Gets or sets discontinued action
public DiscontinuedAction DiscontinuedAction { get; set; }

Property Value

DiscontinuedAction

Discounts

Gets the product discounts collection.
[Obsolete("Sales discount functionality is obsolete. Use GetDiscountMatrix instead.")]
public DiscountCollection Discounts { get; }

Property Value

DiscountCollection
The discounts.

EAN

Gets or sets Product EAN
public string EAN { get; set; }

Property Value

string

Remarks

Related field ProductEAN

ExcludeFromAllProducts

Gets or sets value indicating whether to exclude the product from all products list
public bool ExcludeFromAllProducts { get; set; }

Property Value

bool

ExcludeFromCustomizedUrls

Gets or sets value indicating whether to exclude the product from customized URLs.
public bool ExcludeFromCustomizedUrls { get; set; }

Property Value

bool

ExcludeFromIndex

Gets or sets value indicating whether to exclude the product from indexing.
public bool ExcludeFromIndex { get; set; }

Property Value

bool

ExpectedDelivery

Gets or sets the expected delivery date.
public DateTime ExpectedDelivery { get; set; }

Property Value

DateTime

FormattedInformativePrice

Gets the informative price string in currency format.
[Obsolete("Use PriceFormatted property on the price returned by GetInformativePrice(PriceContext)")]
public string FormattedInformativePrice { get; }

Property Value

string
The formatted informative price.

FormattedMarkup

Gets the markup as a formatted string, like: "10.25%".
public string FormattedMarkup { get; }

Property Value

string

FormattedPrice

Gets the price string in currency format.
[Obsolete("Use PriceFormatted property on the price returned by GetPrice(PriceContext)")]
public string FormattedPrice { get; }

Property Value

string
The formatted price.

Groups

Gets or sets the collection of groups that own the product.
public GroupCollection Groups { get; }

Property Value

GroupCollection

Height

Gets or sets product height
public double Height { get; set; }

Property Value

double

Remarks

Related field ProductHeight

Id

Gets or sets the ID of the product.
public string Id { get; set; }

Property Value

string

IdUrlEncoded

Gets the ID URL encoded.
[Obsolete("Use System.Net.WebUtility.UrlEncode(Id) instead.")]
public string IdUrlEncoded { get; }

Property Value

string
The ID URL encoded.

ImageLarge

Gets or sets a large image.
public string ImageLarge { get; set; }

Property Value

string

ImageMedium

Gets or sets a medium image.
public string ImageMedium { get; set; }

Property Value

string

ImageSmall

Gets or sets a small image.
public string ImageSmall { get; set; }

Property Value

string

InformativePrice

Gets the informative price.
[Obsolete("Use GetInformativePrice(PriceContext) instead.")]
public PriceInfo InformativePrice { get; }

Property Value

PriceInfo
The informative price.

IsActive

Gets the value that indicates if the product is active or not and if the period of the product is active or not.
public bool IsActive { get; }

Property Value

bool

Remarks

Checks if the product is active and if the period of product is active

IsVariantMaster

Gets the value that indicates if the variant is a master.
public bool IsVariantMaster { get; }

Property Value

bool

Items

Gets or sets the collection of product items for composite BOM products.
public ProductItemCollection Items { get; set; }

Property Value

ProductItemCollection

Examples

using Dynamicweb.Ecommerce.Products;
using Dynamicweb.Rendering;

namespace Dynamicweb.Ecommerce.Examples.Products
{
    class BomConfiguratorSample
    {
        private Template _template;
        private ProductCollection _bomProducts;
        private ProductItemCollection _configurators;
        private Product _product;

        public void SplitBom()
        {
            //### Split BOM items from configurators
            _bomProducts = new ProductCollection();
            _configurators = new ProductItemCollection();
            _product = new Product();
            _template = new Template();

            if (_template.LoopExists("BOMConfigurators") || _template.LoopExists("BOMProducts"))
            {
                foreach (ProductItem item in _product.Items)
                {
                    if (item.BomGroupId == string.Empty)
                    {
                        _bomProducts.Add(item.Products[0]);
                    }
                    else
                    {
                        _configurators.Add(item);
                    }
                }
            }
        }
    }
}

Language

Gets the product language. To change the language of this Product use the LanguageID property.
public Language Language { get; }

Property Value

Language
language.

LanguageId

Gets or sets the product language ID.
public string LanguageId { get; set; }

Property Value

string

Link1

Gets or sets the Link1.
public string Link1 { get; set; }

Property Value

string

Link2

Gets or sets the Link2.
public string Link2 { get; set; }

Property Value

string

LongDescription

Gets or sets the detailed description of the product.
public string LongDescription { get; set; }

Property Value

string

Manufacturer

Gets the product manufacturer. To set the Manufacturer use the ManufacturerID property.
public Manufacturer Manufacturer { get; }

Property Value

Manufacturer

ManufacturerId

Gets or sets the ID of the product manufacturer.
public string ManufacturerId { get; set; }

Property Value

string

Markup

Gets the markup. This value is calculated from DefaultPrice and Cost and is represented as a percentage.
public double Markup { get; }

Property Value

double

Meta

Gets or sets meta data. Meta information is used by search engines to index searches by means of keywords.
public ProductMetaData Meta { get; set; }

Property Value

ProductMetaData

Name

Gets or sets product name. Product name is used in the frontend product catalog.
public string Name { get; set; }

Property Value

string

NeverOutOfStock

Gets or sets value indicating whether to product can be never out of stock
public bool NeverOutOfStock { get; set; }

Property Value

bool

Remarks

Number

Gets or sets the product number.
public string Number { get; set; }

Property Value

string
number.

OptimizedFor

Gets or sets the keyword or phrase for which this product's meta data is optimized for.
public string OptimizedFor { get; set; }

Property Value

string

OrderLineFields

Gets the order line fields.
public OrderLineFieldCollection OrderLineFields { get; }

Property Value

OrderLineFieldCollection
The order line fields.

Period

Gets or sets the period.
[Obsolete("Use GetPeriod() instead and check for null.")]
public Period Period { get; }

Property Value

Period

PeriodId

Gets or sets the ID of the period.
public string PeriodId { get; set; }

Property Value

string

Price

Gets the price. This is the final calculated price for the product.
[Obsolete("Use GetPrice(PriceContext) instead.")]
public PriceInfo Price { get; }

Property Value

PriceInfo
The price.

PriceCount

Gets or sets the price counting.
public int PriceCount { get; set; }

Property Value

int

PriceMatrixMultiplePrices

Gets or sets PriceMatrixMultiplePrices.
public int PriceMatrixMultiplePrices { get; set; }

Property Value

int

PriceMatrixPeriod

Gets or sets PriceMatrixPeriod.
public int PriceMatrixPeriod { get; set; }

Property Value

int

PriceMatrixQuantitySpecification

Gets or sets PriceMatrixQuantitySpecification.
public string PriceMatrixQuantitySpecification { get; set; }

Property Value

string
PriceMatrixQuantitySpecification.

PriceMatrixUnit

Gets or sets PriceMatrixUnit.
public int PriceMatrixUnit { get; set; }

Property Value

int

PriceMatrixVariant

Gets or sets PriceMatrixVariant.
public int PriceMatrixVariant { get; set; }

Property Value

int

Prices

Gets or sets the collection of prices. Product prices are ranged according to variety of criteria e.group. Bulk prices, Campaigns, Units and Variant.
public PriceCollection Prices { get; }

Property Value

PriceCollection

PriceType

Gets or sets the type of the price e.group. calculated, fixed, fixed plus changes. Price type is only available if the product type is Parts List.
public ProductPriceType PriceType { get; set; }

Property Value

ProductPriceType

PrimaryGroupId

Gets the ID of primary group
public string PrimaryGroupId { get; }

Property Value

string
Primary group ID

ProductFieldValues

Gets or sets the collection of custom product field values. Administrator can create custom product fields in the Management Center -> eCommerce settings -> Product catalog -> Product fields.
public ProductFieldValueCollection ProductFieldValues { get; set; }

Property Value

ProductFieldValueCollection

Examples

using Dynamicweb.Ecommerce.Products;

namespace Dynamicweb.Ecommerce.Examples
{
    public class ProductProductFieldValuesSample
    {
        public void CreateNewProductWithProductFieldValue(string productFieldSystemName, object value)
        {
            // Create a new Product instance
            var product = new Product();

            // Set Product Name property
            product.Name = "My new product";

            // Get the ProductFieldValue object for the ProductField with the given system name
            var productFieldValue = product.ProductFieldValues.GetProductFieldValue(productFieldSystemName);

            // If the ProductFieldValue object exists then set its Value to the given value
            if (productFieldValue != null)
                productFieldValue.Value = value;

            // Save the product to persist data
            Services.Products.Save(product);
        }

    }
}

ProductPriceString

Gets or sets the product price string.
public string ProductPriceString { get; set; }

Property Value

string
The product price string.

PurchaseMinimumQuantity

Gets or sets product purchase minimum quantity
public double PurchaseMinimumQuantity { get; set; }

Property Value

double

Remarks

PurchaseQuantityStep

Gets or sets product purchase qantity step
public double PurchaseQuantityStep { get; set; }

Property Value

double

Remarks

Rating

Gets or sets the rating of the product.
public double Rating { get; set; }

Property Value

double
The rating.

RelatedCount

Gets the RelatedProducts counting.
public int RelatedCount { get; }

Property Value

int

RelatedGroups

Gets or sets the collection of related groups. The products can be placed in a different product group and then they will appear in more than one product category.
[Obsolete("Use Services.ProductRelatedGroups.GetRelatedGroupsWithProducts instead")]
public IEnumerable<ProductRelatedGroup> RelatedGroups { get; }

Property Value

IEnumerable<ProductRelatedGroup>

RelatedGroupsWithoutProducts

Gets or sets the related groups without products.
[Obsolete("Use Services.ProductRelatedGroups.GetAllRelatedGroups instead")]
public IEnumerable<ProductRelatedGroup> RelatedGroupsWithoutProducts { get; }

Property Value

IEnumerable<ProductRelatedGroup>
The related groups without products.

RelatedSearches

Related smart searches
[Obsolete("Related smart searches are no longer used.")]
public RelatedSmartSearchCollection RelatedSearches { get; }

Property Value

RelatedSmartSearchCollection
Related smart search collection

RelationSorting

Gets or sets RelationSorting.
public int RelationSorting { get; set; }

Property Value

int

ReplacementProductId

Gets or sets discontinued replacement product id
public string ReplacementProductId { get; set; }

Property Value

string

ReplacementVariantId

Gets or sets discontinued replacement product variant id
public string ReplacementVariantId { get; set; }

Property Value

string

Shop

Gets or sets shop the product belongs to.
[Obsolete("Products can be in multiple shops. This property never worked.")]
public Shop Shop { get; }

Property Value

Shop

ShortDescription

Gets or sets the short(teaser) description of the product.
public string ShortDescription { get; set; }

Property Value

string

ShowInProductList

Gets or sets value indicating whether to exclude the product from all products list
public bool ShowInProductList { get; set; }

Property Value

bool

SoldItems

Gets or sets the number of sold items.
public double SoldItems { get; set; }

Property Value

double
The items sold.

Stock

Gets or sets the product stock from the data record of the product (EcomProducts table).
public double Stock { get; set; }

Property Value

double

Remarks

Does not use the stock providers or get the stock levels from ERP in integrated solutions. Use UnitStock property for getting the calculated value from the provider.

StockGroup

Gets or sets the stock group.
public StockGroup StockGroup { get; set; }

Property Value

StockGroup

StockGroupId

Gets or sets StockGroupID.
public string StockGroupId { get; set; }

Property Value

string

SumStock

Gets value indicating whether to sum stock units.
public bool SumStock { get; }

Property Value

bool

TaxCollection

Gets the tax collection.
public TaxCollection TaxCollection { get; }

Property Value

TaxCollection

Type

Gets or sets the type of the product (stock item, service, giftCard or parts list).
public ProductType Type { get; set; }

Property Value

ProductType

UnformattedInformativePrice

Gets the informative price value. This is the final calculated informative price for the product.
[Obsolete("Use Price property on the price returned by GetInformativePrice(String,String)")]
public double UnformattedInformativePrice { get; }

Property Value

double
The unformatted informative price.

UnformattedPrice

Gets the price value. This is the final calculated price for the product.
[Obsolete("Use Price property on the price returned by GetPrice(String,String)")]
public double UnformattedPrice { get; }

Property Value

double
The unformatted price.

UnitCount

Gets or sets the unit counting.
public int UnitCount { get; set; }

Property Value

int

UnitList

Gets or sets VariantOptionCollection object.
[Obsolete("Use GetUnitList(languageId) instead.")]
public IEnumerable<VariantOption> UnitList { get; }

Property Value

IEnumerable<VariantOption>

Units

Gets or sets the collection of stock units.
[Obsolete("Use Services.StockService.GetStockUnits instead.")]
public StockUnitCollection Units { get; }

Property Value

StockUnitCollection

UnitStock

Gets the stock of the current product instance based on the provider if any are specified. Goes through the stockelevel provider (and hence the ERP if configured to do that). If there are not providers, 0.0 is returned
[Obsolete("Use GetUnitStock(stockLocation) instead.")]
public double UnitStock { get; }

Property Value

double

Remarks

Use Stock to get the value from the database.

UnitsUnique

Gets or sets the collection of stock units.
[Obsolete("Use Units property instead")]
public StockUnitCollection UnitsUnique { get; }

Property Value

StockUnitCollection

Updated

Gets or sets the date when the product was updated.
public DateTime Updated { get; set; }

Property Value

DateTime

VariantCombinations

Gets VariantCombinationCollection object.
public IList<VariantCombination> VariantCombinations { get; }

Property Value

IList<VariantCombination>

VariantCombinationsWithStockCheck

Gets VariantCombinationCollection object.
public IList<VariantCombination> VariantCombinationsWithStockCheck { get; }

Property Value

IList<VariantCombination>

VariantCount

Gets the variant counting.
public int VariantCount { get; }

Property Value

int

VariantGroupCount

Gets the VariantGroup counting.
public int VariantGroupCount { get; }

Property Value

int

VariantGroups

Gets or sets the collection of VariantGroup objects. The same product can be available in different variants, e.group. shoes of different sizes and colors. Administrator can create variants in Management Center -> eCommerce settings -> Product catalog -> Variants
public IList<VariantGroup> VariantGroups { get; }

Property Value

IList<VariantGroup>

VariantId

Gets or sets VariantID.
public string VariantId { get; set; }

Property Value

string

VariantProductCount

Gets or sets the VariantProduct counting.
public int VariantProductCount { get; set; }

Property Value

int

VariantStockSum

Gets sum of all product variant stock units.
public double VariantStockSum { get; }

Property Value

double

VatGroup

Gets or sets VatGroup object. VAT groups are managed in the Management Center -> eCommerce settings -> Internationalization -> VAT groups.
[Obsolete("Use GetVatGroup instead.")]
public VatGroup VatGroup { get; }

Property Value

VatGroup

VatGroupId

Gets or sets VatGroupID. VAT groups are managed in the Management Center -> eCommerce settings -> Internationalization -> VAT groups.
public string VatGroupId { get; set; }

Property Value

string

VatGroups

Gets or sets VAT groups on product for each country.
public IEnumerable<ProductVatGroup> VatGroups { get; }

Property Value

IEnumerable<ProductVatGroup>

VirtualVariantId

Gets or sets VirtualVariantID.
public string VirtualVariantId { get; set; }

Property Value

string

Volume

Gets or sets the product volume.
public double Volume { get; set; }

Property Value

double

Weight

Gets or sets the product weight.
public double Weight { get; set; }

Property Value

double

Width

Gets or sets product width
public double Width { get; set; }

Property Value

double

Remarks

Related field ProductWidth

WorkflowStateId

Gets or sets the workflow state.
public int WorkflowStateId { get; set; }

Property Value

int
The workflow state.

Methods

AddGroup(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.
[Obsolete("Use 'ProductService.AddGroup' instead")]
public void AddGroup(Group group)

Parameters

group Group

AddRelatedProduct(Product, ProductRelatedGroup)

Adds a related product to this product and saves it to the database.
[Obsolete("Use 'ProductService.AddRelatedProduct' instead")]
public void AddRelatedProduct(Product product, ProductRelatedGroup relatedProductGroup)

Parameters

product 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(VariantGroup)

Adds the variant group.
[Obsolete("Use 'ProductService.AddVariantGroup' instead")]
public void AddVariantGroup(VariantGroup variantGroup)

Parameters

variantGroup VariantGroup
The VariantGroup object.

ClearDiscountsCache()

Clears the product discounts collection.
[Obsolete("Use ClearDiscountsCache(currencyCode, countryCode) instead.")]
public void ClearDiscountsCache()

ClearDiscountsCache(string, string)

Clears the product discounts collection.
public void ClearDiscountsCache(string currencyCode, string countryCode)

Parameters

currencyCode string
Currency code
countryCode string

ClearDiscountsCache(string, string, string)

Clears the product discounts collection.
public void ClearDiscountsCache(string currencyCode, string countryCode, string unitId)

Parameters

currencyCode string
Currency code
countryCode string
unitId string

ClearDiscountsCache(string, string, string, string)

Clears the product discounts collection.
public void ClearDiscountsCache(string currencyCode, string countryCode, string unitId, string shopId)

Parameters

currencyCode string
Currency code
countryCode string
unitId string
shopId string

ClearPriceCache()

Clears the product price cache to force a recalculation of the price from the priceprovider.
[Obsolete("Use ClearPriceCache overload with PriceContext.")]
public void ClearPriceCache()

Remarks

Be aware that calling this method can have an impact on performance because prices has to be re-calculated more often.

ClearPriceCache(PriceContext, string, long)

public void ClearPriceCache(PriceContext context, string unitId, long stockLocationId)

Parameters

context PriceContext
unitId string
stockLocationId long

ClearPriceCache(string)

Clears the product price cache to force a recalculation of the price from the priceprovider.
[Obsolete("Use ClearPriceCache overload with PriceContext.")]
public void ClearPriceCache(string currencyCode)

Parameters

currencyCode string
Currency code

Remarks

Be aware that calling this method can have an impact on performance because prices has to be re-calculated more often.

Clone()

Clones this instance.
public Product Clone()

Returns

Product

Copy()

Copies this instance and saves it in the DB. This method like Clone method, but generates new ID and sets empty VariantID.
[Obsolete("Use 'ProductService.Copy' instead")]
public Product Copy()

Returns

Product

CopyAsVariant(string)

Copies this instance and saves it in the DB.
[Obsolete("Use 'ProductService.CopyAsVariant' instead")]
public Product CopyAsVariant(string productVariantId)

Parameters

productVariantId string
The variant ID.

Returns

Product

CountReservedStock()

Counts product reserved stock.
[Obsolete("Not used")]
public decimal CountReservedStock()

Returns

decimal

CreateProductWithoutDefaultProductFields()

public static Product CreateProductWithoutDefaultProductFields()

Returns

Product

CurrentBackendUserCanEdit(Product)

Checks if the current backend user has permission to edit a given product.
[Obsolete("Use 'ProductService.CurrentBackendUserCanEdit' instead")]
public static bool CurrentBackendUserCanEdit(Product theProduct)

Parameters

theProduct Product
the product in question

Returns

bool
True if the current backend user has permission to edit the given product. False if he doesn't, or if no backend user is logged in

Delete()

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.
[Obsolete("Use 'ProductService.Delete' instead")]
public void Delete()

Exceptions

ArgumentException
If Product does not exist in the database.

DiscountMatrix()

[Obsolete("Use overload with PriceContext.")]
public DiscountInfoCollection DiscountMatrix()

Returns

DiscountInfoCollection

Fill(IDataReader)

Fills the properties from DataReader.
[Obsolete("Don't use")]
public void Fill(IDataReader dataReader)

Parameters

dataReader IDataReader
DataReader.

get_Details(string)

Gets the detail collection.
[Obsolete("Use Detail.GetDetails instead")]
public IEnumerable<Detail> get_Details(string typeValue)

Parameters

typeValue string
Type of value

Returns

IEnumerable<Detail>

get_Periods(bool)

Gets or sets the periods.
[Obsolete("Use Period.GetPeriods instead")]
public IEnumerable<Period> get_Periods(bool activeStatus)

Parameters

activeStatus bool

Returns

IEnumerable<Period>

get_RelatedGroups(bool)

Gets or sets the collection of related groups excluding not used items. The products can be placed in a different product group and then they will appear in more than one product category.
[Obsolete("Use Services.ProductRelatedGroups.GetRelatedGroupsWithProducts instead")]
public IEnumerable<ProductRelatedGroup> get_RelatedGroups(bool isfrontend)

Parameters

isfrontend bool
Is it frontend

Returns

IEnumerable<ProductRelatedGroup>
ProductRelatedGroupCollection.

get_StockStatus(string, string)

Gets the stock status.
[Obsolete("Use Services.Products.GetStockStatus instead.")]
public StockStatus get_StockStatus(string productLanguageId, string unitId = null)

Parameters

productLanguageId string
unitId string

Returns

StockStatus

GetActiveProducts()

Gets the active products. Context.LanguageID is used.
[Obsolete("Use 'ProductService.GetActiveProducts' instead")]
public static ProductCollection GetActiveProducts()

Returns

ProductCollection

GetActiveProducts(string)

Gets the active products.
[Obsolete("Use 'ProductService.GetActiveProducts' instead")]
public static ProductCollection GetActiveProducts(string productLanguageId)

Parameters

productLanguageId string
The language ID to use.

Returns

ProductCollection

GetActiveProducts(string, bool)

Gets the active products.
[Obsolete("Use 'ProductService.GetActiveProducts' instead")]
public static ProductCollection 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

ProductCollection

GetAllProducts()

[Obsolete("Use 'ProductService.GetAllProducts' instead")]
public static ProductCollection GetAllProducts()

Returns

ProductCollection

GetAllProducts(string)

Gets all products.
[Obsolete("Use 'ProductService.GetAllProducts' instead")]
public static ProductCollection GetAllProducts(string productLanguageId)

Parameters

productLanguageId string
The language ID to use.

Returns

ProductCollection

GetAllProducts(string, bool)

Gets all products.
[Obsolete("Use 'ProductService.GetAllProducts' instead")]
public static ProductCollection GetAllProducts(string productLanguageId, bool useAssortments)

Parameters

productLanguageId string
The language ID to use.
useAssortments bool

Returns

ProductCollection

GetAllProductsByShopId(string)

Gets all products from shop. No language filter is applied meaning all language version of all products in the shop are returned.
[Obsolete("Use 'ProductService.GetAllProductsByShopId' instead")]
public static ProductCollection GetAllProductsByShopId(string shopId)

Parameters

shopId string
DB field name is ShopGroupShopID.

Returns

ProductCollection

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.
[Obsolete("Use 'ProductService.GetAllProductsByShopId' instead")]
public static ProductCollection 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

ProductCollection

GetAllProductsWithoutVariants()

Gets all products without variants. Context.LanguageID is used.
[Obsolete("Use 'ProductService.GetAllProductsWithoutVariants' instead")]
public static ProductCollection GetAllProductsWithoutVariants()

Returns

ProductCollection

GetAllProductsWithoutVariants(bool)

Gets all products without variants. Context.LanguageID is used.
[Obsolete("Use 'ProductService.GetAllProductsWithoutVariants' instead")]
public static ProductCollection GetAllProductsWithoutVariants(bool doRefactoring)

Parameters

doRefactoring bool
if set to true; - do refactoring the product collection.

Returns

ProductCollection

GetAllProductsWithoutVariants(bool, string)

Gets all products without variants.
[Obsolete("Use 'ProductService.GetAllProductsWithoutVariants' instead")]
public static ProductCollection GetAllProductsWithoutVariants(bool doRefactoring, string productLanguageId)

Parameters

doRefactoring bool
if set to true; - do refactoring the product collection.
productLanguageId string
The language ID to use.

Returns

ProductCollection

GetAllProductsWithoutVariants(bool, string, bool)

Gets all products without variants.
[Obsolete("Use 'ProductService.GetAllProductsWithoutVariants' instead")]
public static ProductCollection GetAllProductsWithoutVariants(bool doRefactoring, string productLanguageId, bool useAssortments)

Parameters

doRefactoring bool
if set to true; - do refactoring the product collection.
productLanguageId string
The language ID to use.
useAssortments bool
If set to true assortments are used to filter products.

Returns

ProductCollection

GetCategories()

Get the Dynamicweb.eCommerce.Products.Categories.Category objects for each of the Dynamicweb.eCommerce.Products.Group this belongs
[Obsolete("Use 'Services.ProductCategories.GetCategories' instead")]
public CategoryCollection GetCategories()

Returns

CategoryCollection
Dynamicweb.eCommerce.Products.Categories.CategoryCollection

GetCategoryValue(string, string)

Retrieves the value of the given category field.
public object GetCategoryValue(string categoryId, string fieldId)

Parameters

categoryId string
An ID (system name) of the category.
fieldId string
An ID of the target category field.

Returns

object
Category field value.

GetCategoryValue(string, string, bool)

Retrieves the value of the given category field.
public object GetCategoryValue(string categoryId, string fieldId, bool includeInheritance)

Parameters

categoryId string
An ID (system name) of the category.
fieldId string
An ID of the target category field.
includeInheritance bool

Returns

object
Category field value.

GetCommaSeparatedProductIDs(ProductCollection)

Returns list of IDs.
[Obsolete("Use 'ProductService.GetCommaSeparatedProductIDs' instead")]
public static string GetCommaSeparatedProductIDs(ProductCollection products)

Parameters

products ProductCollection
The products.

Returns

string

Exceptions

ArgumentNullException
If given ProductCollection is null.

GetDefaultCategoryValue(Field)

Gets default product category field value
public object GetDefaultCategoryValue(Field field)

Parameters

field Field

Returns

object
Field value

GetDefaultGroupByShopId(string)

Gets the default group by shop id.
public Group GetDefaultGroupByShopId(string ShopId)

Parameters

ShopId string
The shop id.

Returns

Group
Group.

GetDefaultGroupByShopId(string, bool)

Gets the default group by shop id.
public Group GetDefaultGroupByShopId(string ShopId, bool checkForPrimaryGroup)

Parameters

ShopId string
The shop id.
checkForPrimaryGroup bool

Returns

Group
Group.

GetDiscountMatrix(PriceContext, string, long)

Gets the product discount matrix
public DiscountInfoCollection GetDiscountMatrix(PriceContext context, string unitId, long stockLocationId)

Parameters

context PriceContext
Price context
unitId string
Unit identifier
stockLocationId long
Stock location identifier

Returns

DiscountInfoCollection

GetDiscountMatrix(string)

[Obsolete("Use overload with PriceContext.")]
public DiscountInfoCollection GetDiscountMatrix(string currencyCode)

Parameters

currencyCode string

Returns

DiscountInfoCollection

GetDiscountMatrix(string, string)

[Obsolete("Use overload with PriceContext.")]
public DiscountInfoCollection GetDiscountMatrix(string currencyCode, string countryCode)

Parameters

currencyCode string
countryCode string

Returns

DiscountInfoCollection

GetDiscountMatrix(string, string, int)

[Obsolete("Use overload with PriceContext.")]
public DiscountInfoCollection GetDiscountMatrix(string currencyCode, string countryCode, int userId)

Parameters

currencyCode string
countryCode string
userId int

Returns

DiscountInfoCollection

GetDiscountMatrix(string, string, int, string)

[Obsolete("Use overload with PriceContext.")]
public DiscountInfoCollection GetDiscountMatrix(string currencyCode, string countryCode, int userId, string unitId)

Parameters

currencyCode string
countryCode string
userId int
unitId string

Returns

DiscountInfoCollection

GetDiscountMatrix(string, string, int, string, string)

[Obsolete("Use overload with PriceContext.")]
public DiscountInfoCollection GetDiscountMatrix(string currencyCode, string countryCode, int userId, string unitId, string shopId)

Parameters

currencyCode string
countryCode string
userId int
unitId string
shopId string

Returns

DiscountInfoCollection

GetDiscounts(Currency, Country)

Gets the product discounts collection.
[Obsolete("Sales discount functionality is obsolete. Use GetDiscountMatrix instead.")]
public DiscountCollection GetDiscounts(Currency currency, Country country)

Parameters

currency Currency
The currency
country Country
The currency

Returns

DiscountCollection
The discounts.

GetDiscounts(Currency, Country, string)

Gets the product discounts collection.
[Obsolete("Sales discount functionality is obsolete. Use GetDiscountMatrix instead.")]
public DiscountCollection GetDiscounts(Currency currency, Country country, string unitId)

Parameters

currency Currency
The currency
country Country
The currency
unitId string

Returns

DiscountCollection
The discounts.

GetDiscounts(Currency, Country, string, string)

Gets the product discounts collection.
[Obsolete("Sales discount functionality is obsolete. Use GetDiscountMatrix instead.")]
public DiscountCollection GetDiscounts(Currency currency, Country country, string unitId, string shopId)

Parameters

currency Currency
The currency
country Country
The currency
unitId string
The unit id used for product base price calculation
shopId string
The shop id used for product base price calculation

Returns

DiscountCollection
The discounts.

GetDiscounts(PriceContext, string, long)

Gets the product discounts collection.
[Obsolete("Sales discount functionality is obsolete. Use GetDiscountMatrix instead.")]
public DiscountCollection GetDiscounts(PriceContext context, string unitId, long stockLocationId)

Parameters

context PriceContext
The price context
unitId string
The unit id used for product base price calculation
stockLocationId long
The stock location id used for product base price calculation

Returns

DiscountCollection
The discounts.

GetDiscounts(string, string)

Gets the product discounts collection.
[Obsolete("Sales discount functionality is obsolete. Use GetDiscountMatrix instead.")]
public DiscountCollection GetDiscounts(string currencyCode, string countryCode)

Parameters

currencyCode string
Currency code
countryCode string

Returns

DiscountCollection
The discounts.

GetInformativePrice(PriceContext)

Gets the informative price.
public PriceInfo GetInformativePrice(PriceContext context)

Parameters

context PriceContext
Price context

Returns

PriceInfo

GetInformativePrice(PriceContext, string, long)

Gets the informative price.
public PriceInfo GetInformativePrice(PriceContext context, string unitId, long stockLocationId)

Parameters

context PriceContext
Price context
unitId string
Unit identifier
stockLocationId long
Stock location identifier

Returns

PriceInfo

GetInformativePrice(string, string)

Gets the informative price.
[Obsolete("Use GetInformativePrice(PriceContext) instead.")]
public PriceInfo GetInformativePrice(string currencyCode, string vatCountryCode)

Parameters

currencyCode string
Currency code
vatCountryCode string
Code2 of country

Returns

PriceInfo

GetInformativePrice(string, string, string)

Gets the informative price.
[Obsolete("Use GetInformativePrice(PriceContext, string) instead.")]
public PriceInfo GetInformativePrice(string currencyCode, string vatCountryCode, string unitId)

Parameters

currencyCode string
Currency code
vatCountryCode string
Code2 of country
unitId string

Returns

PriceInfo

GetLastActiveProducts(int)

Gets the last active products. Context.LanguageID is used.
[Obsolete("Use 'ProductService.GetLastActiveProducts' instead")]
public static ProductCollection GetLastActiveProducts(int count)

Parameters

count int
Select top from selected items.

Returns

ProductCollection

GetLastActiveProducts(int, string)

Gets the last active products.
[Obsolete("Use 'ProductService.GetLastActiveProducts' instead")]
public static ProductCollection GetLastActiveProducts(int count, string productLanguageId)

Parameters

count int
Select top from selected items.
productLanguageId string
The language ID to use.

Returns

ProductCollection

GetLastActiveProducts(int, string, bool)

Gets the last active products.
[Obsolete("Use 'ProductService.GetLastActiveProducts' instead")]
public static ProductCollection 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

ProductCollection

GetLastActiveProducts(int, string[])

Gets the last active products. Context.LanguageID is used.
[Obsolete("Use 'ProductService.GetLastActiveProducts' instead")]
public static ProductCollection GetLastActiveProducts(int count, string[] groupIds)

Parameters

count int
Select top from selected items.
groupIds string[]
The array of group IDs.

Returns

ProductCollection

GetLastActiveProducts(int, string[], string)

Gets the last active products. Context.LanguageID is used.
[Obsolete("Use 'ProductService.GetLastActiveProducts' instead")]
public static ProductCollection GetLastActiveProducts(int count, string[] groupIds, string productLanguageId)

Parameters

count int
Select top from selected items.
groupIds string[]
The array of group IDs.
productLanguageId string
The language ID to use.

Returns

ProductCollection

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

Gets the last active products. Context.LanguageID is used.
[Obsolete("Use 'ProductService.GetLastActiveProducts' instead")]
public static ProductCollection 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

ProductCollection

GetPagedProductsByVariantGroup(VariantGroup, int, int)

Gets the products portion limited by page size.
[Obsolete("Use 'ProductService.GetPagedProductsByVariantGroup' instead")]
public static ProductCollection GetPagedProductsByVariantGroup(VariantGroup variantGroup, int pageNumber, int pageSize)

Parameters

variantGroup VariantGroup
The VariantGroup object.
pageNumber int
pageSize int

Returns

ProductCollection

GetPeriod()

Gets the publication period associated with this product.
public Period GetPeriod()

Returns

Period
An associated Period, if any; otherwise, null.

GetPrice(PriceContext)

Gets the price. This is the final calculated price for the product.
public PriceInfo GetPrice(PriceContext context)

Parameters

context PriceContext
Price context

Returns

PriceInfo

GetPrice(PriceContext, string, long)

Gets the price. This is the final calculated price for the product.
public PriceInfo GetPrice(PriceContext context, string unitId, long stockLocationId)

Parameters

context PriceContext
Price context
unitId string
Unit identifier
stockLocationId long
Stock location identifier

Returns

PriceInfo

GetPrice(string, string)

Gets the price. This is the final calculated price for the product.
[Obsolete("Use GetPrice(PriceContext) instead.")]
public PriceInfo GetPrice(string currencyCode, string vatCountryCode)

Parameters

currencyCode string
Currency code
vatCountryCode string
Code2 of country

Returns

PriceInfo

GetProductById(string)

Gets the product by ID.
[Obsolete("Use 'ProductService.GetProductById' instead")]
public static Product GetProductById(string productId)

Parameters

productId string
The product ID.

Returns

Product

GetProductById(string, string)

Gets the product by ID.
[Obsolete("Use 'ProductService.GetProductById' instead")]
public static Product GetProductById(string productId, string productVariantId)

Parameters

productId string
The product ID.
productVariantId string
The variant ID.

Returns

Product

GetProductById(string, string, bool)

Gets the product by ID.
[Obsolete("Use 'ProductService.GetProductById' instead")]
public static 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.
[Obsolete("Use 'ProductService.GetProductById' instead")]
public static 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, bool)

Gets the product by ID.
[Obsolete("Use 'ProductService.GetProductById' instead")]
public static 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

GetProductByNumber(string)

Gets the product by number.
[Obsolete("Use 'ProductService.GetProductByNumber' instead")]
public static Product GetProductByNumber(string productNumber)

Parameters

productNumber string
Product number.

Returns

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

GetProductByNumber(string, bool)

Gets the product by number.
[Obsolete("Use 'ProductService.GetProductByNumber' instead")]
public static Product GetProductByNumber(string productNumber, bool useDefaultLanguage)

Parameters

productNumber string
Product number.
useDefaultLanguage bool
Value indicating whether to use default language.

Returns

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

GetProductByNumber(string, string)

Gets the product by number.
[Obsolete("Use 'ProductService.GetProductByNumber' instead")]
public static 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.

GetProductBySql(string)

Gets the products by SQL.
[Obsolete("Don't use this")]
public static ProductCollection GetProductBySql(string query)

Parameters

query string
The SQL query.

Returns

ProductCollection

GetProductBySql(string, bool)

Gets the products by SQL.
[Obsolete("Don'True use this")]
public static ProductCollection GetProductBySql(string query, bool doRefactoring)

Parameters

query string
The SQL query.
doRefactoring bool
if set to true removes not used items.

Returns

ProductCollection

GetProductBySql(string, bool, bool)

Gets the products by SQL.
[Obsolete("Don't use this")]
public static ProductCollection GetProductBySql(string query, bool doRefactoring, bool useAssortments)

Parameters

query string
The SQL query.
doRefactoring bool
if set to true removes not used items.
useAssortments bool
If set to true assortments are used to filter products.

Returns

ProductCollection

GetProductFieldValue(string)

Gets the product field value.
[Obsolete("Use 'ProductService.GetProductFieldValue' instead")]
public object GetProductFieldValue(string productFieldSystemName)

Parameters

productFieldSystemName string
SystemName of the ProductField.

Returns

object

Exceptions

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

GetProductsAndVariantsByProduct(Product)

Gets the all products and variants with the same product ID and language ID as the given product.
[Obsolete("Use 'ProductService.GetProductsAndVariantsByProduct' instead")]
public static ProductCollection GetProductsAndVariantsByProduct(Product product)

Parameters

product Product
The product.

Returns

ProductCollection

GetProductsByGroup(Group)

Gets all language version of all products from the group.
[Obsolete("Use 'ProductService.GetProductsByGroup' instead")]
public static ProductCollection GetProductsByGroup(Group group)

Parameters

group Group
The group.

Returns

ProductCollection

GetProductsByGroup(Group, string)

Gets the products from group.
[Obsolete("Use 'ProductService.GetProductsByGroup' instead")]
public static ProductCollection GetProductsByGroup(Group group, string productLanguageId)

Parameters

group Group
The group.
productLanguageId string
The language ID.

Returns

ProductCollection

GetProductsByGroup(Group, string, bool)

Gets the products from group.
[Obsolete("Use 'ProductService.GetProductsByGroup' instead")]
public static ProductCollection 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

ProductCollection

GetProductsByGroupId(string)

Gets the product collection based on Group ID, containing active products only. Context.LanguageID is used.
[Obsolete("Use 'ProductService.GetProductsByGroupId' instead")]
public static ProductCollection GetProductsByGroupId(string groupId)

Parameters

groupId string
The group ID.

Returns

ProductCollection

GetProductsByGroupId(string, bool)

Gets the product collection based on Group ID. Context.LanguageID is used.
[Obsolete("Use 'ProductService.GetProductsByGroupId' instead")]
public static ProductCollection GetProductsByGroupId(string groupId, bool onlyActive)

Parameters

groupId string
The group ID.
onlyActive bool
if set to true removes not active items from collection.

Returns

ProductCollection

GetProductsByGroupId(string, bool, string)

Gets the product collection based on Group ID.
[Obsolete("Use 'ProductService.GetProductsByGroupId' instead")]
public static ProductCollection GetProductsByGroupId(string groupId, bool onlyActive, string productLanguageId)

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.

Returns

ProductCollection

GetProductsByGroupId(string, bool, string, bool)

Gets the product collection based on Group ID.
[Obsolete("Use 'ProductService.GetProductsByGroupId' instead")]
public static ProductCollection 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

ProductCollection

GetProductsByGroups(GroupCollection, bool)

Gets the products from groups for the specified language ID. See GetProductsByGroups(GroupCollection, string, bool) for example.
[Obsolete("Use 'ProductService.GetProductsByGroups' instead")]
public static ProductCollection GetProductsByGroups(GroupCollection groups, bool isFrontEnd)

Parameters

groups GroupCollection
The groups.
isFrontEnd bool
if set to true current context is frontend.

Returns

ProductCollection

GetProductsByGroups(GroupCollection, string, bool)

Gets the products from groups.
[Obsolete("Use 'ProductService.GetProductsByGroups' instead")]
public static ProductCollection GetProductsByGroups(GroupCollection groups, string productLanguageId, bool isFrontEnd)

Parameters

groups GroupCollection
The groups.
productLanguageId string
The language ID.
isFrontEnd bool
if set to true removes not used items.

Returns

ProductCollection

GetProductsByGroups(GroupCollection, string, bool, bool)

Gets the products from groups.
[Obsolete("Use 'ProductService.GetProductsByGroups' instead")]
public static ProductCollection 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

ProductCollection

GetProductsByProductAndVariantId(Product, string)

Gets the products.
[Obsolete("Use 'ProductService.GetProductsByProductAndVariantId' instead")]
public static ProductCollection GetProductsByProductAndVariantId(Product product, string productVariantId)

Parameters

product Product
The product.
productVariantId string
The variant ID.

Returns

ProductCollection

GetProductsByProductAndVariantId(Product, string, bool)

Gets the products.
[Obsolete("Use 'ProductService.GetProductsByProductAndVariantId' instead")]
public static ProductCollection GetProductsByProductAndVariantId(Product product, string productVariantId, bool useAssortments)

Parameters

product Product
The product.
productVariantId string
The variant ID.
useAssortments bool
If set to true assortments are used to filter products.

Returns

ProductCollection

GetProductsByProductIDs(string[])

Gets the products. Context.LanguageID is used.
[Obsolete("Use 'ProductService.GetProductsByProductIDs' instead")]
public static ProductCollection GetProductsByProductIDs(string[] productIds)

Parameters

productIds string[]
The collection of product IDs.

Returns

ProductCollection

GetProductsByProductIDs(string[], bool)

Gets the products. Context.LanguageID is used.
[Obsolete("Use 'ProductService.GetProductsByProductIDs' instead")]
public static ProductCollection GetProductsByProductIDs(string[] productIds, bool doRefactoring)

Parameters

productIds string[]
The array of products ID.
doRefactoring bool
if set to true removes not used items.

Returns

ProductCollection

GetProductsByProductIDs(string[], bool, bool, string)

Gets the products.
[Obsolete("Use 'ProductService.GetProductsByProductIDs' instead")]
public static ProductCollection GetProductsByProductIDs(string[] productIds, bool doRefactoring, bool useAssortments, string productLanguageId)

Parameters

productIds string[]
The array of products ID.
doRefactoring bool
if set to true removes not used items.
useAssortments bool
If set to true assortments are used to filter the products.
productLanguageId string
The language ID to use.

Returns

ProductCollection

GetProductsByProductIDs(string[], bool, string)

Gets the products.
[Obsolete("Use 'ProductService.GetProductsByProductIDs' instead")]
public static ProductCollection GetProductsByProductIDs(string[] productIds, bool doRefactoring, string productLanguageId)

Parameters

productIds string[]
The array of products ID.
doRefactoring bool
if set to true removes not used items.
productLanguageId string
The language ID to use.

Returns

ProductCollection

GetProductsByShopId(string)

Gets products from shop. Context.LanguageID is used.
[Obsolete("Use 'ProductService.GetProductsByShopId' instead")]
public static ProductCollection GetProductsByShopId(string shopId)

Parameters

shopId string
DB field name is ShopGroupShopID.

Returns

ProductCollection

GetProductsByShopId(string, string)

Gets products from shop.
[Obsolete("Use 'ProductService.GetProductsByShopId' instead")]
public static ProductCollection GetProductsByShopId(string shopId, string productLanguageId)

Parameters

shopId string
DB field name is ShopGroupShopID.
productLanguageId string
The language ID to use.

Returns

ProductCollection

GetProductsByShopId(string, string, bool)

Gets products from shop.
[Obsolete("Use 'ProductService.GetProductsByShopId' instead")]
public static ProductCollection 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

ProductCollection

GetProductsBySql(bool, string)

Gets the ProductCollection object.
[Obsolete("Don't use this")]
public static ProductCollection GetProductsBySql(bool useAssortments, string query)

Parameters

useAssortments bool
if set to true assortments are used to filter the product collection.
query string
The SQL query.

Returns

ProductCollection

GetProductsBySql(string)

Gets the ProductCollection object.
[Obsolete("Don't use this")]
public static ProductCollection GetProductsBySql(string query)

Parameters

query string
The SQL query.

Returns

ProductCollection

GetProductsByVariantGroup(VariantGroup)

Gets the products.
[Obsolete("Use 'ProductService.GetProductsByVariantGroup' instead")]
public static ProductCollection GetProductsByVariantGroup(VariantGroup variantGroup)

Parameters

variantGroup VariantGroup
The VariantGroup object.

Returns

ProductCollection

GetPropertyValue(string)

Gets the property value.
[Obsolete("Use 'ProductService.GetPropertyValue' instead")]
public object GetPropertyValue(string propertyName)

Parameters

propertyName string
Name of the property.

Returns

object

GetSqlConditionPartForIDs(string)

Gets the condition part of a SQL statement.
[Obsolete("Use 'ProductService.GetCommandBuilderConditionPartForIds' instead.")]
public static string GetSqlConditionPartForIDs(string idList)

Parameters

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

Returns

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

GetUnitList(string)

Gets or sets product stock units.
public IEnumerable<VariantOption> GetUnitList(string languageId)

Parameters

languageId string

Returns

IEnumerable<VariantOption>

GetUnitStock(StockLocation)

Gets the stock of the current product instance based on the provider if any are specified. Goes through the stock level provider (and hence the ERP if configured to do that). If there are not providers, 0.0 is returned
public double GetUnitStock(StockLocation stockLocation)

Parameters

stockLocation StockLocation

Returns

double

GetUnitStock(StockLocation, string)

Gets the stock of the current product instance based on the provider if any are specified. Goes through the stock level provider (and hence the ERP if configured to do that). If there are not providers, 0.0 is returned
public double GetUnitStock(StockLocation stockLocation, string unitId)

Parameters

stockLocation StockLocation
unitId string

Returns

double

GetVatGroup(string)

Gets the products VatGroup based upon code2 from country.
public VatGroup GetVatGroup(string vatCountryCode)

Parameters

vatCountryCode string
Country code2

Returns

VatGroup
vatGroup

IsSameProduct(Product)

Determines whether the given product is the same as this product. This is not an object comparison but an ID comparison. Product ID and Variant ID (including virtual Variant ID where applicable).
[Obsolete("Use 'ProductService.AreProductsTheSame' instead")]
public bool IsSameProduct(Product product)

Parameters

product Product
The product.

Returns

bool

ProductVariantExists(Product, string)

If variant exists return true.
[Obsolete("Use 'ProductService.ProductVariantExists' instead")]
public static bool ProductVariantExists(Product product, string productVariandId)

Parameters

product Product
The product.
productVariandId string
The variant ID.

Returns

bool

RelatedCountFrontend()

Gets the RelatedProducts counting.
[Obsolete("Use 'ProductService.GetRelatedCountFrontend' instead")]
public int RelatedCountFrontend()

Returns

int

RelatedProducts()

Gets the related products. Related products are used to suggest a customer to buy complementary products to the products they want to buy, e.group. a shirt and a tie. Administrator can create relations in Management Center -> eCommerce settings -> Product catalog -> Related products.
[Obsolete("Use 'ProductService.GetRelatedProducts' instead")]
public IEnumerable<ProductRelated> RelatedProducts()

Returns

IEnumerable<ProductRelated>

RemoveGroup(Group)

Removes the group from the products Groups collection. Also deletes the ProductGroupRelation from the database if group.ID exists.
[Obsolete("Use 'ProductService.RemoveGroup' instead")]
public void RemoveGroup(Group group)

Parameters

group Group

RemoveItem(string)

Removes the item.
[Obsolete("Use 'ProductService.RemoveItem' instead")]
public void RemoveItem(string itemId)

Parameters

itemId string
The item ID.

RemoveVariantGroup(VariantGroup)

Removes the variant group by object reference.
[Obsolete("Use 'ProductService.RemoveVariantGroup' instead")]
public void RemoveVariantGroup(VariantGroup variantGroup)

Parameters

variantGroup VariantGroup
The VariantGroup object.

RemoveVariantGroupLoop(VariantGroup)

Removes the variant group by ID, LanguageID, Label and Name.
[Obsolete("Use 'ProductService.RemoveVariantGroupLoop' instead")]
public void RemoveVariantGroupLoop(VariantGroup variantGroup)

Parameters

variantGroup VariantGroup
The VariantGroup object.

Save()

Saves this instance.
[Obsolete("Use 'ProductService.Save' instead")]
public void Save()

Save(bool)

Saves this instance.
[Obsolete("Use 'ProductService.Save' instead")]
public void Save(bool skipExtendedSave)

Parameters

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

SetCategoryValue(string, Field, object)

Assigns category field value to the current product.
public void SetCategoryValue(string categoryId, Field field, object value)

Parameters

categoryId string
An ID (system name) of the category.
field Field
An instance of the target category field.
value object
Category field value.

SetCategoryValue(string, string, object)

Assigns category field value to the current product.
public void SetCategoryValue(string categoryId, string fieldId, object value)

Parameters

categoryId string
An ID (system name) of the category.
fieldId string
An ID of the target category field.
value object
Category field value.

SetProductFieldValue(string, object)

Gets the product field value.
[Obsolete("Use 'ProductService.SetProductFieldValue' instead")]
public void SetProductFieldValue(string productFieldSystemName, object value)

Parameters

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.

UnitExists(string)

Determines whether unit exists.
public static bool UnitExists(string unitId)

Parameters

unitId string
The unit ID.

Returns

bool

UpdateCounters()

Updates the variant and unit counters. Should be called after adding variants or units to a product through the API.
[Obsolete("Use 'ProductService.UpdateCounters' instead")]
public void UpdateCounters()

UpdateDefaultVariantId(Product, string)

Updates the default variant ID.
[Obsolete("Use 'ProductService.UpdateDefaultVariantId' instead")]
public static 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.
[Obsolete("Use 'ProductService.UpdatePriceCount' instead")]
public static int UpdatePriceCount(Product product, int priceCount)

Parameters

product Product
The product.
priceCount int
The price counter.

Returns

int

UpdateStock(Order)

Updates the stock.
[Obsolete("Use 'ProductService.UpdateStock' instead")]
public static int UpdateStock(Order order)

Parameters

order Order

Returns

int
The number of products that have had their Stock updated.

UpdateStock(Order, ProductOrderStockOperator)

Updates the stock.
[Obsolete("Use 'ProductService.UpdateStock' instead")]
public static int UpdateStock(Order order, ProductOrderStockOperator @operator)

Parameters

order Order
operator ProductOrderStockOperator

Returns

int
The number of products that have had their Stock updated.

UpdateStock(OrderLine, ProductOrderStockOperator)

Updates the stock.
[Obsolete("Use 'ProductService.UpdateStock' instead")]
public static bool UpdateStock(OrderLine orderLine, ProductOrderStockOperator @operator)

Parameters

orderLine OrderLine
The orderLine.
operator ProductOrderStockOperator
The operator.

Returns

bool
Whether stock was updated or no.

UpdateUnitCount(Product, int)

Updates the unit counter.
[Obsolete("Use 'ProductService.UpdateUnitCount' instead")]
public static int UpdateUnitCount(Product product, int unitCount)

Parameters

product Product
The product.
unitCount int
The unit counter.

Returns

int

UpdateVariantCount(Product, int)

Updates the variant counter.
[Obsolete("Use 'ProductService.UpdateVariantCount' instead")]
public static int UpdateVariantCount(Product product, int variantCount)

Parameters

product Product
The product.
variantCount int
The variant counter.

Returns

int
To top