@pelcro/react-pelcro-js 3.26.0-beta.75 → 3.26.0-beta.77

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/dist/index.cjs.js CHANGED
@@ -3835,7 +3835,8 @@ var buttons$l = {
3835
3835
  var messages$10 = {
3836
3836
  orderConfirmed: {
3837
3837
  title: "Order confirmed!",
3838
- body: "Your order has been confirmed and will be shipped within the next few days. You'll shortly receive an email confirmation of this order."
3838
+ body: "Your order has been confirmed and will be shipped within the next few days. You'll shortly receive an email confirmation of this order.",
3839
+ bodyDigital: "Your order has been confirmed. You'll shortly receive an email confirmation of this order."
3839
3840
  },
3840
3841
  haveQuestions: "If you have any queries please don't hesitate to contact us!",
3841
3842
  multipleCurrencies: "Your cart currently contains items which are available in different currencies. In order to proceed with the checkout, please make sure that all items have the same currency.",
@@ -4797,9 +4798,10 @@ var buttons$f = {
4797
4798
  var messages$J = {
4798
4799
  orderConfirmed: {
4799
4800
  title: "Votre commande est confirmée !",
4800
- body: "Votre commande a été confirmée et vous sera expédiée dans les prochains jours. Vous recevrez un courriel de confirmation sous peu."
4801
+ body: "Votre commande a été confirmée et vous sera expédiée dans les prochains jours. Vous recevrez un courriel de confirmation sous peu.",
4802
+ bodyDigital: "Votre commande a été confirmée. Vous recevrez un courriel de confirmation sous peu."
4801
4803
  },
4802
- haveQuestions: "Nhésitez pas à nous contacter pour toute question !",
4804
+ haveQuestions: "N'hésitez pas à nous contacter pour toute question !",
4803
4805
  multipleCurrencies: "Votre panier contient des articles disponibles dans différentes devises. Avant de passer à la caisse, veuillez vous assurer que tous les articles ont la même devise.",
4804
4806
  currencyMismatch: "Les articles sélectionnés ne sont pas compatibles avec la devise associée à votre compte ({{currency}}). Veuillez choisir des articles uniquement offerts dans cette devise."
4805
4807
  };
@@ -5747,7 +5749,8 @@ var buttons$9 = {
5747
5749
  var messages$q = {
5748
5750
  orderConfirmed: {
5749
5751
  title: "주문이 확인되었습니다!",
5750
- body: "귀하의 주문이 확인되었으며 며칠 안에 배송될 예정입니다. 이 주문의 확인 이메일이 귀하에게 전송됩니다."
5752
+ body: "귀하의 주문이 확인되었으며 며칠 안에 배송될 예정입니다. 이 주문의 확인 이메일이 귀하에게 전송됩니다.",
5753
+ bodyDigital: "귀하의 주문이 확인되었습니다. 이 주문의 확인 이메일이 귀하에게 전송됩니다."
5751
5754
  },
5752
5755
  haveQuestions: "질문이 있으면 언제든 저희에게 연락주시기 바랍니다!",
5753
5756
  multipleCurrencies: "장바구니에 다른 통화로만 결제가 가능한 아이템이 있습니다. 결제를 계속 진행하려면 모든 아이템의 결제 통화가 동일한지 확인하십시오.",
@@ -6800,7 +6803,8 @@ var buttons$3 = {
6800
6803
  var messages$7 = {
6801
6804
  orderConfirmed: {
6802
6805
  title: "¡Orden confirmada!",
6803
- body: "Tu orden ha sido confirmada y será enviada en los próximos días. En breve recibirás un correo electrónico de confirmación de esta orden."
6806
+ body: "Tu orden ha sido confirmada y será enviada en los próximos días. En breve recibirás un correo electrónico de confirmación de esta orden.",
6807
+ bodyDigital: "Tu orden ha sido confirmada. En breve recibirás un correo electrónico de confirmación de esta orden."
6804
6808
  },
6805
6809
  haveQuestions: "¡Si tienes alguna pregunta, no dudes en contactarnos!",
6806
6810
  multipleCurrencies: "Tu carrito actualmente contiene artículos que están disponibles en diferentes divisas. Para proceder a la compra, asegúrate de que todos los artículos tengan la misma divisa.",
@@ -20457,6 +20461,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
20457
20461
  address_id: selectedAddressId
20458
20462
  }, handleCouponResponse);
20459
20463
  } else if (type === "orderCreate") {
20464
+ var _window$Pelcro$site$r9;
20460
20465
  const isQuickPurchase = !Array.isArray(order);
20461
20466
  const mappedOrderItems = isQuickPurchase ? [{
20462
20467
  sku_id: order.id,
@@ -20465,10 +20470,14 @@ const PaymentMethodContainerWithoutStripe = _ref => {
20465
20470
  sku_id: item.id,
20466
20471
  quantity: item.quantity
20467
20472
  }));
20468
- window.Pelcro.ecommerce.order.createSummary({
20473
+ const orderSummaryParams = {
20469
20474
  items: mappedOrderItems,
20470
20475
  coupon_code: couponCode
20471
- }, handleCouponResponse);
20476
+ };
20477
+ if ((_window$Pelcro$site$r9 = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r9 !== void 0 && _window$Pelcro$site$r9.taxes_enabled) {
20478
+ orderSummaryParams.address_id = selectedAddressId;
20479
+ }
20480
+ window.Pelcro.ecommerce.order.createSummary(orderSummaryParams, handleCouponResponse);
20472
20481
  }
20473
20482
  }
20474
20483
  };
@@ -21371,11 +21380,11 @@ const PaymentMethodContainerWithoutStripe = _ref => {
21371
21380
  * @return {Promise}
21372
21381
  */
21373
21382
  const resolveTaxCalculation = () => {
21374
- var _window$Pelcro$site$r9;
21383
+ var _window$Pelcro$site$r10;
21375
21384
  if (type === "invoicePayment") {
21376
21385
  return new Promise(resolve => resolve());
21377
21386
  }
21378
- const taxesEnabled = (_window$Pelcro$site$r9 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r9 === void 0 ? void 0 : _window$Pelcro$site$r9.taxes_enabled;
21387
+ const taxesEnabled = (_window$Pelcro$site$r10 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r10 === void 0 ? void 0 : _window$Pelcro$site$r10.taxes_enabled;
21379
21388
  return new Promise((resolve, reject) => {
21380
21389
  // resolve early if taxes isn't enabled
21381
21390
  if (!taxesEnabled) {
@@ -29239,6 +29248,12 @@ const OrderConfirmModal = props => {
29239
29248
  props === null || props === void 0 ? void 0 : (_props$onClose = props.onClose) === null || _props$onClose === void 0 ? void 0 : _props$onClose.call(props);
29240
29249
  resetView();
29241
29250
  };
29251
+
29252
+ // Check if any items in the order are shippable
29253
+ const hasShippableItems = latestOrder === null || latestOrder === void 0 ? void 0 : latestOrder.items.some(item => {
29254
+ const product = window.Pelcro.ecommerce.products.getBySkuId(item.product_sku_id);
29255
+ return product === null || product === void 0 ? void 0 : product.shippable;
29256
+ });
29242
29257
  return /*#__PURE__*/React__default['default'].createElement(Modal, {
29243
29258
  id: "pelcro-order-confirm-modal",
29244
29259
  className: "plc-border-t-8 plc-border-primary-500",
@@ -29254,7 +29269,7 @@ const OrderConfirmModal = props => {
29254
29269
  className: "plc-text-center plc-text-gray-900"
29255
29270
  }, /*#__PURE__*/React__default['default'].createElement("h4", {
29256
29271
  className: "plc-mb-4 plc-text-3xl"
29257
- }, t("messages.orderConfirmed.title")), /*#__PURE__*/React__default['default'].createElement("p", null, t("messages.orderConfirmed.body")), /*#__PURE__*/React__default['default'].createElement("p", null, t("messages.haveQuestions")))), /*#__PURE__*/React__default['default'].createElement("div", {
29272
+ }, t("messages.orderConfirmed.title")), /*#__PURE__*/React__default['default'].createElement("p", null, hasShippableItems ? t("messages.orderConfirmed.body") : t("messages.orderConfirmed.bodyDigital")), /*#__PURE__*/React__default['default'].createElement("p", null, t("messages.haveQuestions")))), /*#__PURE__*/React__default['default'].createElement("div", {
29258
29273
  className: "plc-mt-5 pelcro-order-summary-wrapper"
29259
29274
  }, /*#__PURE__*/React__default['default'].createElement("p", {
29260
29275
  className: "plc-font-bold pelcro-order-summary-title"
package/dist/index.esm.js CHANGED
@@ -3805,7 +3805,8 @@ var buttons$l = {
3805
3805
  var messages$10 = {
3806
3806
  orderConfirmed: {
3807
3807
  title: "Order confirmed!",
3808
- body: "Your order has been confirmed and will be shipped within the next few days. You'll shortly receive an email confirmation of this order."
3808
+ body: "Your order has been confirmed and will be shipped within the next few days. You'll shortly receive an email confirmation of this order.",
3809
+ bodyDigital: "Your order has been confirmed. You'll shortly receive an email confirmation of this order."
3809
3810
  },
3810
3811
  haveQuestions: "If you have any queries please don't hesitate to contact us!",
3811
3812
  multipleCurrencies: "Your cart currently contains items which are available in different currencies. In order to proceed with the checkout, please make sure that all items have the same currency.",
@@ -4767,9 +4768,10 @@ var buttons$f = {
4767
4768
  var messages$J = {
4768
4769
  orderConfirmed: {
4769
4770
  title: "Votre commande est confirmée !",
4770
- body: "Votre commande a été confirmée et vous sera expédiée dans les prochains jours. Vous recevrez un courriel de confirmation sous peu."
4771
+ body: "Votre commande a été confirmée et vous sera expédiée dans les prochains jours. Vous recevrez un courriel de confirmation sous peu.",
4772
+ bodyDigital: "Votre commande a été confirmée. Vous recevrez un courriel de confirmation sous peu."
4771
4773
  },
4772
- haveQuestions: "Nhésitez pas à nous contacter pour toute question !",
4774
+ haveQuestions: "N'hésitez pas à nous contacter pour toute question !",
4773
4775
  multipleCurrencies: "Votre panier contient des articles disponibles dans différentes devises. Avant de passer à la caisse, veuillez vous assurer que tous les articles ont la même devise.",
4774
4776
  currencyMismatch: "Les articles sélectionnés ne sont pas compatibles avec la devise associée à votre compte ({{currency}}). Veuillez choisir des articles uniquement offerts dans cette devise."
4775
4777
  };
@@ -5717,7 +5719,8 @@ var buttons$9 = {
5717
5719
  var messages$q = {
5718
5720
  orderConfirmed: {
5719
5721
  title: "주문이 확인되었습니다!",
5720
- body: "귀하의 주문이 확인되었으며 며칠 안에 배송될 예정입니다. 이 주문의 확인 이메일이 귀하에게 전송됩니다."
5722
+ body: "귀하의 주문이 확인되었으며 며칠 안에 배송될 예정입니다. 이 주문의 확인 이메일이 귀하에게 전송됩니다.",
5723
+ bodyDigital: "귀하의 주문이 확인되었습니다. 이 주문의 확인 이메일이 귀하에게 전송됩니다."
5721
5724
  },
5722
5725
  haveQuestions: "질문이 있으면 언제든 저희에게 연락주시기 바랍니다!",
5723
5726
  multipleCurrencies: "장바구니에 다른 통화로만 결제가 가능한 아이템이 있습니다. 결제를 계속 진행하려면 모든 아이템의 결제 통화가 동일한지 확인하십시오.",
@@ -6770,7 +6773,8 @@ var buttons$3 = {
6770
6773
  var messages$7 = {
6771
6774
  orderConfirmed: {
6772
6775
  title: "¡Orden confirmada!",
6773
- body: "Tu orden ha sido confirmada y será enviada en los próximos días. En breve recibirás un correo electrónico de confirmación de esta orden."
6776
+ body: "Tu orden ha sido confirmada y será enviada en los próximos días. En breve recibirás un correo electrónico de confirmación de esta orden.",
6777
+ bodyDigital: "Tu orden ha sido confirmada. En breve recibirás un correo electrónico de confirmación de esta orden."
6774
6778
  },
6775
6779
  haveQuestions: "¡Si tienes alguna pregunta, no dudes en contactarnos!",
6776
6780
  multipleCurrencies: "Tu carrito actualmente contiene artículos que están disponibles en diferentes divisas. Para proceder a la compra, asegúrate de que todos los artículos tengan la misma divisa.",
@@ -20427,6 +20431,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
20427
20431
  address_id: selectedAddressId
20428
20432
  }, handleCouponResponse);
20429
20433
  } else if (type === "orderCreate") {
20434
+ var _window$Pelcro$site$r9;
20430
20435
  const isQuickPurchase = !Array.isArray(order);
20431
20436
  const mappedOrderItems = isQuickPurchase ? [{
20432
20437
  sku_id: order.id,
@@ -20435,10 +20440,14 @@ const PaymentMethodContainerWithoutStripe = _ref => {
20435
20440
  sku_id: item.id,
20436
20441
  quantity: item.quantity
20437
20442
  }));
20438
- window.Pelcro.ecommerce.order.createSummary({
20443
+ const orderSummaryParams = {
20439
20444
  items: mappedOrderItems,
20440
20445
  coupon_code: couponCode
20441
- }, handleCouponResponse);
20446
+ };
20447
+ if ((_window$Pelcro$site$r9 = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r9 !== void 0 && _window$Pelcro$site$r9.taxes_enabled) {
20448
+ orderSummaryParams.address_id = selectedAddressId;
20449
+ }
20450
+ window.Pelcro.ecommerce.order.createSummary(orderSummaryParams, handleCouponResponse);
20442
20451
  }
20443
20452
  }
20444
20453
  };
@@ -21341,11 +21350,11 @@ const PaymentMethodContainerWithoutStripe = _ref => {
21341
21350
  * @return {Promise}
21342
21351
  */
21343
21352
  const resolveTaxCalculation = () => {
21344
- var _window$Pelcro$site$r9;
21353
+ var _window$Pelcro$site$r10;
21345
21354
  if (type === "invoicePayment") {
21346
21355
  return new Promise(resolve => resolve());
21347
21356
  }
21348
- const taxesEnabled = (_window$Pelcro$site$r9 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r9 === void 0 ? void 0 : _window$Pelcro$site$r9.taxes_enabled;
21357
+ const taxesEnabled = (_window$Pelcro$site$r10 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r10 === void 0 ? void 0 : _window$Pelcro$site$r10.taxes_enabled;
21349
21358
  return new Promise((resolve, reject) => {
21350
21359
  // resolve early if taxes isn't enabled
21351
21360
  if (!taxesEnabled) {
@@ -29209,6 +29218,12 @@ const OrderConfirmModal = props => {
29209
29218
  props === null || props === void 0 ? void 0 : (_props$onClose = props.onClose) === null || _props$onClose === void 0 ? void 0 : _props$onClose.call(props);
29210
29219
  resetView();
29211
29220
  };
29221
+
29222
+ // Check if any items in the order are shippable
29223
+ const hasShippableItems = latestOrder === null || latestOrder === void 0 ? void 0 : latestOrder.items.some(item => {
29224
+ const product = window.Pelcro.ecommerce.products.getBySkuId(item.product_sku_id);
29225
+ return product === null || product === void 0 ? void 0 : product.shippable;
29226
+ });
29212
29227
  return /*#__PURE__*/React__default.createElement(Modal, {
29213
29228
  id: "pelcro-order-confirm-modal",
29214
29229
  className: "plc-border-t-8 plc-border-primary-500",
@@ -29224,7 +29239,7 @@ const OrderConfirmModal = props => {
29224
29239
  className: "plc-text-center plc-text-gray-900"
29225
29240
  }, /*#__PURE__*/React__default.createElement("h4", {
29226
29241
  className: "plc-mb-4 plc-text-3xl"
29227
- }, t("messages.orderConfirmed.title")), /*#__PURE__*/React__default.createElement("p", null, t("messages.orderConfirmed.body")), /*#__PURE__*/React__default.createElement("p", null, t("messages.haveQuestions")))), /*#__PURE__*/React__default.createElement("div", {
29242
+ }, t("messages.orderConfirmed.title")), /*#__PURE__*/React__default.createElement("p", null, hasShippableItems ? t("messages.orderConfirmed.body") : t("messages.orderConfirmed.bodyDigital")), /*#__PURE__*/React__default.createElement("p", null, t("messages.haveQuestions")))), /*#__PURE__*/React__default.createElement("div", {
29228
29243
  className: "plc-mt-5 pelcro-order-summary-wrapper"
29229
29244
  }, /*#__PURE__*/React__default.createElement("p", {
29230
29245
  className: "plc-font-bold pelcro-order-summary-title"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pelcro/react-pelcro-js",
3
3
  "description": "Pelcro's React UI Elements",
4
- "version": "3.26.0-beta.75",
4
+ "version": "3.26.0-beta.77",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",