Product Actions
- fetchProduct
- fetchProductDescription
- fetchProductImages
- fetchProductOptions
- fetchProductProperties
- fetchProductRelations
- fetchProductShipping
- fetchProductVariants
fetchProduct
Section titled “fetchProduct”Fetches a product from the server.
import { fetchProduct } from '@shopgate/engage/product';
const productId = 'abc123';const forceFetch = false;
dispatch(fetchProduct(productId, forceFetch));Parameters
Section titled “Parameters”productId(string) required: The ID of the product to fetch.forceFetch(boolean): Default isfalse. Indicates if the product should be fetched, even if there is a still valid entry inside of Redux.
fetchProductDescription
Section titled “fetchProductDescription”Fetches a product description from the server.
import { fetchProductDescription } from '@shopgate/engage/product';
const productId = 'abc123';
dispatch(fetchProductDescription(productId));Parameters
Section titled “Parameters”productId(string) required: The ID of the related product.
fetchProductImages
Section titled “fetchProductImages”Fetches product images from the server.
import { fetchProductImages } from '@shopgate/engage/product';
const productId = 'abc123';const formats = [{ width: 1024, height: 1024,}];
dispatch(fetchProductImages(productId, formats));Parameters
Section titled “Parameters”productId(string) required: The ID of the related product.formats(Array<Object>) required: The desired formats for the images.height(number) required: The height of the format.width(number) required: The width of the format.
fetchProductOptions
Section titled “fetchProductOptions”Fetches product options from the server.
import { fetchProductOptions } from '@shopgate/engage/product';
const productId = 'abc123';
dispatch(fetchProductOptions(productId));Parameters
Section titled “Parameters”productId(string) required: The ID of the related product.
fetchProductProperties
Section titled “fetchProductProperties”Fetches product properties from the server.
import { fetchProductProperties } from '@shopgate/engage/product';
const productId = 'abc123';
dispatch(fetchProductProperties(productId));Parameters
Section titled “Parameters”productId(string) required: The ID of the related product.
fetchProductRelations
Section titled “fetchProductRelations”Fetches product relations from the server.
import { fetchProductRelations, PRODUCT_RELATIONS_TYPE_UPSELLING} from '@shopgate/engage/product';
const productId = 'abc123';const type = PRODUCT_RELATIONS_TYPE_UPSELLING;
dispatch(fetchProductRelations(productId, type));Parameters
Section titled “Parameters”productId(string) required: The ID of the related product.type(string) required: The desired type of the related products.- Possible Values:
crossSelling,upselling,bonus,boughtWith,custom. All of these values are prepared as constants. They can be imported like in the snippet below.
- Possible Values:
limit(number): The number of related products to request. Default is 20 items.
import { PRODUCT_RELATIONS_TYPE_CROSS_SELLING, PRODUCT_RELATIONS_TYPE_UPSELLING, PRODUCT_RELATIONS_TYPE_BONUS, PRODUCT_RELATIONS_TYPE_BOUGHT_WITH, PRODUCT_RELATIONS_TYPE_CUSTOM} from '@shopgate/engage/product';`
fetchProductShipping
Section titled “fetchProductShipping”Fetches shipping information for a product from the server.
import { fetchProductShipping } from '@shopgate/engage/product';
const productId = 'abc123';
dispatch(fetchProductShipping(productId));Parameters
Section titled “Parameters”productId(string) required: The ID of the related product.
fetchProductVariants
Section titled “fetchProductVariants”Fetches product variants from the server.
import { fetchProductVariants } from '@shopgate/engage/product';
const productId = 'abc123';
dispatch(fetchProductVariants(productId));Parameters
Section titled “Parameters”productId(string) required: The ID of the related product.

