Class StoreHelper
Store helper.
Inheritance
Inherited Members
Namespace: Mediachase.Commerce.Website.Helpers
Assembly: Mediachase.Commerce.Website.dll
Version: 10.8.0Syntax
public class StoreHelper
Constructors
StoreHelper()
Declaration
public StoreHelper()
Methods
AddBrowseHistory(String, String)
Adds the browse history.
Declaration
public static void AddBrowseHistory(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.String | value | The value. |
CheckAddressesEquality(CustomerAddress, CustomerAddress)
Checks if 2 customer addresses are the same (have same first, last names, city, state,...). Address ids and names are ignored.
Declaration
public static bool CheckAddressesEquality(CustomerAddress address1, CustomerAddress address2)
Parameters
Type | Name | Description |
---|---|---|
CustomerAddress | address1 | |
CustomerAddress | address2 |
Returns
Type | Description |
---|---|
System.Boolean |
ConvertToCustomerAddress(OrderAddress)
Converts to customer address.
Declaration
public static CustomerAddress ConvertToCustomerAddress(OrderAddress address)
Parameters
Type | Name | Description |
---|---|---|
OrderAddress | address | The address. |
Returns
Type | Description |
---|---|
CustomerAddress |
ConvertToOrderAddress(CustomerAddress)
Converts to order address.
Declaration
public static OrderAddress ConvertToOrderAddress(CustomerAddress address)
Parameters
Type | Name | Description |
---|---|---|
CustomerAddress | address | The address. |
Returns
Type | Description |
---|---|
OrderAddress |
GetAddressName(OrderAddress)
Declaration
public static string GetAddressName(OrderAddress orderAddress)
Parameters
Type | Name | Description |
---|---|---|
OrderAddress | orderAddress |
Returns
Type | Description |
---|---|
System.String |
GetAddressString(OrderAddress)
Returns address formatted as a string
Declaration
public static string GetAddressString(OrderAddress info)
Parameters
Type | Name | Description |
---|---|---|
OrderAddress | info | The info. |
Returns
Type | Description |
---|---|
System.String |
GetBasePrice(Entry)
Gets the discount price by current market.
Declaration
public static Price GetBasePrice(Entry entry)
Parameters
Type | Name | Description |
---|---|---|
Entry | entry | The entry. |
Returns
Type | Description |
---|---|
Price |
GetBasePrice(Entry, Int32)
Gets the current price by current market with min quantity.
Declaration
public static Price GetBasePrice(Entry entry, int minQuantity)
Parameters
Type | Name | Description |
---|---|---|
Entry | entry | The entry. |
System.Int32 | minQuantity | The min quantity. |
Returns
Type | Description |
---|---|
Price |
GetBrowseHistory()
Gets the browse history.
Declaration
public static NameValueCollection GetBrowseHistory()
Returns
Type | Description |
---|---|
System.Collections.Specialized.NameValueCollection |
GetDiscountPrice(Entry)
Gets the discount price.
Declaration
public static Price GetDiscountPrice(Entry entry)
Parameters
Type | Name | Description |
---|---|---|
Entry | entry | The entry. |
Returns
Type | Description |
---|---|
Price |
GetDiscountPrice(Entry, String)
Gets the discount price.
Declaration
public static Price GetDiscountPrice(Entry entry, string catalogName)
Parameters
Type | Name | Description |
---|---|---|
Entry | entry | The entry. |
System.String | catalogName | Name of the catalog. |
Returns
Type | Description |
---|---|
Price |
GetDiscountPrice(Entry, String, String)
Gets the discount price by evaluating the discount rules and taking into account segments customer belongs to.
Declaration
public static Price GetDiscountPrice(Entry entry, string catalogName, string catalogNodeCode)
Parameters
Type | Name | Description |
---|---|---|
Entry | entry | The entry. |
System.String | catalogName | Name of the catalog to filter the discounts for. If null, all catalogs entry belongs to will be applied. |
System.String | catalogNodeCode | The catalog node code to filter the discounts for. If null, all catalog nodes entry belongs to will be applied. |
Returns
Type | Description |
---|---|
Price |
GetDiscountPrice(Entry, String, String, IMarket)
Gets the discounted price of the catalog entry.
Declaration
public static Price GetDiscountPrice(Entry entry, string catalogName, string catalogNodeCode, IMarket market)
Parameters
Type | Name | Description |
---|---|---|
Entry | entry | The catalog entry. |
System.String | catalogName | Name of the catalog to filter the discounts for. If null, all catalogs containing the entry will be used. |
System.String | catalogNodeCode | The catalog node code to filter the discounts for. If null, all catalog nodes containing the entry will be used. |
IMarket | market | The market to fetch tiered base pricing for. |
Returns
Type | Description |
---|---|
Price | The discounted price of the catalog entry. |
Remarks
Uses market.DefaultCurrency for the currency.
GetDiscountPrice(Entry, String, String, IMarket, Currency)
Gets the discounted price of the catalog entry.
Declaration
public static Price GetDiscountPrice(Entry entry, string catalogName, string catalogNodeCode, IMarket market, Currency currency)
Parameters
Type | Name | Description |
---|---|---|
Entry | entry | The catalog entry. |
System.String | catalogName | Name of the catalog to filter the discounts for. If null, all catalogs containing the entry will be used. |
System.String | catalogNodeCode | The catalog node code to filter the discounts for. If null, all catalog nodes containing the entry will be used. |
IMarket | market | The market to fetch tiered base pricing for. |
Currency | currency | The currency to fetch prices in. |
Returns
Type | Description |
---|---|
Price | The discounted price of the catalog entry. |
GetEntryDisplayName(Entry)
Gets the display name of the entry. Returns localized version or the product name if no localized version available.
Declaration
public static string GetEntryDisplayName(Entry entry)
Parameters
Type | Name | Description |
---|---|---|
Entry | entry | The entry. |
Returns
Type | Description |
---|---|
System.String |
GetEntryUrl(Entry)
Gets the entry URL.
Declaration
public static string GetEntryUrl(Entry entry)
Parameters
Type | Name | Description |
---|---|---|
Entry | entry | The entry. |
Returns
Type | Description |
---|---|
System.String |
GetInventoryStatus(Entry)
Gets the inventory status.
Declaration
public static string GetInventoryStatus(Entry entry)
Parameters
Type | Name | Description |
---|---|---|
Entry | entry | The entry. |
Returns
Type | Description |
---|---|
System.String |
GetItemsInStock(Entry)
Gets the items in stock.
Declaration
public static decimal GetItemsInStock(Entry entry)
Parameters
Type | Name | Description |
---|---|---|
Entry | entry | The entry. |
Returns
Type | Description |
---|---|
System.Decimal |
GetLanguageSeo(Seo[])
Gets the language seo.
Declaration
public static Seo GetLanguageSeo(Seo[] seoInfo)
Parameters
Type | Name | Description |
---|---|---|
Seo[] | seoInfo | The seo info. |
Returns
Type | Description |
---|---|
Seo |
GetNodeDisplayName(CatalogNode)
Gets the display name of the node.
Declaration
public static string GetNodeDisplayName(CatalogNode node)
Parameters
Type | Name | Description |
---|---|---|
CatalogNode | node | The node. |
Returns
Type | Description |
---|---|
System.String |
GetNodeUrl(CatalogNode)
Gets the node URL.
Declaration
public static string GetNodeUrl(CatalogNode node)
Parameters
Type | Name | Description |
---|---|---|
CatalogNode | node | The node. |
Returns
Type | Description |
---|---|
System.String |
GetQuantityAsString(Decimal)
Gets the quantity as string.
Declaration
public static string GetQuantityAsString(decimal quantity)
Parameters
Type | Name | Description |
---|---|---|
System.Decimal | quantity | The quantity. |
Returns
Type | Description |
---|---|
System.String |
GetSalePrice(Entry, Decimal)
Gets the sale price. The current culture info currency code will be used.
Declaration
public static Price GetSalePrice(Entry entry, decimal quantity)
Parameters
Type | Name | Description |
---|---|---|
Entry | entry | The entry. |
System.Decimal | quantity | The quantity. |
Returns
Type | Description |
---|---|
Price | Price |
GetSalePrice(Entry, Decimal, IMarket)
Gets the sale price. The current culture info currency code will be used.
Declaration
public static Price GetSalePrice(Entry entry, decimal quantity, IMarket market)
Parameters
Type | Name | Description |
---|---|---|
Entry | entry | The entry. |
System.Decimal | quantity | The quantity. |
IMarket | market | Market for filtering. |
Returns
Type | Description |
---|---|
Price | Price |
GetSalePrice(Entry, Decimal, IMarket, Currency)
Gets the sale price.
Declaration
public static Price GetSalePrice(Entry entry, decimal quantity, IMarket market, Currency currency)
Parameters
Type | Name | Description |
---|---|---|
Entry | entry | The entry used to fetch prices. |
System.Decimal | quantity | The quantity. |
IMarket | market | The market. |
Currency | currency | The currency. |
Returns
Type | Description |
---|---|
Price |
GetSalePrice(String, Decimal, IMarket, Currency)
Gets the sale price.
Declaration
public static Price GetSalePrice(string entryCode, decimal quantity, IMarket market, Currency currency)
Parameters
Type | Name | Description |
---|---|---|
System.String | entryCode | The code of the entry. |
System.Decimal | quantity | The quantity. |
IMarket | market | The market. |
Currency | currency | The currency. |
Returns
Type | Description |
---|---|
Price |
IsAddressInCollection(IEnumerable<CustomerAddress>, CustomerAddress)
Checks if customer address collection already contains the specified address.
Declaration
public static bool IsAddressInCollection(IEnumerable<CustomerAddress> collection, CustomerAddress address)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<CustomerAddress> | collection | Customer addresses collection (Profile.Account.Addresses). |
CustomerAddress | address | Address to check. |
Returns
Type | Description |
---|---|
System.Boolean | True, if address is already in the collection. |
Remarks
Only address' properties are checked (like first, last name, city, state,...). Address name and addressId are ignored.
IsAvailableForBackorder(Entry)
Determines whether [is available for backorder] [the specified entry].
Declaration
public static bool IsAvailableForBackorder(Entry entry)
Parameters
Type | Name | Description |
---|---|---|
Entry | entry | The entry. |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsAvailableForPreorder(Entry)
Determines whether [is available for preorder] [the specified entry].
Declaration
public static bool IsAvailableForPreorder(Entry entry)
Parameters
Type | Name | Description |
---|---|---|
Entry | entry | The entry. |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsCustomerAddressAlreadyExistInContact(CustomerContact, CustomerAddress)
Declaration
public static bool IsCustomerAddressAlreadyExistInContact(CustomerContact contact, CustomerAddress address)
Parameters
Type | Name | Description |
---|---|---|
CustomerContact | contact | |
CustomerAddress | address |
Returns
Type | Description |
---|---|
System.Boolean |
IsInStock(Entry)
Determines whether entry is in stock.
Declaration
public static bool IsInStock(Entry entry)
Parameters
Type | Name | Description |
---|---|---|
Entry | entry | The entry. |
Returns
Type | Description |
---|---|
System.Boolean |
|
LoadPaymentPlugin(UserControl, String)
Loads the payment plugin.
Declaration
public static Control LoadPaymentPlugin(UserControl control, string keyword)
Parameters
Type | Name | Description |
---|---|---|
System.Web.UI.UserControl | control | The control. |
System.String | keyword | The keyword. |
Returns
Type | Description |
---|---|
System.Web.UI.Control |
SumInventories(IEnumerable<IWarehouseInventory>)
Gets all item in stock.
Declaration
[Obsolete("Use overload with IEnumerable<Mediachase.Commerce.InventoryService.InventoryRecord. Will remain at least until October 2017")]
public static IWarehouseInventory SumInventories(IEnumerable<IWarehouseInventory> inventories)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IWarehouseInventory> | inventories | The WarehouseInventory. |
Returns
Type | Description |
---|---|
IWarehouseInventory |
SumInventories(IEnumerable<InventoryRecord>)
Gets all item in stock.
Declaration
public static InventoryRecord SumInventories(IEnumerable<InventoryRecord> inventories)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<InventoryRecord> | inventories | The WarehouseInventory. |
Returns
Type | Description |
---|---|
InventoryRecord |