Table of Contents

Class PriceManager

Namespace
Dynamicweb.Ecommerce.Prices
Assembly
Dynamicweb.Ecommerce.dll

Represents a price manager. Provides prepares and finds prices.

public static class PriceManager
Inheritance
PriceManager
Inherited Members

Examples

using Dynamicweb.Ecommerce.Prices;
using Dynamicweb.Ecommerce.Products;

namespace Dynamicweb.Ecommerce.Examples.Prices;

class PriceManagerSample : PriceManager
{
    public PriceInfo GetCustomerPrice(PriceContext context, Product product)
    {
        PriceInfo customerPrice = GetPrice(context, product);

        //find your own price
        if (context.Customer is not null && context.Customer.CustomerNumber.StartsWith("abc"))
            customerPrice.Multiply(0.5);

        return customerPrice;
    }
}

Methods

FindPrice(PriceContext, PriceProductSelection, bool)

public static object FindPrice(PriceContext context, PriceProductSelection selection, bool isInformative)

Parameters

context PriceContext
selection PriceProductSelection
isInformative bool

Returns

object

FindPrice(PriceContext, Product, string, long, bool)

public static object FindPrice(PriceContext context, Product product, string unitId, long stockLocationId, bool isInformative)

Parameters

context PriceContext
product Product
unitId string
stockLocationId long
isInformative bool

Returns

object

GetInformativePrice(PriceContext, Product)

Gets the informative price for a given product.

public static PriceInfo GetInformativePrice(PriceContext context, Product product)

Parameters

context PriceContext

Price context

product Product

Product

Returns

PriceInfo

Informative price

GetInformativePrice(PriceContext, Product, string, long)

Gets the informative price for a given product.

public static PriceInfo GetInformativePrice(PriceContext context, Product product, string unitId, long stockLocationId)

Parameters

context PriceContext

Price context

product Product

Product

unitId string

Unit identifier

stockLocationId long

Stock location identifier

Returns

PriceInfo

Informative price

GetPrice(PriceContext, Product)

Gets the price for a given product.

public static PriceInfo GetPrice(PriceContext context, Product product)

Parameters

context PriceContext

Price context

product Product

Product

Returns

PriceInfo

Price

GetPrice(PriceContext, Product, string, long)

Gets the price for a given product.

public static PriceInfo GetPrice(PriceContext context, Product product, string unitId, long stockLocationId)

Parameters

context PriceContext

Price context

product Product

Product

unitId string

Unit identifier

stockLocationId long

Stock location identifier

Returns

PriceInfo

Price

GetQuantityPrices(PriceContext, Product)

Gets all quantity prices for a given product.

public static IEnumerable<KeyValuePair<PriceQuantityInfo, PriceInfo>> GetQuantityPrices(PriceContext context, Product product)

Parameters

context PriceContext

Price context

product Product

Product

Returns

IEnumerable<KeyValuePair<PriceQuantityInfo, PriceInfo>>

All applicable quantity prices for a product in a given context.

PreparePrices(PriceContext, IEnumerable<PriceProductSelection>)

Prepares the prices.

public static void PreparePrices(PriceContext context, IEnumerable<PriceProductSelection> selections)

Parameters

context PriceContext

The price context.

selections IEnumerable<PriceProductSelection>

The product selections.

PreparePrices(PriceContext, IEnumerable<Product>)

Prepares the prices.

public static void PreparePrices(PriceContext context, IEnumerable<Product> products)

Parameters

context PriceContext

The price context.

products IEnumerable<Product>

The products.

PreparePrices(PriceContext, IEnumerable<Product>, long)

Prepares the prices.

public static void PreparePrices(PriceContext context, IEnumerable<Product> products, long stockLocationId)

Parameters

context PriceContext

The price context.

products IEnumerable<Product>

The products.

stockLocationId long

Stock location identifier

To top