Constructor
new MerlinsConnector()
- Implements:
- module:connectors/interfaces.CommerceConnector
- Source:
Methods
(static) fromConfig(config) → {module:types.MerlinsConnector}
Given a configuration in the form of a plain object, this method returns a new MerlinsConnector instance.
Parameters:
| Name | Type | Description |
|---|---|---|
config |
Object |
- Source:
Returns:
The new MerlinsConnector instance.
- Type
- module:types.MerlinsConnector
addCartItem()
- Source:
addCouponEntry()
- Source:
createCart()
- Source:
createOrder()
- Source:
deleteCart()
- Source:
getCart()
- Source:
getCategories()
- Source:
getCategory()
- Source:
getCustomer()
- Source:
getOrder()
- Source:
getOrders()
- Source:
getPaymentMethods()
- Source:
getProduct()
- Source:
getProducts()
- Source:
getSearchUrl(productSearchRequest) → {String}
Takes commerce-integrations ProductSearchRequest type and returns the URL representation used to query the website.
Parameters:
| Name | Type | Description |
|---|---|---|
productSearchRequest |
module:types.ProductSearchRequest |
- Source:
Returns:
- Type
- String
getShippingMethods()
- Source:
getStore()
- Source:
login()
- Source:
logout()
- Source:
parseCartItem()
Parse a cart item cart item will not have price until a payment is set.
- Source:
parseCartTotals()
Parse the cart money totals totals not calculated until shipping address/method is set.
- Source:
parseCategory(htmlDoc) → {Promise.<module:types.Category>}
Takes a html element that represents a category and parses it into a commerce-integrations Category type.
Parameters:
| Name | Type | Description |
|---|---|---|
htmlDoc |
Object | a Element object |
- Source:
Returns:
- Type
- Promise.<module:types.Category>
parseCouponEntry()
Parse a coupon item
- Source:
parseFilter(optionEl) → {module:types.Filter}
Takes a dom element representing a merlins filter and parses out an commerce-integrations Filter type.
Parameters:
| Name | Type | Description |
|---|---|---|
optionEl |
Object | a Element object |
- Source:
Returns:
- Type
- module:types.Filter
parseFilters(filterOptionsEl, currentUrl) → {Array.<module:types.Filter>}
Takes a dom element and parses out an array of commerce-integrations Filter type.
Parameters:
| Name | Type | Description |
|---|---|---|
filterOptionsEl |
Object | a Element object |
currentUrl |
String | The current page url used to help determine filter values. |
- Source:
Returns:
- Type
- Array.<module:types.Filter>
parseOrder()
- Source:
parseOrderAddress()
Parse an order address
- Source:
parsePaymentMethod()
Parse a payment method
- Source:
parseProduct(data) → {Promise.<module:types.Store>}
Takes a OCAPI Product object and parses it into a commerce-integrations Product type.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object | a OCAPI Product document |
- Source:
Returns:
- Type
- Promise.<module:types.Store>
parseProductSearchResult(productEl) → {module:types.ProductSearchResult}
Takes a dom element representing a merlins search result product tile and parses out an commerce-integrations ProductSearchResult type.
Parameters:
| Name | Type | Description |
|---|---|---|
productEl |
Object | a Element object |
- Source:
Returns:
parseSearchProducts()
- Source:
parseSelectedFilter(selectedEl, currentUrl) → {module:types.Filter}
Takes a dom element representing a merlins selected filter and parses out a commerce-integrations Filter type.
Parameters:
| Name | Type | Description |
|---|---|---|
selectedEl |
Object | a Element object |
currentUrl |
String | The current page url used to help determine filter values. |
- Source:
Returns:
- Type
- module:types.Filter
parseSelectedFilters(selectedFiltersEl, currentUrl) → {Array.<module:types.Filter>}
Takes a dom element and parses out an array of commerce-integrations Filter type representing those filters that are selected.
Parameters:
| Name | Type | Description |
|---|---|---|
selectedFiltersEl |
Object | a Element object |
currentUrl |
String | The current page url used to help determine filter values. |
- Source:
Returns:
- Type
- Array.<module:types.Filter>
parseShippingMethod()
Parse a shipping method
- Source:
parseSortingOptions(sortEl) → {Array.<module:types.SortOption>}
Takes a dom element representing a merlins sorting select and parses out an array od commerce-integrations SortOption type.
Parameters:
| Name | Type | Description |
|---|---|---|
sortEl |
Object | a Element object |
- Source:
Returns:
- Type
- Array.<module:types.SortOption>
refreshSession()
- Source:
registerCustomer(data) → {Promise.<module:types/Customer>}
Register a new customer account and login.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
module:types/CustomerRegistration |
- Source:
Returns:
- Type
- Promise.<module:types/Customer>
removeCartItem()
- Source:
removeCouponEntry()
- Source:
searchProducts()
- Source:
searchStores()
- Source:
setBillingAddress()
- Source:
setCustomerInformation()
This updates the given cart object with the given customerInformation object and returns it. It will not persist in the backend until a payment is added.
- Source:
setPayment()
- Source:
setShippingAddress()
- Source:
setShippingMethod()
- Source:
updateCartItem()
- Source: