Vue Storefront is now Alokai! Learn More
Products

Products

In this section, we will cover the basics of products. We will show you how to fetch products from in a variety of ways.

Overview

There are two main functions to fetch products from Magento 2: productDetails and products. Both are very similar and accept the same arguments. The main difference is in the reponse they return. The productDetails method returns a single product related data, while the products method returns a list of products related data. The first one is optimized to be used on single product pages, while the second one is optimized to be used on product list pages like category pages, search results pages, etc.

References

MethodDescription
productDetailsMethod to fetch product details
productsMethod to fetch products
relatedProductsMethod to fetch related products
upsellProductsMethod to fetch upsell products
productReviewMethod to fetch reviews