Table of Contents

Class ProductRelated

Namespace
Dynamicweb.Ecommerce.Products
Assembly
Dynamicweb.Ecommerce.dll
Represents information about related products.
[Serializable]
public class ProductRelated
Inheritance
ProductRelated
Inherited Members

Examples

using Dynamicweb.Ecommerce.Products;

namespace Dynamicweb.Ecommerce.Examples.Products
{
    public class ProductGroupRelationSaveHandlerSample
    {
        public void SaveProduct(string prodId, string groupId)
        {
            var productGroupRelation = new ProductGroupRelation(prodId, groupId)
            {
                ProductId = prodId,
                GroupId = groupId
            };
            productGroupRelation.Save(prodId, groupId);
        }
    }
}

Constructors

ProductRelated()

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

ProductRelated(IDataReader)

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

Parameters

dataReader IDataReader
DataReader.

ProductRelated(string, string, string)

Initializes a new instance of the ProductRelated class.
[Obsolete("Use Services.ProductRelated.GetProductRelated instead")]
public ProductRelated(string theProductId, string theRelatedProductId, string relatedProductGroupId)

Parameters

theProductId string
DB field name is ProductRelatedProductID.
theRelatedProductId string
DB field name is ProductRelatedProductRelID.
relatedProductGroupId string
DB field name is ProductRelatedGroupID.

ProductRelated(string, string, string, string)

Initializes a new instance of the ProductRelated class.
[Obsolete("Use Services.ProductRelated.GetProductRelated instead")]
public ProductRelated(string theProductId, string theRelatedProductId, string prodRelVariantIdStr, string relatedProductGroupId)

Parameters

theProductId string
DB field name is ProductRelatedProductID.
theRelatedProductId string
DB field name is ProductRelatedProductRelID.
prodRelVariantIdStr string
DB field name is ProductRelatedProductRelVariantID.
relatedProductGroupId string
DB field name is ProductRelatedGroupID.

Properties

Countries

Gets or sets the countries collection.
public List<string> Countries { get; set; }

Property Value

List<string>

Languages

Gets or sets the languages collection.
public List<string> Languages { get; set; }

Property Value

List<string>

Product

Gets the related product.
public Product Product { get; }

Property Value

Product
The product.

ProductId

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

Property Value

string
The product ID.

RelatedGroupId

Gets or sets the related group ID.
public string RelatedGroupId { get; set; }

Property Value

string
The related group ID.

RelatedProductId

Gets or sets the related product ID.
public string RelatedProductId { get; set; }

Property Value

string
The related product ID.

RelatedProductVariantId

Gets or sets the related product variant ID.
public string RelatedProductVariantId { get; set; }

Property Value

string
The related product variant ID.

Shops

Gets or sets the shops collection.
public List<string> Shops { get; set; }

Property Value

List<string>

SortOrder

Gets or sets the sort order.
public int SortOrder { get; set; }

Property Value

int
The sort order.

VariantOptions

Gets or sets the variant options collection.
public List<string> VariantOptions { get; set; }

Property Value

List<string>

Methods

ClearCache()

Clears the cache.
[Obsolete("Use Services.ProductRelated.ClearCache instead")]
public static void ClearCache()

Delete()

Deletes this instance from DB.
[Obsolete("Use Services.ProductRelated.Delete instead")]
public void Delete()

Delete(ProductCollection)

[Obsolete("Use Delete(IEnumerable<Product> products) method instead.")]
public string Delete(ProductCollection products)

Parameters

products ProductCollection

Returns

string

Delete(ProductCollection, bool)

[Obsolete("Use Delete(IEnumerable<Product> products, bool run) method instead.")]
public string Delete(ProductCollection products, bool run)

Parameters

products ProductCollection
run bool

Returns

string

Delete(IEnumerable<Product>)

Deletes the instance from DB.
[Obsolete("Use Services.ProductRelated.Delete instead")]
public CommandBuilder Delete(IEnumerable<Product> products)

Parameters

products IEnumerable<Product>
The products.

Returns

CommandBuilder
The SQL query

Delete(IEnumerable<Product>, bool)

Deletes the instance from DB.
[Obsolete("Use Services.ProductRelated.Delete instead")]
public CommandBuilder Delete(IEnumerable<Product> products, bool run)

Parameters

products IEnumerable<Product>
The products.
run bool
if set to true to delete.

Returns

CommandBuilder
The SQL query

Delete(string)

Deletes the instance from DB.
[Obsolete("Use Services.ProductRelated.Delete instead")]
public static void Delete(string theProductId)

Parameters

theProductId string
The ProductRelatedProductID.

Delete(string, string)

Deletes the instance from DB.
[Obsolete("Use Services.ProductRelated.Delete instead")]
public static void Delete(string theProductId, string theRelatedProductId)

Parameters

theProductId string
The ProductRelatedProductID.
theRelatedProductId string
The ProductRelatedProductRelID.

Delete(string, string, string)

Deletes the instance from DB.
[Obsolete("Use Services.ProductRelated.Delete instead")]
public static void Delete(string theProductId, string theRelatedProductId, string relatedProductGroupId)

Parameters

theProductId string
The ProductRelatedProductID.
theRelatedProductId string
The ProductRelatedProductRelID.
relatedProductGroupId string
The ProductRelatedGroupID.

Delete(string, string, string, string)

Deletes the instance from DB.
[Obsolete("Use Services.ProductRelated.Delete instead")]
public static void Delete(string theProductId, string theRelatedProductId, string prodRelVariantIdStr, string relatedProductGroupId)

Parameters

theProductId string
The ProductRelatedProductID.
theRelatedProductId string
The ProductRelatedProductRelID.
prodRelVariantIdStr string
The ProductRelatedProductRelVariantID.
relatedProductGroupId string
The ProductRelatedGroupID.

GetRelatedProducts(string)

Gets the related products.
[Obsolete("Use Services.ProductRelated.GetRelations instead")]
public static IEnumerable<ProductRelated> GetRelatedProducts(string productId)

Parameters

productId string
DB field name is ProductRelatedProductID.

Returns

IEnumerable<ProductRelated>

GetRelatedProducts(string, string)

Gets the related products.
[Obsolete("Use Services.ProductRelated.GetRelations instead")]
public static IEnumerable<ProductRelated> GetRelatedProducts(string productId, string relatedGroupId)

Parameters

productId string
DB field name is ProductRelatedProductID.
relatedGroupId string
DB field name is ProductRelatedGroupID.

Returns

IEnumerable<ProductRelated>

ProductRelationCheck(string, string)

Gets the ProductRelatedCollection object.
[Obsolete("Use Services.ProductRelated.GetRelations instead")]
public static IEnumerable<ProductRelated> ProductRelationCheck(string productId, string relatedProductId)

Parameters

productId string
DB field name is ProductRelatedProductID.
relatedProductId string
DB field name is ProductRelatedProductRelID.

Returns

IEnumerable<ProductRelated>

ProductRelationCheck(string, string, string)

Gets the ProductRelatedCollection object.
[Obsolete("Use Services.ProductRelated.GetRelations instead")]
public static IEnumerable<ProductRelated> ProductRelationCheck(string productId, string relatedProductId, string relatedProductGroupId)

Parameters

productId string
DB field name is ProductRelatedProductID.
relatedProductId string
DB field name is ProductRelatedProductRelID.
relatedProductGroupId string
DB field name is ProductRelatedGroupID.

Returns

IEnumerable<ProductRelated>

ProductRelationCheck(string, string, string, string)

Gets the ProductRelatedCollection object.
[Obsolete("Use Services.ProductRelated.GetRelations instead")]
public static IEnumerable<ProductRelated> ProductRelationCheck(string productId, string relatedProductId, string prodRelVariantId, string relatedProductGroupId)

Parameters

productId string
DB field name is ProductRelatedProductID.
relatedProductId string
DB field name is ProductRelatedProductRelID.
prodRelVariantId string
DB field name is ProductRelatedRelVariantID.
relatedProductGroupId string
DB field name is ProductRelatedGroupID.

Returns

IEnumerable<ProductRelated>

Save(string, string)

Saves the properties into DB.
[Obsolete("Use Services.ProductRelated.Save instead")]
public void Save(string theProductId, string theRelatedProductId)

Parameters

theProductId string
DB field name is ProductRelatedProductID.
theRelatedProductId string
DB field name is ProductRelatedProductRelID.

Save(string, string, string)

Saves the properties into DB.
[Obsolete("Use Services.ProductRelated.Save instead")]
public void Save(string theProductId, string theRelatedProductId, string relatedProductGroupId)

Parameters

theProductId string
DB field name is ProductRelatedProductID.
theRelatedProductId string
DB field name is ProductRelatedProductRelID.
relatedProductGroupId string
DB field name is ProductRelatedGroupID.

SetProperties()

Sets empty string for the properties ProdID, ProdRelID, RelGroupID.
[Obsolete("This member is no longer used")]
public void SetProperties()
To top