Product Actions
- fetchProduct
- fetchProductDescription
- fetchProductImages
- fetchProductOptions
- fetchProductProperties
- fetchProductRelations
- fetchProductShipping
- fetchProductVariants
fetchProduct
Fetches a product from the server.
Usage
import { fetchProduct } from '@shopgate/engage/product';
const productId = 'abc123';
const forceFetch = false;
dispatch(fetchProduct(productId, forceFetch));
Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7:
import { fetchProduct } from '@shopgate/pwa-common-commerce/product'
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
Fetches a product description from the server.
Usage
import { fetchProductDescription } from '@shopgate/engage/product';
const productId = 'abc123';
dispatch(fetchProductDescription(productId));
Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7:
import { fetchProductDescription } from '@shopgate/pwa-common-commerce/product'
Parameters
productId
(string) required: The ID of the related product.
fetchProductImages
Fetches product images from the server.
Usage
import { fetchProductImages } from '@shopgate/engage/product';
const productId = 'abc123';
const formats = [{
width: 1024,
height: 1024,
}];
dispatch(fetchProductImages(productId, formats));
Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7:
import { fetchProductImages } from '@shopgate/pwa-common-commerce/product'
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
Fetches product options from the server.
Usage
import { fetchProductOptions } from '@shopgate/engage/product';
const productId = 'abc123';
dispatch(fetchProductOptions(productId));
Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7:
import { fetchProductOptions } from '@shopgate/pwa-common-commerce/product'
Parameters
productId
(string) required: The ID of the related product.
fetchProductProperties
Fetches product properties from the server.
Usage
import { fetchProductProperties } from '@shopgate/engage/product';
const productId = 'abc123';
dispatch(fetchProductProperties(productId));
Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7:
import { fetchProductProperties } from '@shopgate/pwa-common-commerce/product'
Parameters
productId
(string) required: The ID of the related product.
fetchProductRelations
Fetches product relations from the server.
Usage
import {
fetchProductRelations,
PRODUCT_RELATIONS_TYPE_UPSELLING
} from '@shopgate/engage/product';
const productId = 'abc123';
const type = PRODUCT_RELATIONS_TYPE_UPSELLING;
dispatch(fetchProductRelations(productId, type));
Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7:
import { fetchProductRelations } from '@shopgate/pwa-common-commerce/product'
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';
Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7:
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/pwa-common-commerce/product'
fetchProductShipping
Fetches shipping information for a product from the server.
Usage
import { fetchProductShipping } from '@shopgate/engage/product';
const productId = 'abc123';
dispatch(fetchProductShipping(productId));
Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7:
import { fetchProductShipping } from '@shopgate/pwa-common-commerce/product'
Parameters
productId
(string) required: The ID of the related product.
fetchProductVariants
Fetches product variants from the server.
Usage
import { fetchProductVariants } from '@shopgate/engage/product';
const productId = 'abc123';
dispatch(fetchProductVariants(productId));
Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7:
import { fetchProductVariants } from '@shopgate/pwa-common-commerce/product'
Parameters
productId
(string) required: The ID of the related product.