@perceptimagery/dita-configurator-staging 0.2.1307 → 0.2.1311

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.
Files changed (2) hide show
  1. package/dist/index.js +34 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -112,7 +112,7 @@ var __publicField = (obj, key, value) => {
112
112
  host: "https://api.sprie.io"
113
113
  };
114
114
  const config$1 = Object.freeze(Config$2);
115
- const version$1 = "0.2.1307";
115
+ const version$1 = "0.2.1311";
116
116
  function modifyLensArr$1(arr, element) {
117
117
  const index = arr.findIndex((e) => e["sku"] === element["sku"]);
118
118
  if (index !== -1) {
@@ -213,6 +213,16 @@ var __publicField = (obj, key, value) => {
213
213
  }
214
214
  }
215
215
  async HandleShopifyAddToCart(items) {
216
+ items.forEach((ele) => {
217
+ var _a2;
218
+ const text = (_a2 = ele.properties) == null ? void 0 : _a2.customText;
219
+ if (text) {
220
+ delete ele.properties["customText"];
221
+ Object.assign(ele.properties, { "custom-laser-etching": "Add Laser Engraving" });
222
+ Object.assign(ele.properties, { "custom-text": text });
223
+ Object.assign(ele.properties, { "This customized item cannot be returned or exchanged": "I agree" });
224
+ }
225
+ });
216
226
  let formData = {
217
227
  "items": items,
218
228
  "sections": "mini-cart"
@@ -1043,20 +1053,34 @@ var __publicField = (obj, key, value) => {
1043
1053
  };
1044
1054
  customEvent.emitEvent("onAddToCart", eventData);
1045
1055
  var cartItems = [];
1046
- if (frameVariantId) {
1047
- var frameItem = {
1048
- id: frameId,
1049
- quantity: 1
1050
- };
1051
- cartItems.push(frameItem);
1052
- }
1053
1056
  if (lensVariantId) {
1054
- var lensItem = {
1057
+ let lensItem = {
1055
1058
  id: lensId,
1056
- quantity: 1
1059
+ quantity: 1,
1060
+ properties: null
1057
1061
  };
1058
1062
  cartItems.push(lensItem);
1059
1063
  }
1064
+ if (frameVariantId) {
1065
+ const engravingProps = {
1066
+ customText: "This is an engraving test"
1067
+ };
1068
+ const isFlight006x = frameVariantId.value == "46792553201897";
1069
+ if (isFlight006x) {
1070
+ let engravingItem = {
1071
+ id: 44745490890985,
1072
+ quantity: 1,
1073
+ properties: null
1074
+ };
1075
+ cartItems.push(engravingItem);
1076
+ }
1077
+ let frameItem = {
1078
+ id: frameId,
1079
+ quantity: 1,
1080
+ properties: isFlight006x ? engravingProps : null
1081
+ };
1082
+ cartItems.push(frameItem);
1083
+ }
1060
1084
  apiService2.HandleShopifyAddToCart(cartItems);
1061
1085
  }
1062
1086
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perceptimagery/dita-configurator-staging",
3
- "version": "0.2.1307",
3
+ "version": "0.2.1311",
4
4
  "author": "Rohan Satpute <rohan@perceptimagery.com>",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",