new AboutYou() → {AboutYou}
Properties:
| Name | Type | Description |
|---|---|---|
appId |
string | |
appPassword |
string | |
apiEndPoint |
string | 'live' for live environment, 'stage' for staging | default: 'live' |
- Source:
Returns:
AboutYou instance
- Type
- AboutYou
Methods
-
fetchAutocomplete(searchword, limit, types)
-
Returns the result of an auto completion API request. Auto completion searches for products and categories by a given prefix (searchword).
Parameters:
Name Type Description searchwordstring The prefix search word to search for. limitnumber Maximum number of results. typesArray.<string> Array of types to search for. - Source:
Returns:
Autocomplete -
fetchCategoriesByIds(ids)
-
Returns the result of a category search API request. By passing one or several category ids it will return a result of the categories data.
Parameters:
Name Type Description idsnumber | Array.<number> either a single category ID as integer or an array of IDs - Deprecated:
- use the CategoryManager instead of
- Source:
- See:
Returns:
CategoriesResult -
fetchCategoryTree(cb)
-
Parameters:
Name Type Description cbrequestCallback The callback that handles the response - Deprecated:
- use the CategoryManager instead of
- Source:
- See:
Returns:
CategoryTree -
fetchFacets(groupIds) → {Array.<Facet>}
-
Fetch the facets of the given groupIds.
Parameters:
Name Type Description groupIdsArray.<string> | Array.<number> The group ids. - Source:
Returns:
With facet id as key.- Type
- Array.<Facet>
-
fetchProductsByEans(array, required)
-
Parameters:
Name Type Description arrayArray.<number> of a product's variant ean requiredArray.<string> product fields - Source:
- See:
-
- https://developer.aboutyou.de/doc/products#produkte-anhand-der-id-oder-ean-auslesen for further information on product ids and variant eans
- https://developer.aboutyou.de/doc/products#produktfelder for further information on product fields
Returns:
ProductsEansResult -
fetchProductsByIds(array, required)
-
Parameters:
Name Type Description arrayArray.<number> of product ids requiredArray.<string> product fields - Source:
- See:
-
- https://developer.aboutyou.de/doc/products#produktfelder for further information on product fields
Returns:
ProductsResult -
fetchProductSearch(ProductSearchCriteria)
-
Parameters:
Name Type Description ProductSearchCriteriacriteria - Source:
Returns:
ProductSearchResult -
fetchSuggest(searchword) → {Array.<string>}
-
Returns the result of a suggest API request. Suggestions are words that are often searched together with the searchword you pass (e.g. "stretch" for "jeans").
Parameters:
Name Type Description searchwordstring The search string to search for. - Source:
Returns:
- Type
- Array.<string>
-
fetchVariantsByIds(ids)
-
Parameters:
Name Type Description idsArray.<integer> - Source:
Returns:
VariantsResult -
getApiEndPoint()
-
- Source:
Returns:
string -
getAppId() → {string}
-
- Source:
Returns:
- Type
- string
-
getCategoryManager(fetchIfEmpty)
-
The Categories will be fetch automatically, if required by any other fetch method
Parameters:
Name Type Description fetchIfEmptyboolean - Source:
Returns:
DefaultCategoryManagerExample
aboutYou.fetchProductsByIds([12345], ['categories']).then(function(products) { // will fetch the categories with the same request. }); aboutYou.getCategoryManager().getCategoryTree().then(function(categories) { // will give you all categories for your Menu without an other request }); -
getClient()
-
- Source:
Returns:
Client -
getJavaScriptURL() → {string}
-
Returns the URL to the ABOUT YOU JavaScript file for helper functions to add product variants into the basket of Mary & Paul or auto-resizing the Iframe. This URL may be changed in future, so please use this method instead of hardcoding the URL into your HTML template.
- Source:
Returns:
URL to the JavaScript file- Type
- string
-
getProductFields() → {Object}
-
Returns a list of all available product fields
- Source:
- See:
-
- https://developer.aboutyou.de/doc/products#produktfelder for further information on product fields
Returns:
object keys contain all available product fields- Type
- Object
-
getProductSearchCriteria(sessionId)
-
Parameters:
Name Type Description sessionIdstring | null - Source:
Returns:
ProductSearchCriteria -
getResultFactory() → {DefaultModelFactory}
-
- Source:
Returns:
- Type
- DefaultModelFactory
-
getSessionId()
-
- Source:
Returns:
string -
initDefaultFactory(cache) → {DefaultModelFactory}
-
Parameters:
Name Type Description cacheCache | null - Source:
Returns:
- Type
- DefaultModelFactory
-
setApiEndpoint(apiEndPoint)
-
Parameters:
Name Type Description apiEndPointstring the endpoint can be the string 'stage' or 'live', then the default endpoints will be used or an absolute url - Source:
-
setAppCredentials(appId, appPassword)
-
Parameters:
Name Type Description appIdstring the app id for client authentication appPasswordstring the app password/token for client authentication. - Source:
-
setBaseImageUrl(baseImageUrl)
-
Parameters:
Name Type Description baseImageUrlnull | false | string null will reset to the default url, false to get relative urls, otherwise the url prefix - Source:
-
setResultFactory(modelFactory)
-
Parameters:
Name Type Description modelFactoryDefaultModelFactory - Source: