Automatic Related Products API
1. Amasty\Mostviewed\Api\GroupRepositoryInterface - class for managing related product rules.
- POST /V1/amasty_mostviewed/rules", method="save" - create a rule;
- PUT /V1/amasty_mostviewed/rules/:groupId, method="save" - edit a rule;
- DELETE /V1/amasty_mostviewed/rules/:groupId", method="deleteById" - delete a rule by its ID;
- GET /V1/amasty_mostviewed/rules/:groupId", method="getById" - get a rule by its ID;
- GET /V1/amasty_mostviewed/rules", method="getList" - get a list of rules.
2. Amasty\Mostviewed\Api\ProductGroupResolverInterface - class for managing rules for product pages.
- GET /V1/amasty_mostviewed/rules/product-group-by-id", method="getGroupByProductIdAndPosition" - get a group for product pages by product ID and position;
- GET /V1/amasty_mostviewed/rules/product-group-by-sku", method="getGroupByProductSkuAndPosition" - get a group for product pages by product and position
3. Amasty\Mostviewed\Api\CategoryGroupResolverInterface - class for managing rules for category pages.
- GET /V1/amasty_mostviewed/rules/category-group", method="getGroupByCategoryIdAndPosition - get a group for category pages by category ID and position.
4. Amasty\Mostviewed\Api\CartGroupResolverInterface - class for managing rules for shopping cart pages.
- GET /V1/amasty_mostviewed/rules/guest-cart-group/:maskedCartId", method="getGroupByMaskedQuoteIdAndPosition" - get a group for shopping cart pages by positiob for not logged-in customers;
- GET /V1/amasty_mostviewed/rules/cart-group", method="getGroupByQuoteIdAndPosition" - get a group for shopping cart pages.
5. Amasty\Mostviewed\Api\CustomGroupResolverInterface - class for managing rules with custom positions (for example, CMS pages).
- GET /V1/amasty_mostviewed/rules/custom-group", method="getGroup"- get a group with custom position by its ID;
- GET /V1/amasty_mostviewed/rules/custom-group-for-product", method="getGroupForProduct" - get a group with custom position by product ID;
- GET /V1/amasty_mostviewed/rules/custom-group-for-guest-cart/:maskedCartId", method="getGroupForGuestCart" - get a group with custom position for not logged-in user shopping cart page;
- GET /V1/amasty_mostviewed/rules/custom-group-for-customer-cart", method="getGroupForCart" - get a group with custom position for users on shopping cart page.
Related Articles
Automatic Related Products | GraphQL methods
Queries amMostviewedGroups -(uid: String!, position: String) description: get information about related product rules amMostviewedBundlePacks (uid: String) description: get information about bundle packs
How can I display related products block on blog pages?
Automatic Related Products extension can be integrated with the Amasty Blog Pro module. In order to set the related products block on the blog page, follow the steps below. Step 1. Navigate to Amasty → Automatic Related Products → Related Product ...
How products are sorted in the related block when the Source Type is set to “Bought Together”?
With Source Type set to Bought Together in the related rule, products will sorted based on their frequency of being purchased together, i.e. by the number of purchases. For instance, if customers buy product X alongside product Y more frequently than ...
What Amasty extensions support API?
Each Amasty extension that has API support, includes the etc/webapi.xml file. The webapi.xml file contains API configurations with the list of available API requests. For example, a request from the Custom Form module interface: 1 - endpoint URL; 2 - ...
We installed the module and activated it but it does not seem to return any related products on the product/category pages or in cart, why?
After installing the extension and configuring at least one related product rule, reindex is required. You may perform it manually by running the below command via CLI: bin/magento indexer:reindex Also, it’s highly recommended to set the indexers for ...