@shopgate/pwa-common-commerce 7.30.0-alpha.7 → 7.30.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cart/action-creators/addCouponsToCart.js +9 -2
- package/cart/action-creators/addProductsToCart.js +9 -2
- package/cart/action-creators/deleteCouponsFromCart.js +9 -2
- package/cart/action-creators/deleteProductsFromCart.js +9 -2
- package/cart/action-creators/errorAddCouponsToCart.js +10 -2
- package/cart/action-creators/errorAddProductsToCart.js +10 -2
- package/cart/action-creators/errorCart.js +8 -2
- package/cart/action-creators/errorDeleteCouponsFromCart.js +10 -2
- package/cart/action-creators/errorDeleteProductsFromCart.js +10 -2
- package/cart/action-creators/errorUpdateProductsInCart.js +10 -2
- package/cart/action-creators/receiveCart.js +9 -2
- package/cart/action-creators/requestCart.js +8 -2
- package/cart/action-creators/setCartProductPendingCount.js +9 -2
- package/cart/action-creators/setCouponFieldError.js +9 -2
- package/cart/action-creators/setCouponFieldValue.js +9 -2
- package/cart/action-creators/setFulfillmentSlot.js +9 -2
- package/cart/action-creators/successAddCouponsToCart.js +10 -2
- package/cart/action-creators/successAddProductsToCart.js +8 -2
- package/cart/action-creators/successDeleteCouponsFromCart.js +8 -2
- package/cart/action-creators/successDeleteProductsFromCart.js +8 -2
- package/cart/action-creators/successUpdateProductsInCart.js +8 -2
- package/cart/action-creators/updateProductsInCart.js +9 -2
- package/cart/actions/addCouponsToCart.js +52 -8
- package/cart/actions/addProductsToCart.js +80 -11
- package/cart/actions/deleteCouponsFromCart.js +39 -6
- package/cart/actions/deleteProductsFromCart.js +38 -6
- package/cart/actions/fetchCart.js +52 -8
- package/cart/actions/updateProductsInCart.js +44 -6
- package/cart/constants/PipelineErrors.js +6 -1
- package/cart/constants/Pipelines.js +6 -1
- package/cart/constants/Portals.js +85 -1
- package/cart/constants/index.js +39 -2
- package/cart/helpers/config.js +47 -2
- package/cart/helpers/createPipelineErrorList.js +30 -4
- package/cart/helpers/fulfillmentSlots.js +37 -4
- package/cart/helpers/index.js +14 -3
- package/cart/helpers/quantity.js +23 -4
- package/cart/helpers/shipping.js +57 -2
- package/cart/helpers/tax.js +26 -2
- package/cart/index.js +25 -5
- package/cart/mock.js +130 -1
- package/cart/reducers/couponField.js +30 -2
- package/cart/reducers/data.js +98 -6
- package/cart/reducers/index.js +7 -1
- package/cart/selectors/index.js +181 -31
- package/cart/selectors/spec.js +189 -2
- package/cart/streams/index.js +176 -29
- package/cart/subscriptions/index.js +307 -30
- package/category/action-creators/errorCategory.js +10 -2
- package/category/action-creators/errorCategoryChildren.js +9 -2
- package/category/action-creators/errorRootCategories.js +8 -2
- package/category/action-creators/receiveCategory.js +12 -2
- package/category/action-creators/receiveCategoryChildren.js +10 -2
- package/category/action-creators/receiveRootCategories.js +9 -2
- package/category/action-creators/requestCategory.js +9 -2
- package/category/action-creators/requestCategoryChildren.js +9 -2
- package/category/action-creators/requestRootCategories.js +8 -2
- package/category/actions/fetchCategory.js +47 -5
- package/category/actions/fetchCategoryChildren.js +30 -2
- package/category/actions/fetchCategoryOrRootCategories.js +16 -2
- package/category/actions/fetchCategoryProducts.js +36 -2
- package/category/actions/fetchRootCategories.js +31 -2
- package/category/actions/getCategory.js +10 -2
- package/category/constants/Pipelines.js +3 -1
- package/category/constants/Portals.js +56 -3
- package/category/constants/index.js +17 -2
- package/category/helpers/index.js +27 -3
- package/category/index.js +19 -5
- package/category/mock.js +176 -1
- package/category/reducers/categoriesById.js +65 -3
- package/category/reducers/childrenByCategoryId.js +55 -4
- package/category/reducers/helpers/handleCategoryCollection.js +24 -3
- package/category/reducers/helpers/handleReceivedCategories.js +3 -1
- package/category/reducers/index.js +12 -2
- package/category/reducers/rootCategories.js +31 -2
- package/category/selectors/index.js +115 -16
- package/category/streams/index.js +82 -4
- package/category/subscriptions/index.js +96 -3
- package/checkout/action-creators/successCheckout.js +9 -2
- package/checkout/actions/fetchCheckoutUrl.js +28 -3
- package/checkout/constants/Pipelines.js +1 -1
- package/checkout/constants/index.js +3 -2
- package/checkout/index.js +11 -4
- package/checkout/selectors/index.js +7 -2
- package/checkout/streams/index.js +8 -2
- package/checkout/subscriptions/index.js +35 -6
- package/favorites/action-creators/index.js +206 -24
- package/favorites/actions/addFavorites.js +41 -3
- package/favorites/actions/addFavoritesList.js +27 -2
- package/favorites/actions/fetchFavoriteIds.js +49 -5
- package/favorites/actions/fetchFavorites.js +60 -5
- package/favorites/actions/fetchFavoritesList.js +47 -3
- package/favorites/actions/fetchFavoritesListsWithItems.js +32 -3
- package/favorites/actions/getFavorites.js +6 -2
- package/favorites/actions/removeFavorites.js +32 -3
- package/favorites/actions/removeFavoritesList.js +24 -2
- package/favorites/actions/toggleFavorites.js +68 -10
- package/favorites/actions/updateFavorites.js +39 -3
- package/favorites/actions/updateFavoritesList.js +26 -2
- package/favorites/constants/Pipelines.js +9 -1
- package/favorites/constants/Portals.js +32 -4
- package/favorites/constants/index.js +37 -5
- package/favorites/index.js +14 -4
- package/favorites/mock.js +89 -4
- package/favorites/reducers/index.js +7 -1
- package/favorites/reducers/lists.js +74 -2
- package/favorites/reducers/products.js +231 -24
- package/favorites/selectors/index.js +188 -24
- package/favorites/streams/index.js +135 -23
- package/favorites/streams/spec.js +517 -8
- package/favorites/subscriptions/index.js +260 -25
- package/favorites/subscriptions/spec.js +701 -28
- package/filter/action-creators/errorFilters.js +9 -2
- package/filter/action-creators/index.js +4 -1
- package/filter/action-creators/receiveFilters.js +10 -2
- package/filter/action-creators/requestFilters.js +9 -2
- package/filter/action-creators/updateFilters.js +8 -2
- package/filter/actions/fetchFilters.js +46 -3
- package/filter/actions/getFilters.js +6 -2
- package/filter/actions/helpers/buildFilterParams.js +34 -2
- package/filter/actions/helpers/buildRequestFilters.js +35 -2
- package/filter/actions/helpers/processFilters.js +10 -2
- package/filter/actions/helpers/processParams.js +26 -2
- package/filter/constants/Pipelines.js +1 -1
- package/filter/constants/Portals.js +39 -3
- package/filter/constants/index.js +8 -1
- package/filter/index.js +12 -4
- package/filter/reducers/helpers/enrichFilters.js +11 -3
- package/filter/reducers/index.js +5 -1
- package/filter/reducers/resultsByHash.js +43 -3
- package/filter/selectors/index.js +47 -6
- package/filter/streams/index.js +30 -1
- package/filter/subscriptions/index.js +34 -2
- package/market/constants/Portals.js +22 -4
- package/market/constants/index.js +2 -1
- package/market/helpers/showReturnPolicy.js +3 -1
- package/market/helpers/showTaxDisclaimer.js +3 -1
- package/market/index.js +6 -2
- package/orders/constants.js +2 -1
- package/package.json +3 -3
- package/product/action-creators/deleteProductsByIds.js +10 -2
- package/product/action-creators/errorProduct.js +10 -2
- package/product/action-creators/errorProductDescription.js +10 -2
- package/product/action-creators/errorProductImages.js +10 -2
- package/product/action-creators/errorProductMedia.js +10 -2
- package/product/action-creators/errorProductOptions.js +10 -2
- package/product/action-creators/errorProductProperties.js +10 -2
- package/product/action-creators/errorProductRelations.js +9 -2
- package/product/action-creators/errorProductShipping.js +10 -2
- package/product/action-creators/errorProductVariants.js +10 -2
- package/product/action-creators/errorProducts.js +9 -2
- package/product/action-creators/expireProductById.js +10 -2
- package/product/action-creators/expireProductData.js +11 -2
- package/product/action-creators/expireProductsByHash.js +9 -2
- package/product/action-creators/productNotAvailable.js +10 -2
- package/product/action-creators/provideProduct.js +9 -2
- package/product/action-creators/receiveProduct.js +10 -2
- package/product/action-creators/receiveProductCached.js +9 -2
- package/product/action-creators/receiveProductDescription.js +10 -2
- package/product/action-creators/receiveProductImages.js +10 -2
- package/product/action-creators/receiveProductMedia.js +10 -2
- package/product/action-creators/receiveProductOptions.js +10 -2
- package/product/action-creators/receiveProductProperties.js +10 -2
- package/product/action-creators/receiveProductRelations.js +12 -2
- package/product/action-creators/receiveProductShipping.js +10 -2
- package/product/action-creators/receiveProductVariants.js +10 -2
- package/product/action-creators/receiveProducts.js +16 -2
- package/product/action-creators/receiveProductsCached.js +9 -2
- package/product/action-creators/refreshExpiredPDPData.js +8 -2
- package/product/action-creators/requestProduct.js +10 -2
- package/product/action-creators/requestProductDescription.js +9 -2
- package/product/action-creators/requestProductImages.js +9 -2
- package/product/action-creators/requestProductMedia.js +9 -2
- package/product/action-creators/requestProductOptions.js +9 -2
- package/product/action-creators/requestProductProperties.js +9 -2
- package/product/action-creators/requestProductRelations.js +10 -2
- package/product/action-creators/requestProductShipping.js +9 -2
- package/product/action-creators/requestProductVariants.js +9 -2
- package/product/action-creators/requestProducts.js +9 -2
- package/product/action-creators/setProductId.js +9 -2
- package/product/action-creators/setProductQuantity.js +9 -2
- package/product/action-creators/setProductVariantId.js +9 -2
- package/product/actions/changeSortOrder.js +21 -2
- package/product/actions/fetchHighlightProducts.js +18 -2
- package/product/actions/fetchLiveshoppingProducts.js +14 -2
- package/product/actions/fetchProduct.js +52 -3
- package/product/actions/fetchProductDescription.js +30 -2
- package/product/actions/fetchProductImages.js +31 -2
- package/product/actions/fetchProductMedia.js +35 -2
- package/product/actions/fetchProductOptions.js +31 -2
- package/product/actions/fetchProductProperties.js +30 -2
- package/product/actions/fetchProductRelations.js +63 -2
- package/product/actions/fetchProductShipping.js +31 -2
- package/product/actions/fetchProductVariants.js +31 -2
- package/product/actions/fetchProducts.js +189 -17
- package/product/actions/fetchProductsById.js +68 -8
- package/product/actions/fetchProductsByQuery.js +102 -18
- package/product/actions/getHighlightProducts.js +6 -2
- package/product/actions/getLiveshoppingProducts.js +6 -2
- package/product/actions/getProduct.js +6 -2
- package/product/actions/getProductDescription.js +6 -2
- package/product/actions/getProductImages.js +6 -2
- package/product/actions/getProductOptions.js +6 -2
- package/product/actions/getProductProperties.js +6 -2
- package/product/actions/getProductRelations.js +6 -2
- package/product/actions/getProductShipping.js +6 -2
- package/product/actions/getProductVariants.js +6 -2
- package/product/actions/getProducts.js +6 -2
- package/product/actions/getProductsById.js +6 -2
- package/product/actions/getProductsByQuery.js +6 -2
- package/product/actions/processProductFlags.js +35 -3
- package/product/actions/updateMetadata.js +17 -2
- package/product/collections/ProductImageFormats.js +48 -8
- package/product/collections/index.js +1 -1
- package/product/constants/Pipelines.js +12 -1
- package/product/constants/Portals.js +200 -33
- package/product/constants/index.js +90 -18
- package/product/helpers/index.js +61 -8
- package/product/index.js +36 -6
- package/product/mock.js +1002 -2
- package/product/reducers/descriptionsByProductId.js +54 -5
- package/product/reducers/helpers/formatOptions.js +17 -2
- package/product/reducers/helpers/handleProductCollection.js +19 -2
- package/product/reducers/imagesByProductId.js +51 -4
- package/product/reducers/index.js +23 -1
- package/product/reducers/mediaByProductId.js +55 -3
- package/product/reducers/optionsByProductId.js +41 -2
- package/product/reducers/productRelationsByHash.js +43 -2
- package/product/reducers/productsById.js +122 -7
- package/product/reducers/propertiesByProductId.js +48 -2
- package/product/reducers/resultsByHash.js +125 -9
- package/product/reducers/shippingByProductId.js +37 -2
- package/product/reducers/variantsByProductId.js +56 -2
- package/product/selectors/options.js +90 -13
- package/product/selectors/page.js +62 -13
- package/product/selectors/price.js +81 -18
- package/product/selectors/product.js +549 -59
- package/product/selectors/product.mock.js +327 -12
- package/product/selectors/relations.js +35 -5
- package/product/selectors/variants.js +91 -15
- package/product/streams/index.js +167 -13
- package/product/subscriptions/index.js +210 -4
- package/reviews/action-creators/errorProductReviews.js +9 -2
- package/reviews/action-creators/errorReviews.js +9 -2
- package/reviews/action-creators/errorSubmitReview.js +9 -2
- package/reviews/action-creators/errorUserReview.js +9 -2
- package/reviews/action-creators/flushUserReview.js +8 -2
- package/reviews/action-creators/receiveProductReviews.js +11 -2
- package/reviews/action-creators/receiveReviews.js +12 -2
- package/reviews/action-creators/receiveSubmitReview.js +9 -2
- package/reviews/action-creators/receiveUserReview.js +10 -2
- package/reviews/action-creators/requestProductReviews.js +10 -2
- package/reviews/action-creators/requestReviews.js +9 -2
- package/reviews/action-creators/requestSubmitReview.js +9 -2
- package/reviews/action-creators/requestUserReview.js +9 -2
- package/reviews/action-creators/resetSubmittedReview.js +9 -2
- package/reviews/action-creators/spec.js +40 -1
- package/reviews/actions/fetchProductReviews.js +37 -2
- package/reviews/actions/fetchReviews.js +38 -2
- package/reviews/actions/fetchUserReview.js +31 -2
- package/reviews/actions/flushUserReview.js +5 -1
- package/reviews/actions/getProductReviews.js +6 -2
- package/reviews/actions/getUserReview.js +6 -2
- package/reviews/actions/spec.js +241 -4
- package/reviews/actions/submitReview.js +63 -3
- package/reviews/constants/Pipelines.js +4 -1
- package/reviews/constants/Portals.js +4 -1
- package/reviews/constants/index.js +26 -7
- package/reviews/index.js +15 -4
- package/reviews/mock.js +172 -11
- package/reviews/reducers/index.js +11 -1
- package/reviews/reducers/mock.js +14 -2
- package/reviews/reducers/reviewsByHash.js +52 -6
- package/reviews/reducers/reviewsById.js +27 -2
- package/reviews/reducers/reviewsByProductId.js +47 -2
- package/reviews/reducers/spec.js +211 -2
- package/reviews/reducers/userReviewsByProductId.js +68 -2
- package/reviews/selectors/index.js +123 -19
- package/reviews/selectors/mock.js +100 -1
- package/reviews/selectors/spec.js +100 -1
- package/reviews/streams/index.js +37 -5
- package/reviews/streams/spec.js +25 -1
- package/reviews/subscriptions/index.js +27 -2
- package/scanner/action-creators/errorHandleScanner.js +11 -2
- package/scanner/action-creators/scannerFinished.js +11 -2
- package/scanner/action-creators/startScanner.js +8 -2
- package/scanner/action-creators/successHandleScanner.js +11 -2
- package/scanner/actions/handleBarCode.js +22 -2
- package/scanner/actions/handleNoResults.js +23 -2
- package/scanner/actions/handleQrCode.js +116 -6
- package/scanner/actions/handleSearch.js +33 -2
- package/scanner/constants/Portals.js +22 -1
- package/scanner/constants/index.js +17 -1
- package/scanner/helpers/index.js +115 -5
- package/scanner/index.js +19 -5
- package/scanner/streams/index.js +36 -1
- package/scanner/subscriptions/index.js +78 -8
- package/search/action-creators/errorSearchResults.js +10 -2
- package/search/action-creators/receiveSearchResults.js +11 -2
- package/search/action-creators/receiveSearchSuggestions.js +10 -2
- package/search/action-creators/requestSearchResults.js +10 -2
- package/search/action-creators/requestSearchSuggestions.js +9 -2
- package/search/actions/fetchSearchResults.js +66 -8
- package/search/actions/fetchSearchSuggestions.js +36 -2
- package/search/constants/Pipelines.js +1 -1
- package/search/constants/Portals.js +9 -2
- package/search/constants/index.js +10 -2
- package/search/helpers/index.js +5 -2
- package/search/helpers/removeHighlightingPlaceholders.js +4 -1
- package/search/helpers/spec.js +19 -1
- package/search/index.js +17 -5
- package/search/reducers/index.js +38 -2
- package/search/selectors/index.js +23 -4
- package/search/streams/index.js +51 -3
- package/search/subscriptions/index.js +132 -5
|
@@ -1,5 +1,34 @@
|
|
|
1
|
-
import PipelineRequest from'@shopgate/pwa-core/classes/PipelineRequest';
|
|
1
|
+
import PipelineRequest from '@shopgate/pwa-core/classes/PipelineRequest';
|
|
2
|
+
import { shouldFetchData, mutable } from '@shopgate/pwa-common/helpers/redux';
|
|
3
|
+
import requestProductVariants from "../action-creators/requestProductVariants";
|
|
4
|
+
import { SHOPGATE_CATALOG_GET_PRODUCT_VARIANTS } from "../constants/Pipelines";
|
|
5
|
+
import receiveProductVariants from "../action-creators/receiveProductVariants";
|
|
6
|
+
import errorProductVariants from "../action-creators/errorProductVariants";
|
|
7
|
+
|
|
8
|
+
/**
|
|
2
9
|
* Retrieves product variants from store.
|
|
3
10
|
* @param {string} productId The product ID for which the product variants are requested.
|
|
4
11
|
* @return {Function} A Redux Thunk
|
|
5
|
-
*/
|
|
12
|
+
*/
|
|
13
|
+
function fetchProductVariants(productId) {
|
|
14
|
+
return (dispatch, getState) => {
|
|
15
|
+
const state = getState();
|
|
16
|
+
const cachedData = state.product.variantsByProductId[productId];
|
|
17
|
+
if (!shouldFetchData(cachedData)) {
|
|
18
|
+
return Promise.resolve(null);
|
|
19
|
+
}
|
|
20
|
+
dispatch(requestProductVariants(productId));
|
|
21
|
+
const request = new PipelineRequest(SHOPGATE_CATALOG_GET_PRODUCT_VARIANTS).setInput({
|
|
22
|
+
productId
|
|
23
|
+
}).dispatch();
|
|
24
|
+
request.then(result => {
|
|
25
|
+
dispatch(receiveProductVariants(productId, result));
|
|
26
|
+
}).catch(error => {
|
|
27
|
+
dispatch(errorProductVariants(productId, error.code));
|
|
28
|
+
});
|
|
29
|
+
return request;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** @mixes {MutableFunction} */
|
|
34
|
+
export default mutable(fetchProductVariants);
|
|
@@ -1,8 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
import difference from 'lodash/difference';
|
|
2
|
+
import PipelineRequest from '@shopgate/pwa-core/classes/PipelineRequest';
|
|
3
|
+
import { generateResultHash, shouldFetchData } from '@shopgate/pwa-common/helpers/redux';
|
|
4
|
+
import { isNumber } from '@shopgate/pwa-common/helpers/validation';
|
|
5
|
+
import configuration from '@shopgate/pwa-common/collections/Configuration';
|
|
6
|
+
import { DEFAULT_PRODUCTS_FETCH_PARAMS } from '@shopgate/pwa-common/constants/Configuration';
|
|
7
|
+
import { SORT_SCOPE_CATEGORY } from '@shopgate/engage/filter/constants';
|
|
8
|
+
import { makeGetDefaultSortOrder } from '@shopgate/engage/filter/selectors';
|
|
9
|
+
import { getFulfillmentParams } from '@shopgate/pwa-common-commerce/product/selectors/product';
|
|
10
|
+
import { SHOPGATE_CATALOG_GET_PRODUCTS, SHOPGATE_CATALOG_GET_HIGHLIGHT_PRODUCTS, SHOPGATE_CATALOG_GET_LIVESHOPPING_PRODUCTS } from "../constants/Pipelines";
|
|
11
|
+
import buildRequestFilters from "../../filter/actions/helpers/buildRequestFilters";
|
|
12
|
+
import requestProducts from "../action-creators/requestProducts";
|
|
13
|
+
import receiveProducts from "../action-creators/receiveProducts";
|
|
14
|
+
import errorProducts from "../action-creators/errorProducts";
|
|
15
|
+
import deleteProductsByIds from "../action-creators/deleteProductsByIds";
|
|
16
|
+
import receiveProductsCached from "../action-creators/receiveProductsCached";
|
|
17
|
+
import { makeGetProductResultByCustomHash } from "../selectors/product";
|
|
18
|
+
|
|
19
|
+
/**
|
|
2
20
|
* Checks if a product ID type is a product identifiers type.
|
|
3
21
|
* @param {string} productIdType The product ID type to check.
|
|
4
22
|
* @returns {boolean}
|
|
5
|
-
*/
|
|
23
|
+
*/
|
|
24
|
+
export const isProductIdentifiersProductIdType = productIdType => ['sku', 'ean', 'upc'].includes(productIdType);
|
|
25
|
+
|
|
26
|
+
/**
|
|
6
27
|
* Process the pipeline params to be compatible.
|
|
7
28
|
* Currently the categoryId field cannot be used in combination with the filter field. In order to
|
|
8
29
|
* use them together the categoryId field has to be extracted into the filter field.
|
|
@@ -12,10 +33,41 @@ var _excluded=["offset","limit"];function _objectWithoutProperties(source,exclud
|
|
|
12
33
|
* @param {boolean} includeSort Tells if the sort parameters shall be included to the request.
|
|
13
34
|
* @param {boolean} includeFilters Tells if the filter parameters shall be included to the request.
|
|
14
35
|
* @returns {Object} A set of compatible params.
|
|
15
|
-
*/
|
|
36
|
+
*/
|
|
37
|
+
const processParams = (params, activeFilters, includeSort = true, includeFilters = true) => {
|
|
38
|
+
const filters = buildRequestFilters(activeFilters);
|
|
39
|
+
const newParams = {
|
|
40
|
+
...params,
|
|
41
|
+
...(includeFilters && filters && Object.keys(filters).length && {
|
|
42
|
+
filters
|
|
43
|
+
})
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
16
47
|
* Check if the sort parameter should be included in the request parameters,
|
|
17
48
|
* and remove it if necessary.
|
|
18
|
-
*/
|
|
49
|
+
*/
|
|
50
|
+
if (includeSort === false && params && params.sort) {
|
|
51
|
+
delete newParams.sort;
|
|
52
|
+
}
|
|
53
|
+
if (newParams.productIdType) {
|
|
54
|
+
if (isProductIdentifiersProductIdType(newParams.productIdType)) {
|
|
55
|
+
if (newParams.productIdType === 'sku') {
|
|
56
|
+
newParams.productSkus = newParams.productIds;
|
|
57
|
+
} else if (newParams.productIdType === 'ean') {
|
|
58
|
+
newParams.productEans = newParams.productIds;
|
|
59
|
+
} else if (newParams.productIdType === 'upc') {
|
|
60
|
+
newParams.productUpcs = newParams.productIds;
|
|
61
|
+
}
|
|
62
|
+
delete newParams.productIds;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
delete newParams.productIdType;
|
|
66
|
+
return newParams;
|
|
67
|
+
};
|
|
68
|
+
const getDefaultSortOrder = makeGetDefaultSortOrder();
|
|
69
|
+
|
|
70
|
+
/**
|
|
19
71
|
* Retrieves a product from the Redux store.
|
|
20
72
|
* @param {Object} options The options for the getProducts request.
|
|
21
73
|
* @param {Object} options.params The params for the getProduct pipeline.
|
|
@@ -33,18 +85,138 @@ var _excluded=["offset","limit"];function _objectWithoutProperties(source,exclud
|
|
|
33
85
|
* @param {boolean} [options.resolveCachedProducts=false] Whether to resolve with products even
|
|
34
86
|
* when no actual request was done due to cached data.
|
|
35
87
|
* @return {Function} A Redux Thunk
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
88
|
+
*/
|
|
89
|
+
function fetchProducts(options) {
|
|
90
|
+
const {
|
|
91
|
+
params = {},
|
|
92
|
+
filters = null,
|
|
93
|
+
pipeline = SHOPGATE_CATALOG_GET_PRODUCTS,
|
|
94
|
+
cached = true,
|
|
95
|
+
cachedTime = null,
|
|
96
|
+
id = null,
|
|
97
|
+
includeSort = true,
|
|
98
|
+
includeFilters = true,
|
|
99
|
+
includeFulfillment = true,
|
|
100
|
+
onBeforeDispatch = () => {},
|
|
101
|
+
resolveCachedProducts = false
|
|
102
|
+
} = options;
|
|
103
|
+
return (dispatch, getState) => {
|
|
104
|
+
const state = getState();
|
|
105
|
+
const {
|
|
106
|
+
offset,
|
|
107
|
+
limit,
|
|
108
|
+
...hashParams
|
|
109
|
+
} = params;
|
|
110
|
+
const defaultSort = getDefaultSortOrder(state, {
|
|
111
|
+
scope: SORT_SCOPE_CATEGORY
|
|
112
|
+
});
|
|
113
|
+
const {
|
|
114
|
+
sort = defaultSort
|
|
115
|
+
} = hashParams;
|
|
116
|
+
let getProductsRequestParams;
|
|
117
|
+
if (pipeline === SHOPGATE_CATALOG_GET_PRODUCTS) {
|
|
118
|
+
getProductsRequestParams = configuration.get(DEFAULT_PRODUCTS_FETCH_PARAMS);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Append additional global fulfillment parameters.
|
|
122
|
+
let fulfillmentParams = {};
|
|
123
|
+
if (includeFulfillment && pipeline === SHOPGATE_CATALOG_GET_PRODUCTS) {
|
|
124
|
+
fulfillmentParams = getFulfillmentParams(state);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// We need to process the params to handle edge cases in the pipeline params.
|
|
128
|
+
const requestParams = {
|
|
129
|
+
...fulfillmentParams,
|
|
130
|
+
...getProductsRequestParams,
|
|
131
|
+
...processParams(params, filters, includeSort, includeFilters)
|
|
132
|
+
};
|
|
133
|
+
const hash = generateResultHash({
|
|
134
|
+
pipeline,
|
|
135
|
+
sort,
|
|
136
|
+
...fulfillmentParams,
|
|
137
|
+
...hashParams,
|
|
138
|
+
...(filters && Object.keys(filters).length && {
|
|
139
|
+
filters
|
|
140
|
+
}),
|
|
141
|
+
...(id && {
|
|
142
|
+
id
|
|
143
|
+
})
|
|
144
|
+
}, includeSort, includeFilters);
|
|
145
|
+
const result = state.product.resultsByHash[hash];
|
|
146
|
+
let requiredProductCount = null;
|
|
147
|
+
|
|
148
|
+
// Only set a required number of products if both offset and limit are valid.
|
|
149
|
+
if (isNumber(offset) && isNumber(limit)) {
|
|
150
|
+
requiredProductCount = offset + limit;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Stop if we don't need to get any data.
|
|
154
|
+
if (!shouldFetchData(result, 'products', requiredProductCount)) {
|
|
155
|
+
const {
|
|
156
|
+
products
|
|
157
|
+
} = result;
|
|
158
|
+
if (Array.isArray(products)) {
|
|
159
|
+
/**
|
|
41
160
|
* Fire the onBeforeDispatch callback to inform
|
|
42
161
|
* a caller that fetchProducts will return data.
|
|
43
|
-
*/
|
|
44
|
-
onBeforeDispatch();
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
162
|
+
*/
|
|
163
|
+
onBeforeDispatch();
|
|
164
|
+
dispatch(receiveProductsCached({
|
|
165
|
+
hash,
|
|
166
|
+
requestParams,
|
|
167
|
+
products
|
|
168
|
+
}));
|
|
169
|
+
return Promise.resolve(resolveCachedProducts ? makeGetProductResultByCustomHash(hash)(state) : result);
|
|
170
|
+
}
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Fire the onBeforeDispatch callback to inform a caller that fetchProducts will return data.
|
|
175
|
+
onBeforeDispatch();
|
|
176
|
+
dispatch(requestProducts({
|
|
177
|
+
hash,
|
|
178
|
+
cached,
|
|
179
|
+
cachedTime,
|
|
180
|
+
requestParams
|
|
181
|
+
}));
|
|
182
|
+
const request = new PipelineRequest(pipeline).setInput(requestParams).dispatch();
|
|
183
|
+
request.then(response => {
|
|
184
|
+
let totalResultCount = response.totalProductCount;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* When the next check was written, getHighlightProducts and getLiveshoppingProducts
|
|
188
|
+
* didn't deliver a totalProductCount within their responses - they simply returned all
|
|
189
|
+
* available products.
|
|
190
|
+
* So we set the products count of the response as totalProductCount to decrease the
|
|
191
|
+
* amount of logic, which is necessary to deal with product related pipeline.
|
|
192
|
+
*/
|
|
193
|
+
if (typeof totalResultCount === 'undefined' && (pipeline === SHOPGATE_CATALOG_GET_HIGHLIGHT_PRODUCTS || pipeline === SHOPGATE_CATALOG_GET_LIVESHOPPING_PRODUCTS)) {
|
|
194
|
+
totalResultCount = response.products.length;
|
|
195
|
+
}
|
|
196
|
+
dispatch(receiveProducts({
|
|
197
|
+
hash,
|
|
198
|
+
requestParams,
|
|
199
|
+
products: response.products,
|
|
200
|
+
totalResultCount,
|
|
201
|
+
cached,
|
|
202
|
+
cachedTime
|
|
203
|
+
}));
|
|
204
|
+
if (!isProductIdentifiersProductIdType(params?.productIdType) && Array.isArray(params?.productIds)) {
|
|
205
|
+
const requestIds = params?.productIds;
|
|
206
|
+
const responseIds = response.products.map(product => product.id);
|
|
207
|
+
const missingResponseIds = difference(requestIds, responseIds);
|
|
208
|
+
if (missingResponseIds.length > 0) {
|
|
209
|
+
dispatch(deleteProductsByIds(missingResponseIds));
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}).catch(error => {
|
|
213
|
+
dispatch(errorProducts({
|
|
214
|
+
errorCode: error.code,
|
|
215
|
+
hash,
|
|
216
|
+
requestParams
|
|
217
|
+
}));
|
|
218
|
+
});
|
|
219
|
+
return request;
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
export default fetchProducts;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { getProductDataById } from '@shopgate/engage/product/selectors/product';
|
|
2
|
+
import { shouldFetchData } from '@shopgate/pwa-common/helpers/redux';
|
|
3
|
+
import fetchProducts, { isProductIdentifiersProductIdType } from "./fetchProducts";
|
|
4
|
+
|
|
5
|
+
/**
|
|
2
6
|
* Dispatches a fetch products action to retrieve products by their IDs.
|
|
3
7
|
* @param {Object|string[]} optionsOrProductIds Action options or an array of product IDs
|
|
4
8
|
* (deprecated)
|
|
@@ -14,10 +18,66 @@ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<argum
|
|
|
14
18
|
* @param {boolean} [includeFulfillment=true] (deprecated) Whether to include fulfillment data to
|
|
15
19
|
* the request
|
|
16
20
|
* @return {Function} A Redux Thunk
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
localProductIds
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
*/
|
|
22
|
+
const fetchProductsById = (optionsOrProductIds, componentId = null, cached = true, includeFulfillment = true) => (dispatch, getState) => {
|
|
23
|
+
let localProductIds;
|
|
24
|
+
let localComponentId;
|
|
25
|
+
let localCached;
|
|
26
|
+
let localIncludeFulfillment;
|
|
27
|
+
let productIdType;
|
|
28
|
+
if (Array.isArray(optionsOrProductIds)) {
|
|
29
|
+
// Backwards compatibility for previous implementation where the function had a parameter list
|
|
30
|
+
localProductIds = optionsOrProductIds;
|
|
31
|
+
localComponentId = componentId || null;
|
|
32
|
+
localCached = cached !== undefined ? cached : true;
|
|
33
|
+
localIncludeFulfillment = includeFulfillment !== undefined ? includeFulfillment : true;
|
|
34
|
+
} else if (typeof optionsOrProductIds === 'object' && optionsOrProductIds !== null) {
|
|
35
|
+
// New object parameter mode
|
|
36
|
+
({
|
|
37
|
+
productIds: localProductIds,
|
|
38
|
+
componentId: localComponentId = null,
|
|
39
|
+
cached: localCached = true,
|
|
40
|
+
includeFulfillment: localIncludeFulfillment = true,
|
|
41
|
+
productIdType
|
|
42
|
+
} = optionsOrProductIds);
|
|
43
|
+
}
|
|
44
|
+
let requestProductIds = localProductIds;
|
|
45
|
+
|
|
46
|
+
// When the productIds are regular product IDs, we can check the Redux store for existing
|
|
47
|
+
// and only request the missing ones. That certainly doesn't work for SKUs, EANs or UPCs,
|
|
48
|
+
if (!isProductIdentifiersProductIdType(productIdType)) {
|
|
49
|
+
const state = getState();
|
|
50
|
+
const products = state.product.productsById;
|
|
51
|
+
|
|
52
|
+
// Filter out only the products that are not yet available in the store.
|
|
53
|
+
requestProductIds = localProductIds.filter(id => shouldFetchData(products[id]));
|
|
54
|
+
|
|
55
|
+
// Then only perform a pipeline request if there are products missing.
|
|
56
|
+
if (!requestProductIds.length) {
|
|
57
|
+
const productsById = localProductIds.map(id => getProductDataById(state, {
|
|
58
|
+
productId: id
|
|
59
|
+
}));
|
|
60
|
+
const totalProductCount = productsById.length;
|
|
61
|
+
return {
|
|
62
|
+
products: productsById,
|
|
63
|
+
totalProductCount
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return dispatch(fetchProducts({
|
|
68
|
+
...(localComponentId && {
|
|
69
|
+
id: localComponentId
|
|
70
|
+
}),
|
|
71
|
+
cached: localCached,
|
|
72
|
+
params: {
|
|
73
|
+
productIds: requestProductIds,
|
|
74
|
+
...(productIdType && {
|
|
75
|
+
productIdType
|
|
76
|
+
})
|
|
77
|
+
},
|
|
78
|
+
includeFulfillment: localIncludeFulfillment,
|
|
79
|
+
includeFilters: false,
|
|
80
|
+
includeSort: false
|
|
81
|
+
}));
|
|
82
|
+
};
|
|
83
|
+
export default fetchProductsById;
|
|
@@ -1,26 +1,110 @@
|
|
|
1
|
-
|
|
1
|
+
import fetchHighlightProducts from "./fetchHighlightProducts";
|
|
2
|
+
import fetchProducts from "./fetchProducts";
|
|
3
|
+
import fetchProductsById from "./fetchProductsById";
|
|
4
|
+
|
|
5
|
+
/**
|
|
2
6
|
* Dispatches other actions based on the query type.
|
|
3
7
|
* @param {number|string} type The query type.
|
|
4
8
|
* @param {string} value The value to use with the query.
|
|
5
9
|
* @param {Object} options Any additional options for requesting products.
|
|
6
10
|
* @param {string} [id=null] A unique id for the component that is using this action.
|
|
7
11
|
* @return {Function} A Redux Thunk
|
|
8
|
-
*/
|
|
12
|
+
*/
|
|
13
|
+
const fetchProductsByQuery = (type, value, options = {}, id = null) => dispatch => {
|
|
14
|
+
/**
|
|
9
15
|
* Remove all properties from the options which are just intended to be used inside this function
|
|
10
16
|
* and not supposed to be used for the actual products request.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
*/
|
|
18
|
+
const {
|
|
19
|
+
useDefaultRequestForProductIds = false,
|
|
20
|
+
productIdType = undefined,
|
|
21
|
+
...sanitizedOptions
|
|
22
|
+
} = options;
|
|
23
|
+
switch (type) {
|
|
24
|
+
// Product highlights
|
|
25
|
+
case 1:
|
|
26
|
+
{
|
|
27
|
+
const params = {
|
|
28
|
+
...sanitizedOptions
|
|
29
|
+
};
|
|
30
|
+
return dispatch(fetchHighlightProducts({
|
|
31
|
+
params,
|
|
32
|
+
...(id && {
|
|
33
|
+
id
|
|
34
|
+
})
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Search phrase
|
|
39
|
+
case 2:
|
|
40
|
+
case 3:
|
|
41
|
+
{
|
|
42
|
+
const params = {
|
|
43
|
+
searchPhrase: value,
|
|
44
|
+
...sanitizedOptions
|
|
45
|
+
};
|
|
46
|
+
return dispatch(fetchProducts({
|
|
47
|
+
params,
|
|
48
|
+
...(id && {
|
|
49
|
+
id
|
|
50
|
+
}),
|
|
51
|
+
includeFilters: false
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Product ID's
|
|
56
|
+
case 4:
|
|
57
|
+
{
|
|
58
|
+
/**
|
|
59
|
+
* By default the productIds query type bypasses the regular product request logic. It will
|
|
60
|
+
* just request the products that are not available in Redux yet.
|
|
61
|
+
* This can cause update issues in the UI, since selectors might not return fresh data when
|
|
62
|
+
* Redux changes.
|
|
63
|
+
* So when the "useDefaultRequestForProductIds" flag is active, the regular request system is
|
|
64
|
+
* used and whenever the fetch params change, new product data fill be fetched.
|
|
65
|
+
*
|
|
66
|
+
* ATTENTION: To make the system work completely, also the "getProductsResult" selector helper
|
|
67
|
+
* needs to be called with this parameter.
|
|
68
|
+
*/
|
|
69
|
+
if (useDefaultRequestForProductIds) {
|
|
70
|
+
const params = {
|
|
71
|
+
productIds: value,
|
|
72
|
+
productIdType,
|
|
73
|
+
...sanitizedOptions
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// Limit and offset are not fully supported for product requests with productId list
|
|
77
|
+
delete params.limit;
|
|
78
|
+
delete params.offset;
|
|
79
|
+
return dispatch(fetchProducts({
|
|
80
|
+
params,
|
|
81
|
+
...(id && {
|
|
82
|
+
id
|
|
83
|
+
}),
|
|
84
|
+
includeFilters: false,
|
|
85
|
+
includeSort: false
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
return dispatch(fetchProductsById(value, id));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Category
|
|
92
|
+
case 5:
|
|
93
|
+
{
|
|
94
|
+
const params = {
|
|
95
|
+
categoryId: value,
|
|
96
|
+
...sanitizedOptions
|
|
97
|
+
};
|
|
98
|
+
return dispatch(fetchProducts({
|
|
99
|
+
params,
|
|
100
|
+
...(id && {
|
|
101
|
+
id
|
|
102
|
+
}),
|
|
103
|
+
includeFilters: false
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
default:
|
|
107
|
+
}
|
|
108
|
+
return null;
|
|
109
|
+
};
|
|
110
|
+
export default fetchProductsByQuery;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import fetchHighlightProducts from"./fetchHighlightProducts"
|
|
1
|
+
import fetchHighlightProducts from "./fetchHighlightProducts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
2
4
|
* Maybe requests highlight products from server.
|
|
3
5
|
* @param {Object} options The options for the fetchProducts request.
|
|
4
6
|
* @param {Object} options.params The params for the getHighlightProducts pipeline.
|
|
5
7
|
* @param {string} [options.id=null] A unique id for the component that is using this action.
|
|
6
8
|
* @return {Function} The dispatched action.
|
|
7
9
|
* @deprecated
|
|
8
|
-
*/
|
|
10
|
+
*/
|
|
11
|
+
const getHighlightProducts = fetchHighlightProducts;
|
|
12
|
+
export default getHighlightProducts;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import fetchLiveshoppingProducts from"./fetchLiveshoppingProducts"
|
|
1
|
+
import fetchLiveshoppingProducts from "./fetchLiveshoppingProducts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
2
4
|
* Retrieves the information for the liveshopping products widget.
|
|
3
5
|
* @return {Function} A redux thunk.
|
|
4
6
|
* @deprecated
|
|
5
|
-
*/
|
|
7
|
+
*/
|
|
8
|
+
const getLiveshoppingProducts = fetchLiveshoppingProducts;
|
|
9
|
+
export default getLiveshoppingProducts;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import fetchProduct from"./fetchProduct"
|
|
1
|
+
import fetchProduct from "./fetchProduct";
|
|
2
|
+
|
|
3
|
+
/**
|
|
2
4
|
* Retrieves a product from the Redux store.
|
|
3
5
|
* @param {string} productId The product ID.
|
|
4
6
|
* @param {boolean} [forceFetch=false] Skips shouldFetchData check. Always fetches.
|
|
5
7
|
* @param {boolean} [shouldProcessProductFlags=true] Skips processProductFlags()
|
|
6
8
|
* @return {Function} A redux thunk.
|
|
7
9
|
* @deprecated
|
|
8
|
-
*/
|
|
10
|
+
*/
|
|
11
|
+
const getProduct = fetchProduct;
|
|
12
|
+
export default getProduct;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import fetchProductDescription from"./fetchProductDescription"
|
|
1
|
+
import fetchProductDescription from "./fetchProductDescription";
|
|
2
|
+
|
|
3
|
+
/**
|
|
2
4
|
* Maybe requests a product description from server.
|
|
3
5
|
* @param {string} productId The product ID.
|
|
4
6
|
* @return {Function} The dispatched action.
|
|
5
7
|
* @deprecated
|
|
6
|
-
*/
|
|
8
|
+
*/
|
|
9
|
+
const getProductDescription = fetchProductDescription;
|
|
10
|
+
export default getProductDescription;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import fetchProductImages from"./fetchProductImages"
|
|
1
|
+
import fetchProductImages from "./fetchProductImages";
|
|
2
|
+
|
|
3
|
+
/**
|
|
2
4
|
* Maybe requests images for a product from server.
|
|
3
5
|
* @param {string} productId The product ID.
|
|
4
6
|
* @param {Array} [formats] The requested formats.
|
|
5
7
|
* @return {Function} The dispatched action.
|
|
6
8
|
* @deprecated
|
|
7
|
-
*/
|
|
9
|
+
*/
|
|
10
|
+
const getProductImages = fetchProductImages;
|
|
11
|
+
export default getProductImages;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import fetchProductOptions from"./fetchProductOptions"
|
|
1
|
+
import fetchProductOptions from "./fetchProductOptions";
|
|
2
|
+
|
|
3
|
+
/**
|
|
2
4
|
* Retrieves product options from store.
|
|
3
5
|
* @param {string} productId The product ID for which the product options are requested.
|
|
4
6
|
* @return {Function} A Redux Thunk
|
|
5
7
|
* @deprecated
|
|
6
|
-
*/
|
|
8
|
+
*/
|
|
9
|
+
const getProductOptions = fetchProductOptions;
|
|
10
|
+
export default getProductOptions;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import fetchProductProperties from"./fetchProductProperties"
|
|
1
|
+
import fetchProductProperties from "./fetchProductProperties";
|
|
2
|
+
|
|
3
|
+
/**
|
|
2
4
|
* Maybe requests a product description from server.
|
|
3
5
|
* @param {string} productId The product ID.
|
|
4
6
|
* @return {Function} The dispatched action.
|
|
5
7
|
* @deprecated
|
|
6
|
-
*/
|
|
8
|
+
*/
|
|
9
|
+
const getProductProperties = fetchProductProperties;
|
|
10
|
+
export default getProductProperties;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import fetchProductRelations from"./fetchProductRelations"
|
|
1
|
+
import fetchProductRelations from "./fetchProductRelations";
|
|
2
|
+
|
|
3
|
+
/**
|
|
2
4
|
* Action starts product relation fetching process.
|
|
3
5
|
* Returns early if product relation cache is still valid.
|
|
4
6
|
* @param {Object} params Params.
|
|
@@ -7,4 +9,6 @@ import fetchProductRelations from"./fetchProductRelations";/**
|
|
|
7
9
|
* @param {number} params.limit Query limit.
|
|
8
10
|
* @returns {Function}
|
|
9
11
|
* @deprecated
|
|
10
|
-
*/
|
|
12
|
+
*/
|
|
13
|
+
const getProductRelations = fetchProductRelations;
|
|
14
|
+
export default getProductRelations;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import fetchProductShipping from"./fetchProductShipping"
|
|
1
|
+
import fetchProductShipping from "./fetchProductShipping";
|
|
2
|
+
|
|
3
|
+
/**
|
|
2
4
|
* Retrieves product shipping from the store.
|
|
3
5
|
* @param {string} productId The product ID for which the product shipping is requested.
|
|
4
6
|
* @return {Function} A Redux Thunk
|
|
5
7
|
* @deprecated
|
|
6
|
-
*/
|
|
8
|
+
*/
|
|
9
|
+
const getProductShipping = fetchProductShipping;
|
|
10
|
+
export default getProductShipping;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import fetchProductVariants from"./fetchProductVariants"
|
|
1
|
+
import fetchProductVariants from "./fetchProductVariants";
|
|
2
|
+
|
|
3
|
+
/**
|
|
2
4
|
* Retrieves product variants from store.
|
|
3
5
|
* @param {string} productId The product ID for which the product variants are requested.
|
|
4
6
|
* @return {Function} A Redux Thunk
|
|
5
7
|
* @deprecated
|
|
6
|
-
*/
|
|
8
|
+
*/
|
|
9
|
+
const getProductVariants = fetchProductVariants;
|
|
10
|
+
export default getProductVariants;
|