@shopgate/engage 7.6.1-beta.4 → 7.7.0-beta.1
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.
|
@@ -2,7 +2,7 @@ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<argum
|
|
|
2
2
|
* Converts order line items to cart items
|
|
3
3
|
* @param {Array} lineItems The line items to be converted
|
|
4
4
|
* @return {Array}
|
|
5
|
-
*/export var convertLineItemsToCartItems=function convertLineItemsToCartItems(){var lineItems=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return lineItems.map(function(lineItem){var id=lineItem.code,quantity=lineItem.quantity,_lineItem$orderedQuan=lineItem.orderedQuantity,orderedQuantity=_lineItem$orderedQuan===void 0?null:_lineItem$orderedQuan,salePrice=lineItem.salePrice,lineItemPrice=lineItem.price,promoAmount=lineItem.promoAmount,extendedPrice=lineItem.extendedPrice,discountAmount=lineItem.discountAmount,unitDiscountAmount=lineItem.unitDiscountAmount,unitPromoAmount=lineItem.unitPromoAmount,product=lineItem.product,status=lineItem.status,subStatus=lineItem.subStatus,fulfillmentMethod=lineItem.fulfillmentMethod,fulfillmentLocationCode=lineItem.fulfillmentLocationCode,substitutionAllowed=lineItem.substitutionAllowed;var productCode=product.code,productPrice=product.price,productSalePrice=product.salePrice,productEffectivePrice=product.effectivePrice,name=product.name,image=product.image,unit=product.unit,_product$hasCatchWeig=product.hasCatchWeight,hasCatchWeight=_product$hasCatchWeig===void 0?false:_product$hasCatchWeig,options=product.options;var properties=[];var appliedDiscounts=[];var additionalInfo=[];var coupon=null;var messages=[];var fulfillmentMethods;var fulfillment;var featuredImageUrl=null;if(Array.isArray(options)){properties=options.map(function(option){return{label:option.name,value:option.values[0]
|
|
5
|
+
*/export var convertLineItemsToCartItems=function convertLineItemsToCartItems(){var lineItems=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return lineItems.map(function(lineItem){var id=lineItem.code,quantity=lineItem.quantity,_lineItem$orderedQuan=lineItem.orderedQuantity,orderedQuantity=_lineItem$orderedQuan===void 0?null:_lineItem$orderedQuan,salePrice=lineItem.salePrice,lineItemPrice=lineItem.price,promoAmount=lineItem.promoAmount,extendedPrice=lineItem.extendedPrice,discountAmount=lineItem.discountAmount,unitDiscountAmount=lineItem.unitDiscountAmount,unitPromoAmount=lineItem.unitPromoAmount,product=lineItem.product,status=lineItem.status,subStatus=lineItem.subStatus,fulfillmentMethod=lineItem.fulfillmentMethod,fulfillmentLocationCode=lineItem.fulfillmentLocationCode,substitutionAllowed=lineItem.substitutionAllowed;var productCode=product.code,productPrice=product.price,productSalePrice=product.salePrice,productEffectivePrice=product.effectivePrice,name=product.name,image=product.image,unit=product.unit,_product$hasCatchWeig=product.hasCatchWeight,hasCatchWeight=_product$hasCatchWeig===void 0?false:_product$hasCatchWeig,options=product.options;var properties=[];var appliedDiscounts=[];var additionalInfo=[];var coupon=null;var messages=[];var fulfillmentMethods;var fulfillment;var featuredImageUrl=null;if(Array.isArray(options)){properties=options.map(function(option){var _option$value,_option$values,_option$values$;return{label:option.name,value:(option===null||option===void 0?void 0:(_option$value=option.value)===null||_option$value===void 0?void 0:_option$value.name)||(option===null||option===void 0?void 0:(_option$values=option.values)===null||_option$values===void 0?void 0:(_option$values$=_option$values[0])===null||_option$values$===void 0?void 0:_option$values$.name)};});}if(fulfillmentMethod!==DIRECT_SHIP){fulfillmentMethods=[fulfillmentMethod];fulfillment={method:fulfillmentMethod,location:{code:fulfillmentLocationCode}};}if(image){if(image.includes('?')){featuredImageUrl="".concat(image,"&width=440&height=440&format=jpeg&fill=fff");}else{featuredImageUrl="".concat(image,"?width=440&height=440&format=jpeg&fill=fff");}}return{id:id,quantity:quantity,orderedQuantity:orderedQuantity,coupon:coupon,messages:messages,type:'product',status:status,subStatus:subStatus,product:{id:productCode,featuredImageUrl:featuredImageUrl,name:name,properties:properties,appliedDiscounts:appliedDiscounts,additionalInfo:additionalInfo,unit:unit,hasCatchWeight:hasCatchWeight,price:{unit:productPrice,unitSpecial:productSalePrice,"default":lineItemPrice,special:salePrice||null,unitSale:productSalePrice,unitEffective:productEffectivePrice,info:''},fulfillmentMethods:fulfillmentMethods},unitPromoAmount:unitPromoAmount,unitDiscountAmount:unitDiscountAmount,price:lineItemPrice,extendedPrice:extendedPrice,promoAmount:promoAmount,discountAmount:discountAmount,fulfillment:fulfillment,fulfillmentLocationId:fulfillmentLocationCode,substitutionAllowed:substitutionAllowed};});};/**
|
|
6
6
|
* Extracts the promotions without coupon from the order.
|
|
7
7
|
* @param {Object} order An order object
|
|
8
8
|
* @returns {Array}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopgate/engage",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.7.0-beta.1",
|
|
4
4
|
"description": "Shopgate's ENGAGE library.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Shopgate <support@shopgate.com>",
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@shopgate/native-modules": "1.0.0-beta.18",
|
|
19
|
-
"@shopgate/pwa-common": "7.
|
|
20
|
-
"@shopgate/pwa-common-commerce": "7.
|
|
21
|
-
"@shopgate/pwa-core": "7.
|
|
22
|
-
"@shopgate/pwa-ui-ios": "7.
|
|
23
|
-
"@shopgate/pwa-ui-material": "7.
|
|
24
|
-
"@shopgate/pwa-ui-shared": "7.
|
|
19
|
+
"@shopgate/pwa-common": "7.7.0-beta.1",
|
|
20
|
+
"@shopgate/pwa-common-commerce": "7.7.0-beta.1",
|
|
21
|
+
"@shopgate/pwa-core": "7.7.0-beta.1",
|
|
22
|
+
"@shopgate/pwa-ui-ios": "7.7.0-beta.1",
|
|
23
|
+
"@shopgate/pwa-ui-material": "7.7.0-beta.1",
|
|
24
|
+
"@shopgate/pwa-ui-shared": "7.7.0-beta.1",
|
|
25
25
|
"@stripe/react-stripe-js": "^1.1.2",
|
|
26
26
|
"@stripe/stripe-js": "^1.3.1",
|
|
27
27
|
"@virtuous/conductor": "~2.5.0",
|