> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: getRecommendations(options: Options, context: Context) # Method package: wixEcom # Method menu location: wixEcom --> EcomRecommendations --> getRecommendations # Method Link: https://dev.wix.com/docs/velo/events-service-plugins/e-commerce/service-plugins/ecom-recommendations/get-recommendations.md # Method Description: Retrieves the recommended items provided by your plugin. The `getRecommendations()` function is called by Wix to gather the recommended items based on the selected algorithm. It returns recommendations based on the specified options. ### Where to find `getRecommendations()` When you [add the Recommendations service plugin](https://dev.wix.com/docs/develop-websites/articles/code-tutorials/wix-e-commerce-stores/tutorial-e-commerce-recommendations-service-plugin.md), a folder is automatically added to your site. Use the `.js` file in the folder to write the code to determine which recommended items to retrieve. For more information on customizing your recommendations plugin, see [Recommendations Service Plugin](https://dev.wix.com/docs/develop-websites/articles/code-tutorials/wix-e-commerce-stores/tutorial-e-commerce-recommendations-service-plugin.md). # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Get Recommendations ```javascript import wixData from "wix-data"; /** * Returns lists of items recommended by each requested algorithm. * * If the algorithm's type is `RELATED_ITEMS` then the `items` field is required in the request, and the response will contain items related to those submitted. * How the related items are selected based on the requested items depends on the algorithm. Some examples include items related by category or those frequently bought or watched together. * @param {import('interfaces-ecom-v1-recommendations-provider').GetRecommendationsOptions} options * @param {import('interfaces-ecom-v1-recommendations-provider').Context} context * @returns {Promise} */ export const getRecommendations = async (options, context) => { const recommendations = await Promise.all( options.algorithmIds.map((algorithmId) => { if (algorithmId == "97f48eb2-4d42-4296-b620-13862dd0353e") { return wixData .query("Stores/Products") .ascending("price") .limit(10) .find() .then((results) => { return { algorithmId: algorithmId, recommendedItems: results.items.map((item) => { return { catalogItemId: item._id, appId: "215238eb-22a5-4c36-9e7b-e7c08025e04e", }; }), }; }); } }), ); return { recommendationPerAlgorithm: recommendations, }; }; ``` ---