Class Product
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
Represents information about a product.
- Inheritance
-
Product
- Inherited Members
- Extension Methods
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.
Properties
Active
Gets or sets the value that indicates if the product is active or not.
Property Value
ApprovalState
Gets or sets the state of the approval.
Property Value
- Product
Approval State Type The state of the approval.
AutoId
Gets or sets the automatic identifier assigned by the database.
Property Value
- long
The auto id from the database. This ID should not be used as key or reference but only in runtime scenarios like querying or getting records from the API.
CommentCount
Gets or sets the count of comments.
Property Value
- int
The count of comments.
Cost
Gets or sets the default cost.
Property Value
- double
The default cost.
Created
Gets or sets the date when the product was created.
Property Value
DefaultPoints
Gets or sets product default price in loyalty points if the product is bought with loyalty points
Property Value
DefaultPrice
Gets or sets the default price. This price is a basis for calculating the final price that is displayed in the frontend.
Property Value
- double
The default price.
DefaultShopId
Gets or sets the default shop ID.
Property Value
- string
The default shop ID.
DefaultUnitId
Gets or sets the default ID of the unit.
Property Value
DefaultVariantComboId
Gets or sets the default VariantComboID.
Property Value
Depth
Gets or sets product depth
Property Value
Remarks
Related field Dynamicweb.
Discontinued
Gets or sets value indicating that product is discontinued
Property Value
DiscontinuedAction
Gets or sets discontinued action
Property Value
EAN
Gets or sets Product EAN
Property Value
Remarks
Related field Dynamicweb.
ExcludeFromIndex
Gets or sets value indicating whether to exclude the product from indexing.
Property Value
ExpectedDelivery
Gets or sets the expected delivery date.
Property Value
Groups
Gets or sets the collection of groups that own the product.
Property Value
Height
Gets or sets product height
Property Value
Remarks
Related field Dynamicweb.
Id
Gets or sets the ID of the product.
Property Value
ImageLarge
Gets or sets a large image.
Property Value
ImageMedium
Gets or sets a medium image.
Property Value
ImageSmall
Gets or sets a small image.
Property Value
Items
Gets or sets the collection of product items for composite BOM products.
Property Value
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);
}
}
}
}
}
}
LanguageId
Gets or sets the product language ID.
Property Value
LongDescription
Gets or sets the detailed description of the product.
Property Value
ManufacturerId
Gets or sets the ID of the product manufacturer.
Property Value
Meta
Gets or sets meta data. Meta information is used by search engines to index searches by means of keywords.
Property Value
Name
Gets or sets product name. Product name is used in the frontend product catalog.
Property Value
NeverOutOfStock
Gets or sets value indicating whether to product can be never out of stock
Property Value
Remarks
Related field Dynamicweb.
Number
Gets or sets the product number.
Property Value
- string
number.
OrderLineFields
Gets the order line fields.
Property Value
- Order
Line Field Collection The order line fields.
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.
Property Value
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.
Property Value
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);
}
}
}
PurchaseMinimumQuantity
Gets or sets product purchase minimum quantity
Property Value
Remarks
Related field Dynamicweb.
PurchaseQuantityStep
Gets or sets product purchase qantity step
Property Value
Remarks
Related field Dynamicweb.
Rating
Gets or sets the rating of the product.
Property Value
- double
The rating.
ReplacementProductId
Gets or sets discontinued replacement product id
Property Value
ReplacementVariantId
Gets or sets discontinued replacement product variant id
Property Value
ShortDescription
Gets or sets the short(teaser) description of the product.
Property Value
ShowInProductList
Gets or sets value indicating whether to exclude the product from all products list
Property Value
Stock
Gets or sets the product stock from the data record of the product (EcomProducts table).
Property Value
Remarks
Does not use the stock providers or get the stock levels from ERP in integrated solutions.
Use Stock
StockGroupId
Gets or sets StockGroupID.
Property Value
TaxCollection
Gets the tax collection.
Property Value
Type
Gets or sets the type of the product (stock item, service, giftCard or parts list).
Property Value
UnitCount
Gets or sets the unit counting.
Property Value
Updated
Gets or sets the date when the product was updated.
Property Value
VariantId
Gets or sets VariantID.
Property Value
VirtualVariantId
Gets or sets VirtualVariantID.
Property Value
Volume
Gets or sets the product volume.
Property Value
Weight
Gets or sets the product weight.
Property Value
Width
Gets or sets product width
Property Value
Remarks
Related field Dynamicweb.
WorkflowStateId
Gets or sets the workflow state.
Property Value
- int
The workflow state.