@shopgate/pwa-tracking 7.5.1 → 7.5.2
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/helpers/index.js +2 -2
- package/package.json +5 -5
package/helpers/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import get from'lodash/get';import find from'lodash/find';import{logger}from'@shopgate/pwa-core/helpers';import{QR_CODE_TYPE_HOMEPAGE,QR_CODE_TYPE_PRODUCT,QR_CODE_TYPE_PRODUCT_WITH_COUPON,QR_CODE_TYPE_COUPON,QR_CODE_TYPE_CATEGORY,QR_CODE_TYPE_SEARCH,QR_CODE_TYPE_PAGE,SCANNER_FORMATS_BARCODE,SCANNER_FORMATS_QR_CODE}from'@shopgate/pwa-common-commerce/scanner/constants';import{parse2dsQrCode}from'@shopgate/pwa-common-commerce/scanner/helpers';import core from'@shopgate/tracking-core/core/Core';import{shopNumber}from'@shopgate/pwa-common/helpers/config';import{i18n}from'@shopgate/engage/core';/**
|
|
1
|
+
function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import get from'lodash/get';import find from'lodash/find';import{logger}from'@shopgate/pwa-core/helpers';import{QR_CODE_TYPE_HOMEPAGE,QR_CODE_TYPE_PRODUCT,QR_CODE_TYPE_PRODUCT_WITH_COUPON,QR_CODE_TYPE_COUPON,QR_CODE_TYPE_CATEGORY,QR_CODE_TYPE_SEARCH,QR_CODE_TYPE_PAGE,SCANNER_FORMATS_BARCODE,SCANNER_FORMATS_QR_CODE}from'@shopgate/pwa-common-commerce/scanner/constants';import{parse2dsQrCode}from'@shopgate/pwa-common-commerce/scanner/helpers';import core from'@shopgate/tracking-core/core/Core';import appConfig,{shopNumber}from'@shopgate/pwa-common/helpers/config';import{i18n}from'@shopgate/engage/core';/**
|
|
2
2
|
* Converts a price to a formatted string.
|
|
3
3
|
* @param {number} price The original price.
|
|
4
4
|
* @return {string|*} The converted price or the original value, if the price was not convertible.
|
|
@@ -6,7 +6,7 @@ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<argum
|
|
|
6
6
|
* Re-format a given product from the store.
|
|
7
7
|
* @param {Object} productData The product data from the store
|
|
8
8
|
* @returns {Object|null} The formatted product.
|
|
9
|
-
*/export var formatProductData=function formatProductData(productData){if(!productData){return null;}var id=productData.id,name=productData.name,price=productData.price,manufacturer=productData.manufacturer,_productData$tags=productData.tags,tags=_productData$tags===void 0?[]:_productData$tags;return{name:name,manufacturer:manufacturer,tags:tags,uid:
|
|
9
|
+
*/export var formatProductData=function formatProductData(productData){if(!productData){return null;}var id=productData.id,name=productData.name,price=productData.price,manufacturer=productData.manufacturer,_productData$tags=productData.tags,tags=_productData$tags===void 0?[]:_productData$tags,_productData$identifi=productData.identifiers,identifiers=_productData$identifi===void 0?{}:_productData$identifi;var uid=appConfig.tracking.useSkuAsProductId&&identifiers.sku?identifiers.sku:id;return{name:name,manufacturer:manufacturer,tags:tags,uid:uid,amount:{net:convertPriceToString(price.unitPriceNet),gross:convertPriceToString(price.unitPriceWithTax),striked:convertPriceToString(price.unitPriceStriked),currency:price.currency}};};/**
|
|
10
10
|
* Reformat product data for addToCart from the store to the format our core expects.
|
|
11
11
|
* @param {Object} product Product from the store
|
|
12
12
|
* @param {Object} quantity Quantity of the product
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopgate/pwa-tracking",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.2",
|
|
4
4
|
"description": "Tracking library for the Shopgate Connect PWA.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Shopgate <support@shopgate.com>",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"connect"
|
|
16
16
|
],
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@shopgate/pwa-common": "7.5.
|
|
19
|
-
"@shopgate/pwa-common-commerce": "7.5.
|
|
20
|
-
"@shopgate/pwa-core": "7.5.
|
|
21
|
-
"@shopgate/tracking-core": "7.5.
|
|
18
|
+
"@shopgate/pwa-common": "7.5.2",
|
|
19
|
+
"@shopgate/pwa-common-commerce": "7.5.2",
|
|
20
|
+
"@shopgate/pwa-core": "7.5.2",
|
|
21
|
+
"@shopgate/tracking-core": "7.5.2",
|
|
22
22
|
"reselect": "^3.0.1",
|
|
23
23
|
"rxjs": "~5.5.12"
|
|
24
24
|
}
|