ordering-ui-external 2.3.8 → 2.4.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.
Files changed (39) hide show
  1. package/_bundles/{7.ordering-ui.b2b44cfc71966263a798.js → 7.ordering-ui.f617c2b14777b5518ddc.js} +1 -1
  2. package/_bundles/ordering-ui.f617c2b14777b5518ddc.js +2 -0
  3. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +6 -1
  4. package/_modules/themes/five/src/components/Cart/index.js +16 -16
  5. package/_modules/themes/five/src/components/Messages/index.js +3 -1
  6. package/_modules/themes/five/src/components/MultiCartsPaymethodsAndWallets/index.js +33 -8
  7. package/_modules/themes/five/src/components/MultiCartsPaymethodsAndWallets/styles.js +10 -6
  8. package/_modules/themes/five/src/components/MultiCheckout/index.js +43 -15
  9. package/_modules/themes/five/src/components/MyOrders/styles.js +3 -3
  10. package/_modules/themes/five/src/components/OrderDetails/OrderEta.js +6 -4
  11. package/_modules/themes/five/src/components/OrderProgress/index.js +2 -1
  12. package/_modules/themes/five/src/components/PageBanner/index.js +6 -6
  13. package/_modules/themes/five/src/components/PaymentOptions/index.js +22 -22
  14. package/_modules/themes/five/src/components/QueryLoginSpoonity/index.js +3 -2
  15. package/package.json +2 -2
  16. package/src/themes/five/src/components/BusinessProductsListing/index.js +7 -1
  17. package/src/themes/five/src/components/Cart/index.js +13 -19
  18. package/src/themes/five/src/components/Messages/index.js +4 -9
  19. package/src/themes/five/src/components/MultiCartsPaymethodsAndWallets/index.js +52 -16
  20. package/src/themes/five/src/components/MultiCartsPaymethodsAndWallets/styles.js +12 -0
  21. package/src/themes/five/src/components/MultiCheckout/index.js +37 -3
  22. package/src/themes/five/src/components/MyOrders/styles.js +2 -4
  23. package/src/themes/five/src/components/OrderDetails/OrderEta.js +4 -4
  24. package/src/themes/five/src/components/OrderProgress/index.js +2 -2
  25. package/src/themes/five/src/components/PageBanner/index.js +6 -6
  26. package/src/themes/five/src/components/PaymentOptions/index.js +2 -3
  27. package/src/themes/five/src/components/QueryLoginSpoonity/index.js +9 -1
  28. package/template/app.js +12 -10
  29. package/_bundles/ordering-ui.b2b44cfc71966263a798.js +0 -2
  30. /package/_bundles/{0.ordering-ui.b2b44cfc71966263a798.js → 0.ordering-ui.f617c2b14777b5518ddc.js} +0 -0
  31. /package/_bundles/{1.ordering-ui.b2b44cfc71966263a798.js → 1.ordering-ui.f617c2b14777b5518ddc.js} +0 -0
  32. /package/_bundles/{2.ordering-ui.b2b44cfc71966263a798.js → 2.ordering-ui.f617c2b14777b5518ddc.js} +0 -0
  33. /package/_bundles/{4.ordering-ui.b2b44cfc71966263a798.js → 4.ordering-ui.f617c2b14777b5518ddc.js} +0 -0
  34. /package/_bundles/{5.ordering-ui.b2b44cfc71966263a798.js → 5.ordering-ui.f617c2b14777b5518ddc.js} +0 -0
  35. /package/_bundles/{6.ordering-ui.b2b44cfc71966263a798.js → 6.ordering-ui.f617c2b14777b5518ddc.js} +0 -0
  36. /package/_bundles/{7.ordering-ui.b2b44cfc71966263a798.js.LICENSE.txt → 7.ordering-ui.f617c2b14777b5518ddc.js.LICENSE.txt} +0 -0
  37. /package/_bundles/{8.ordering-ui.b2b44cfc71966263a798.js → 8.ordering-ui.f617c2b14777b5518ddc.js} +0 -0
  38. /package/_bundles/{9.ordering-ui.b2b44cfc71966263a798.js → 9.ordering-ui.f617c2b14777b5518ddc.js} +0 -0
  39. /package/_bundles/{ordering-ui.b2b44cfc71966263a798.js.LICENSE.txt → ordering-ui.f617c2b14777b5518ddc.js.LICENSE.txt} +0 -0
@@ -8,7 +8,6 @@ exports.PaymentOptions = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _reactLoadingSkeleton = _interopRequireDefault(require("react-loading-skeleton"));
10
10
  var _IosRadioButtonOn = _interopRequireDefault(require("@meronex/icons/ios/IosRadioButtonOn"));
11
- var _BilStripe = _interopRequireDefault(require("@meronex/icons/bi/BilStripe"));
12
11
  var _FaCcStripe = _interopRequireDefault(require("@meronex/icons/fa/FaCcStripe"));
13
12
  var _FaStripeS = _interopRequireDefault(require("@meronex/icons/fa/FaStripeS"));
14
13
  var _GrStripe = _interopRequireDefault(require("@meronex/icons/gr/GrStripe"));
@@ -98,7 +97,7 @@ var paypalBtnStyle = {
98
97
  size: 'responsive'
99
98
  };
100
99
  var PaymentOptionsUI = function PaymentOptionsUI(props) {
101
- var _props$beforeElements, _props$beforeComponen, _paymethodsList$error, _cart$balance, _paymethodSelected$da2, _isOpenMethod$paymeth, _isOpenMethod$paymeth2, _isOpenMethod$paymeth3, _isOpenMethod$paymeth4, _isOpenMethod$paymeth5, _paymethodData$card, _paymethodData$card2, _paymethodData$card3, _isOpenMethod$paymeth6, _isOpenMethod$paymeth7, _isOpenMethod$paymeth8, _isOpenMethod$paymeth9, _isOpenMethod$paymeth10, _cart$balance2, _isOpenMethod$paymeth11, _isOpenMethod$paymeth12, _isOpenMethod$paymeth13, _isOpenMethod$paymeth14, _isOpenMethod$paymeth15, _isOpenMethod$paymeth16, _isOpenMethod$paymeth17, _isOpenMethod$paymeth18, _isOpenMethod$paymeth19, _isOpenMethod$paymeth20, _isOpenMethod$paymeth21, _isOpenMethod$paymeth22, _isOpenMethod$paymeth23, _isOpenMethod$paymeth24, _isOpenMethod$paymeth25, _isOpenMethod$paymeth26, _isOpenMethod$paymeth27, _isOpenMethod$paymeth28, _isOpenMethod$paymeth29, _isOpenMethod$paymeth30, _isOpenMethod$paymeth31, _isOpenMethod$paymeth32, _props$afterComponent, _props$afterElements;
100
+ var _props$beforeElements, _props$beforeComponen, _paymethodsList$error, _cart$balance, _paymethodSelected$da2, _isOpenMethod$paymeth2, _isOpenMethod$paymeth3, _isOpenMethod$paymeth4, _isOpenMethod$paymeth5, _isOpenMethod$paymeth6, _paymethodData$card, _paymethodData$card2, _paymethodData$card3, _isOpenMethod$paymeth7, _isOpenMethod$paymeth8, _isOpenMethod$paymeth9, _isOpenMethod$paymeth10, _isOpenMethod$paymeth11, _cart$balance2, _isOpenMethod$paymeth12, _isOpenMethod$paymeth13, _isOpenMethod$paymeth14, _isOpenMethod$paymeth15, _isOpenMethod$paymeth16, _isOpenMethod$paymeth17, _isOpenMethod$paymeth18, _isOpenMethod$paymeth19, _isOpenMethod$paymeth20, _isOpenMethod$paymeth21, _isOpenMethod$paymeth22, _isOpenMethod$paymeth23, _isOpenMethod$paymeth24, _isOpenMethod$paymeth25, _isOpenMethod$paymeth26, _isOpenMethod$paymeth27, _isOpenMethod$paymeth28, _isOpenMethod$paymeth29, _isOpenMethod$paymeth30, _isOpenMethod$paymeth31, _isOpenMethod$paymeth32, _isOpenMethod$paymeth33, _props$afterComponent, _props$afterElements;
102
101
  var cart = props.cart,
103
102
  errorCash = props.errorCash,
104
103
  isLoading = props.isLoading,
@@ -213,11 +212,12 @@ var PaymentOptionsUI = function PaymentOptionsUI(props) {
213
212
  }, !(paymethodsList.loading || isLoading) && supportedMethods.length > 0 && supportedMethods.sort(function (a, b) {
214
213
  return a.id - b.id;
215
214
  }).map(function (paymethod) {
215
+ var _isOpenMethod$paymeth;
216
216
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
217
217
  key: paymethod.id
218
218
  }, (!isCustomerMode || isCustomerMode && (paymethod.gateway === 'card_delivery' || paymethod.gateway === 'cash')) && /*#__PURE__*/_react.default.createElement(_styles.PayCard, {
219
219
  isDisabled: isDisabled,
220
- className: "card ".concat((paymethodSelected === null || paymethodSelected === void 0 ? void 0 : paymethodSelected.id) === paymethod.id ? 'active' : ''),
220
+ className: "card ".concat(((paymethodSelected === null || paymethodSelected === void 0 ? void 0 : paymethodSelected.id) || (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth === void 0 ? void 0 : _isOpenMethod$paymeth.id)) === paymethod.id ? 'active' : ''),
221
221
  onClick: function onClick() {
222
222
  return handlePaymentMethodClick(paymethod);
223
223
  }
@@ -242,12 +242,12 @@ var PaymentOptionsUI = function PaymentOptionsUI(props) {
242
242
  defaultValue: paymethodSelected === null || paymethodSelected === void 0 ? void 0 : (_paymethodSelected$da2 = paymethodSelected.data) === null || _paymethodSelected$da2 === void 0 ? void 0 : _paymethodSelected$da2.cash,
243
243
  onChangeData: handlePaymethodDataChange,
244
244
  setErrorCash: props.setErrorCash
245
- }), (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth === void 0 ? void 0 : _isOpenMethod$paymeth.gateway) === 'stripe' && ((_isOpenMethod$paymeth2 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth2 === void 0 ? void 0 : _isOpenMethod$paymeth2.gateway) === 'stripe' && /*#__PURE__*/_react.default.createElement(_PaymentOptionStripe.PaymentOptionStripe, {
245
+ }), (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth2 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth2 === void 0 ? void 0 : _isOpenMethod$paymeth2.gateway) === 'stripe' && ((_isOpenMethod$paymeth3 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth3 === void 0 ? void 0 : _isOpenMethod$paymeth3.gateway) === 'stripe' && /*#__PURE__*/_react.default.createElement(_PaymentOptionStripe.PaymentOptionStripe, {
246
246
  paymethod: isOpenMethod === null || isOpenMethod === void 0 ? void 0 : isOpenMethod.paymethod,
247
247
  businessId: props.businessId,
248
- publicKey: isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth3 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth3 === void 0 ? void 0 : (_isOpenMethod$paymeth4 = _isOpenMethod$paymeth3.credentials) === null || _isOpenMethod$paymeth4 === void 0 ? void 0 : _isOpenMethod$paymeth4.publishable,
248
+ publicKey: isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth4 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth4 === void 0 ? void 0 : (_isOpenMethod$paymeth5 = _isOpenMethod$paymeth4.credentials) === null || _isOpenMethod$paymeth5 === void 0 ? void 0 : _isOpenMethod$paymeth5.publishable,
249
249
  onPaymentChange: onPaymentChange,
250
- payType: isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth5 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth5 === void 0 ? void 0 : _isOpenMethod$paymeth5.name,
250
+ payType: isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth6 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth6 === void 0 ? void 0 : _isOpenMethod$paymeth6.name,
251
251
  onSelectCard: handlePaymethodDataChange,
252
252
  onCancel: function onCancel() {
253
253
  return handlePaymethodClick(null);
@@ -261,15 +261,15 @@ var PaymentOptionsUI = function PaymentOptionsUI(props) {
261
261
  alt: paymethodData === null || paymethodData === void 0 ? void 0 : (_paymethodData$card2 = paymethodData.card) === null || _paymethodData$card2 === void 0 ? void 0 : _paymethodData$card2.brand
262
262
  })), /*#__PURE__*/_react.default.createElement("span", null, "XXXX-XXXX-XXXX-", paymethodData === null || paymethodData === void 0 ? void 0 : (_paymethodData$card3 = paymethodData.card) === null || _paymethodData$card3 === void 0 ? void 0 : _paymethodData$card3.last4))), /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
263
263
  className: "modal-info",
264
- open: (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth6 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth6 === void 0 ? void 0 : _isOpenMethod$paymeth6.gateway) === 'paypal' && !paymethodData.id,
264
+ open: (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth7 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth7 === void 0 ? void 0 : _isOpenMethod$paymeth7.gateway) === 'paypal' && !paymethodData.id,
265
265
  onClose: function onClose() {
266
266
  return handlePaymethodClick(null);
267
267
  },
268
268
  title: t('PAY_WITH_PAYPAL', 'Pay with PayPal')
269
- }, (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth7 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth7 === void 0 ? void 0 : _isOpenMethod$paymeth7.gateway) === 'paypal' && /*#__PURE__*/_react.default.createElement(_PaymentOptionPaypal.PaymentOptionPaypal, {
270
- clientId: isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth8 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth8 === void 0 ? void 0 : (_isOpenMethod$paymeth9 = _isOpenMethod$paymeth8.credentials) === null || _isOpenMethod$paymeth9 === void 0 ? void 0 : _isOpenMethod$paymeth9.client_id,
269
+ }, (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth8 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth8 === void 0 ? void 0 : _isOpenMethod$paymeth8.gateway) === 'paypal' && /*#__PURE__*/_react.default.createElement(_PaymentOptionPaypal.PaymentOptionPaypal, {
270
+ clientId: isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth9 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth9 === void 0 ? void 0 : (_isOpenMethod$paymeth10 = _isOpenMethod$paymeth9.credentials) === null || _isOpenMethod$paymeth10 === void 0 ? void 0 : _isOpenMethod$paymeth10.client_id,
271
271
  body: {
272
- paymethod_id: isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth10 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth10 === void 0 ? void 0 : _isOpenMethod$paymeth10.id,
272
+ paymethod_id: isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth11 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth11 === void 0 ? void 0 : _isOpenMethod$paymeth11.id,
273
273
  amount: (_cart$balance2 = cart === null || cart === void 0 ? void 0 : cart.balance) !== null && _cart$balance2 !== void 0 ? _cart$balance2 : cart.total,
274
274
  delivery_zone_id: cart.delivery_zone_id,
275
275
  cartUuid: cart.uuid
@@ -281,16 +281,16 @@ var PaymentOptionsUI = function PaymentOptionsUI(props) {
281
281
  }
282
282
  })), /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
283
283
  title: t('SELECT_A_CARD', 'Select a card'),
284
- open: (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth11 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth11 === void 0 ? void 0 : _isOpenMethod$paymeth11.gateway) === 'stripe_connect' && !paymethodData.id,
284
+ open: (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth12 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth12 === void 0 ? void 0 : _isOpenMethod$paymeth12.gateway) === 'stripe_connect' && !paymethodData.id,
285
285
  className: "modal-info",
286
286
  onClose: function onClose() {
287
287
  return handlePaymethodClick(null);
288
288
  }
289
- }, (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth12 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth12 === void 0 ? void 0 : _isOpenMethod$paymeth12.gateway) === 'stripe_connect' && /*#__PURE__*/_react.default.createElement(_PaymentOptionStripe.PaymentOptionStripe, {
289
+ }, (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth13 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth13 === void 0 ? void 0 : _isOpenMethod$paymeth13.gateway) === 'stripe_connect' && /*#__PURE__*/_react.default.createElement(_PaymentOptionStripe.PaymentOptionStripe, {
290
290
  paymethod: isOpenMethod === null || isOpenMethod === void 0 ? void 0 : isOpenMethod.paymethod,
291
291
  businessId: props.businessId,
292
- publicKey: isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth13 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth13 === void 0 ? void 0 : (_isOpenMethod$paymeth14 = _isOpenMethod$paymeth13.credentials) === null || _isOpenMethod$paymeth14 === void 0 ? void 0 : (_isOpenMethod$paymeth15 = _isOpenMethod$paymeth14.stripe) === null || _isOpenMethod$paymeth15 === void 0 ? void 0 : _isOpenMethod$paymeth15.publishable,
293
- clientSecret: isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth16 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth16 === void 0 ? void 0 : (_isOpenMethod$paymeth17 = _isOpenMethod$paymeth16.credentials) === null || _isOpenMethod$paymeth17 === void 0 ? void 0 : _isOpenMethod$paymeth17.publishable,
292
+ publicKey: isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth14 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth14 === void 0 ? void 0 : (_isOpenMethod$paymeth15 = _isOpenMethod$paymeth14.credentials) === null || _isOpenMethod$paymeth15 === void 0 ? void 0 : (_isOpenMethod$paymeth16 = _isOpenMethod$paymeth15.stripe) === null || _isOpenMethod$paymeth16 === void 0 ? void 0 : _isOpenMethod$paymeth16.publishable,
293
+ clientSecret: isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth17 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth17 === void 0 ? void 0 : (_isOpenMethod$paymeth18 = _isOpenMethod$paymeth17.credentials) === null || _isOpenMethod$paymeth18 === void 0 ? void 0 : _isOpenMethod$paymeth18.publishable,
294
294
  payType: paymethodsList === null || paymethodsList === void 0 ? void 0 : paymethodsList.name,
295
295
  onSelectCard: handlePaymethodDataChange,
296
296
  onCancel: function onCancel() {
@@ -298,17 +298,17 @@ var PaymentOptionsUI = function PaymentOptionsUI(props) {
298
298
  }
299
299
  })), /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
300
300
  title: t('ADD_CARD', 'Add card'),
301
- open: (stripeDirectMethods === null || stripeDirectMethods === void 0 ? void 0 : stripeDirectMethods.includes(isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth18 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth18 === void 0 ? void 0 : _isOpenMethod$paymeth18.gateway)) && !paymethodData.id,
301
+ open: (stripeDirectMethods === null || stripeDirectMethods === void 0 ? void 0 : stripeDirectMethods.includes(isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth19 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth19 === void 0 ? void 0 : _isOpenMethod$paymeth19.gateway)) && !paymethodData.id,
302
302
  className: "modal-info",
303
303
  onClose: function onClose() {
304
304
  return handlePaymethodClick(null);
305
305
  }
306
- }, !(isOpenMethod !== null && isOpenMethod !== void 0 && (_isOpenMethod$paymeth19 = isOpenMethod.paymethod) !== null && _isOpenMethod$paymeth19 !== void 0 && (_isOpenMethod$paymeth20 = _isOpenMethod$paymeth19.credentials) !== null && _isOpenMethod$paymeth20 !== void 0 && _isOpenMethod$paymeth20.publishable) && /*#__PURE__*/_react.default.createElement(_styles.Container, null, /*#__PURE__*/_react.default.createElement("p", null, t('ADD_PUBLISHABLE_KEY', 'Please add a stripe key'))), (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth21 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth21 === void 0 ? void 0 : (_isOpenMethod$paymeth22 = _isOpenMethod$paymeth21.credentials) === null || _isOpenMethod$paymeth22 === void 0 ? void 0 : _isOpenMethod$paymeth22.publishable) && (stripeDirectMethods === null || stripeDirectMethods === void 0 ? void 0 : stripeDirectMethods.includes(isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth23 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth23 === void 0 ? void 0 : _isOpenMethod$paymeth23.gateway)) && /*#__PURE__*/_react.default.createElement(_StripeElementsForm.StripeElementsForm, {
306
+ }, !(isOpenMethod !== null && isOpenMethod !== void 0 && (_isOpenMethod$paymeth20 = isOpenMethod.paymethod) !== null && _isOpenMethod$paymeth20 !== void 0 && (_isOpenMethod$paymeth21 = _isOpenMethod$paymeth20.credentials) !== null && _isOpenMethod$paymeth21 !== void 0 && _isOpenMethod$paymeth21.publishable) && /*#__PURE__*/_react.default.createElement(_styles.Container, null, /*#__PURE__*/_react.default.createElement("p", null, t('ADD_PUBLISHABLE_KEY', 'Please add a publishable key'))), (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth22 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth22 === void 0 ? void 0 : (_isOpenMethod$paymeth23 = _isOpenMethod$paymeth22.credentials) === null || _isOpenMethod$paymeth23 === void 0 ? void 0 : _isOpenMethod$paymeth23.publishable) && (stripeDirectMethods === null || stripeDirectMethods === void 0 ? void 0 : stripeDirectMethods.includes(isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth24 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth24 === void 0 ? void 0 : _isOpenMethod$paymeth24.gateway)) && /*#__PURE__*/_react.default.createElement(_StripeElementsForm.StripeElementsForm, {
307
307
  methodsPay: methodsPay,
308
- paymethod: isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth24 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth24 === void 0 ? void 0 : _isOpenMethod$paymeth24.gateway,
308
+ paymethod: isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth25 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth25 === void 0 ? void 0 : _isOpenMethod$paymeth25.gateway,
309
309
  businessId: props.businessId,
310
310
  cart: cart,
311
- publicKey: (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth25 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth25 === void 0 ? void 0 : (_isOpenMethod$paymeth26 = _isOpenMethod$paymeth25.credentials) === null || _isOpenMethod$paymeth26 === void 0 ? void 0 : _isOpenMethod$paymeth26.publishable) || (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth27 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth27 === void 0 ? void 0 : (_isOpenMethod$paymeth28 = _isOpenMethod$paymeth27.credentials) === null || _isOpenMethod$paymeth28 === void 0 ? void 0 : _isOpenMethod$paymeth28.publishable_key),
311
+ publicKey: (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth26 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth26 === void 0 ? void 0 : (_isOpenMethod$paymeth27 = _isOpenMethod$paymeth26.credentials) === null || _isOpenMethod$paymeth27 === void 0 ? void 0 : _isOpenMethod$paymeth27.publishable) || (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth28 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth28 === void 0 ? void 0 : (_isOpenMethod$paymeth29 = _isOpenMethod$paymeth28.credentials) === null || _isOpenMethod$paymeth29 === void 0 ? void 0 : _isOpenMethod$paymeth29.publishable_key),
312
312
  handleSource: handlePaymethodDataChange,
313
313
  onCancel: function onCancel() {
314
314
  return handlePaymethodClick(null);
@@ -316,7 +316,7 @@ var PaymentOptionsUI = function PaymentOptionsUI(props) {
316
316
  handlePlaceOrder: handlePlaceOrder
317
317
  })), /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
318
318
  title: t('STRIPE_REDIRECT', 'Stripe Redirect'),
319
- open: (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth29 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth29 === void 0 ? void 0 : _isOpenMethod$paymeth29.gateway) === 'stripe_redirect' && !paymethodData.type,
319
+ open: (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth30 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth30 === void 0 ? void 0 : _isOpenMethod$paymeth30.gateway) === 'stripe_redirect' && !paymethodData.type,
320
320
  className: "modal-info",
321
321
  onClose: function onClose() {
322
322
  return handlePaymethodClick(null);
@@ -328,16 +328,16 @@ var PaymentOptionsUI = function PaymentOptionsUI(props) {
328
328
  handleStripeRedirect: handlePaymethodDataChange
329
329
  })), /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
330
330
  title: t('SQUARE', 'Square'),
331
- open: (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth30 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth30 === void 0 ? void 0 : _isOpenMethod$paymeth30.gateway) === 'square' && !paymethodData.token,
331
+ open: (isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth31 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth31 === void 0 ? void 0 : _isOpenMethod$paymeth31.gateway) === 'square' && !paymethodData.token,
332
332
  onClose: function onClose() {
333
333
  return handlePaymethodClick(null);
334
334
  }
335
335
  }, /*#__PURE__*/_react.default.createElement(_PaymentOptionSquare.PaymentOptionSquare, {
336
336
  businessId: props.businessId,
337
337
  cartTotal: cart === null || cart === void 0 ? void 0 : cart.total,
338
- data: isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth31 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth31 === void 0 ? void 0 : _isOpenMethod$paymeth31.credentials,
338
+ data: isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth32 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth32 === void 0 ? void 0 : _isOpenMethod$paymeth32.credentials,
339
339
  body: {
340
- paymethod_id: isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth32 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth32 === void 0 ? void 0 : _isOpenMethod$paymeth32.id,
340
+ paymethod_id: isOpenMethod === null || isOpenMethod === void 0 ? void 0 : (_isOpenMethod$paymeth33 = isOpenMethod.paymethod) === null || _isOpenMethod$paymeth33 === void 0 ? void 0 : _isOpenMethod$paymeth33.id,
341
341
  amount: cart.total,
342
342
  delivery_zone_id: cart.delivery_zone_id,
343
343
  cartUuid: cart.uuid
@@ -21,12 +21,13 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
21
21
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
22
22
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
23
23
  var QueryLoginSpoonityUI = function QueryLoginSpoonityUI(props) {
24
+ var userState = props.userState;
24
25
  var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
25
26
  _useLanguage2 = _slicedToArray(_useLanguage, 2),
26
27
  t = _useLanguage2[1];
27
- return /*#__PURE__*/_react.default.createElement(_SpinnerLoader.SpinnerLoader, {
28
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, userState !== null && userState !== void 0 && userState.loading ? /*#__PURE__*/_react.default.createElement(_SpinnerLoader.SpinnerLoader, {
28
29
  content: t('LOADING_DELICIOUS_FOOD', 'Loading Ordering Dashboard...')
29
- });
30
+ }) : null);
30
31
  };
31
32
  var QueryLoginSpoonity = function QueryLoginSpoonity(props) {
32
33
  var queryProps = _objectSpread(_objectSpread({}, props), {}, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "2.3.8",
3
+ "version": "2.4.1",
4
4
  "description": "Ordering UI Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -86,7 +86,7 @@
86
86
  "libphonenumber-js": "^1.9.4",
87
87
  "lodash": "^4.17.19",
88
88
  "moment": "^2.29.4",
89
- "ordering-components-external": "2.2.4",
89
+ "ordering-components-external": "2.5.1",
90
90
  "polished": "^3.6.6",
91
91
  "react-bootstrap-icons": "^1.7.2",
92
92
  "react-calendar": "^3.3.1",
@@ -233,7 +233,7 @@ const BusinessProductsListingUI = (props) => {
233
233
  }
234
234
  setModalIsOpen(true)
235
235
  }
236
- }, [productModal])
236
+ }, [productModal, categoryId, productId, isInitialRender])
237
237
 
238
238
  useEffect(() => {
239
239
  window.scrollTo(0, 0)
@@ -253,6 +253,12 @@ const BusinessProductsListingUI = (props) => {
253
253
  }
254
254
  }, [])
255
255
 
256
+ useEffect(() => {
257
+ if (!categoryId && !productId) {
258
+ setModalIsOpen(false)
259
+ }
260
+ }, [categoryId, productId])
261
+
256
262
  useEffect(() => {
257
263
  if (loading) return
258
264
  if (openProduct) {
@@ -130,7 +130,17 @@ const CartUI = (props) => {
130
130
  }
131
131
  }
132
132
 
133
- const loyaltyRewardValue = Math.round(cart?.subtotal / loyaltyRewardRate)
133
+ const getIncludedTaxes = () => {
134
+ if (cart?.taxes === null) {
135
+ return cart?.business.tax_type === 1 ? cart?.tax : 0
136
+ } else {
137
+ return cart?.taxes.reduce((taxIncluded, tax) => {
138
+ return taxIncluded + (tax.type === 1 ? tax.summary?.tax : 0)
139
+ }, 0)
140
+ }
141
+ }
142
+
143
+ const loyaltyRewardValue = Math.round((cart?.subtotal + getIncludedTaxes()) / loyaltyRewardRate)
134
144
 
135
145
  const momentFormatted = !orderState?.option?.moment
136
146
  ? t('RIGHT_NOW', 'Right Now')
@@ -228,16 +238,6 @@ const CartUI = (props) => {
228
238
  handleClickCheckout(uuid)
229
239
  }
230
240
 
231
- const getIncludedTaxes = () => {
232
- if (cart?.taxes === null) {
233
- return cart?.business.tax_type === 1 ? cart?.tax : 0
234
- } else {
235
- return cart?.taxes.reduce((taxIncluded, tax) => {
236
- return taxIncluded + (tax.type === 1 ? tax.summary?.tax : 0)
237
- }, 0)
238
- }
239
- }
240
-
241
241
  const getIncludedTaxesDiscounts = () => {
242
242
  return cart?.taxes?.filter(tax => tax?.type === 1)?.reduce((carry, tax) => carry + (tax?.summary?.tax_after_discount ?? tax?.summary?.tax), 0)
243
243
  }
@@ -423,10 +423,10 @@ const CartUI = (props) => {
423
423
  </tr>
424
424
  ))
425
425
  }
426
- {orderState?.options?.type === 1 && cart?.delivery_price > 0 && !hideDeliveryFee && (
426
+ {orderState?.options?.type === 1 && cart?.delivery_price_with_discount > 0 && !hideDeliveryFee && (
427
427
  <tr>
428
428
  <td>{t('DELIVERY_FEE', 'Delivery Fee')}</td>
429
- <td>{parsePrice(cart?.delivery_price)}</td>
429
+ <td>{parsePrice(cart?.delivery_price_with_discount)}</td>
430
430
  </tr>
431
431
  )}
432
432
  {
@@ -450,12 +450,6 @@ const CartUI = (props) => {
450
450
  </tr>
451
451
  ))
452
452
  }
453
- {orderState?.options?.type === 1 && cart?.delivery_price > 0 && cart?.delivery_price_with_discount >= 0 && !hideDeliveryFee && isChewLayout && (
454
- <tr>
455
- <td>{t('DELIVERY_FEE_AFTER_DISCOUNT', 'Delivery Fee After Discount')}</td>
456
- <td>{parsePrice(cart?.delivery_price_with_discount)}</td>
457
- </tr>
458
- )}
459
453
  {cart?.driver_tip > 0 && !hideDriverTip && (
460
454
  <tr>
461
455
  <td>
@@ -96,6 +96,8 @@ const MessagesUI = (props) => {
96
96
  const buttonRef = useRef(null)
97
97
  const [modalImage, setModalImage] = useState({ open: false, src: '' })
98
98
  const imageRef = useRef(null)
99
+ const previousStatus = [1, 2, 5, 6, 10, 11, 12, 16, 17]
100
+ const chatDisabled = previousStatus.includes(order?.status)
99
101
 
100
102
  const quickMessageList = [
101
103
  { key: 'message_1', text: t('CUSTOMER_MESSAGE_1', 'Lorem ipsum 1') },
@@ -302,7 +304,7 @@ const MessagesUI = (props) => {
302
304
  }
303
305
 
304
306
  const goToBusiness = (slug) => {
305
- events.emit('go_to_page', { page: 'business', params: { business_slug: slug} })
307
+ events.emit('go_to_page', { page: 'business', params: { business_slug: slug } })
306
308
  }
307
309
 
308
310
  const MapMessages = ({ messages }) => {
@@ -660,14 +662,7 @@ const MessagesUI = (props) => {
660
662
  )
661
663
  }
662
664
  </Chat>
663
- {(parseInt(order?.status) === 1 ||
664
- parseInt(order?.status) === 2 ||
665
- parseInt(order?.status) === 5 ||
666
- parseInt(order?.status) === 6 ||
667
- parseInt(order?.status) === 10 ||
668
- parseInt(order?.status) === 11 ||
669
- parseInt(order?.status) === 12
670
- ) && driver
665
+ {chatDisabled
671
666
  ? (
672
667
  <NotSendMessage>
673
668
  <MdcCloseOctagonOutline />
@@ -5,8 +5,8 @@ import {
5
5
  useUtils,
6
6
  MultiCartsPaymethodsAndWallets as MultiCartsPaymethodsAndWalletsController
7
7
  } from 'ordering-components-external'
8
+ import { useTheme } from 'styled-components'
8
9
  import Skeleton from 'react-loading-skeleton'
9
- import BilStripe from '@meronex/icons/bi/BilStripe'
10
10
  import FaCcStripe from '@meronex/icons/fa/FaCcStripe'
11
11
  import FaStripeS from '@meronex/icons/fa/FaStripeS'
12
12
  import GrStripe from '@meronex/icons/gr/GrStripe'
@@ -24,7 +24,9 @@ import {
24
24
  WalletPaymentOptionContainer,
25
25
  WalletOptionContainer,
26
26
  PayCardSelected,
27
- CardItemContent
27
+ CardItemContent,
28
+ SectionLeft,
29
+ SectionLeftText
28
30
  } from './styles'
29
31
 
30
32
  const stripeOptions = ['stripe_direct', 'stripe', 'stripe_connect']
@@ -61,15 +63,19 @@ const CreditCard2 = () => {
61
63
  const MultiCartsPaymethodsAndWalletsUI = (props) => {
62
64
  const {
63
65
  businessIds,
66
+ balance,
64
67
  paymethodsAndWallets,
65
68
  walletsState,
66
69
  paymethodSelected,
67
70
  handleSelectPaymethod,
68
71
  handleSelectWallet,
69
72
  handlePaymethodDataChange,
73
+ setCardList,
74
+ walletsPaymethod,
70
75
  isCustomerMode
71
76
  } = props
72
77
 
78
+ const theme = useTheme()
73
79
  const [, t] = useLanguage()
74
80
  const [{ configs }] = useConfig()
75
81
  const [{ parsePrice }] = useUtils()
@@ -152,30 +158,60 @@ const MultiCartsPaymethodsAndWalletsUI = (props) => {
152
158
  </>
153
159
  ) : (
154
160
  <>
155
- {walletsState?.result?.filter(wallet => paymethodsAndWallets.wallets.find(item => item.type === wallet.type)).map((wallet, idx) => walletName[wallet.type]?.isActive && (
161
+ {walletsState?.result?.filter(wallet =>
162
+ paymethodsAndWallets.wallets.find(item => item.type === wallet.type))
163
+ .map((wallet, idx) => walletName[wallet.type]?.isActive &&
164
+ (
156
165
  <WalletOptionContainer
157
166
  key={wallet.type}
158
167
  isBottomBorder={idx === paymethodsAndWallets.wallets?.length - 1}
159
168
  >
160
- <Checkbox
161
- name={`payment_option_${wallet.type}`}
162
- id={`custom-checkbox-${idx}`}
163
- disabled={wallet.balance === 0}
164
- value={`payment_option_${wallet.type}`}
165
- onChange={e => handleSelectWallet(e.target.checked, wallet)}
166
- />
167
- <label
168
- htmlFor={`custom-checkbox-${idx}`}
169
- >
170
- {walletName[wallet.type]?.name}
171
- </label>
172
- <span>{parsePrice(wallet.balance)}</span>
169
+ <SectionLeft>
170
+ <Checkbox
171
+ name={`payment_option_${wallet.type}`}
172
+ id={`custom-checkbox-${idx}`}
173
+ disabled={
174
+ (balance === 0 && !walletsPaymethod?.find(walletPay => walletPay.wallet_id === wallet.id)?.id) ||
175
+ wallet.balance === 0
176
+ }
177
+ value={`payment_option_${wallet.type}`}
178
+ checked={!!walletsPaymethod?.find(walletPay => walletPay.wallet_id === wallet.id)?.id}
179
+ onChange={() => handleSelectWallet(
180
+ !walletsPaymethod?.find(walletPay => walletPay.wallet_id === wallet.id)?.id,
181
+ wallet
182
+ )}
183
+ />
184
+ <SectionLeftText>
185
+ <label
186
+ style={{
187
+ color: (balance === 0 && !walletsPaymethod?.find(walletPay => walletPay.wallet_id === wallet.id)?.id) ||
188
+ wallet.balance === 0 ? theme.colors.darkGray : 'black'
189
+ }}
190
+ htmlFor={`custom-checkbox-${idx}`}
191
+ >
192
+ {walletName[wallet.type]?.name}
193
+ </label>
194
+ </SectionLeftText>
195
+ </SectionLeft>
196
+ <div>
197
+ {wallet.type === 'cash' && (
198
+ <span>{parsePrice(wallet?.balance, { isTruncable: true })}</span>
199
+ )}
200
+ {wallet.type === 'credit_point' && (
201
+ <span>
202
+ <span style={{ color: theme.colors.primary }}>
203
+ {`${wallet?.balance} ${t('POINTS', 'Points')}`}
204
+ </span> {wallet?.balance > 0 && `= ${parsePrice(wallet?.balance / wallet?.redemption_rate, { isTruncable: true })}`}
205
+ </span>
206
+ )}
207
+ </div>
173
208
  </WalletOptionContainer>
174
209
  ))}
175
210
  </>
176
211
  )}
177
212
  </WalletPaymentOptionContainer>
178
213
  )}
214
+
179
215
  </Container>
180
216
  )
181
217
  }
@@ -83,6 +83,7 @@ export const WalletPaymentOptionContainer = styled.div`
83
83
  `
84
84
  export const WalletOptionContainer = styled.div`
85
85
  display: flex;
86
+ justify-content: space-between;
86
87
  align-items: center;
87
88
  border-top: 1px solid ${(props) => props.theme.colors.gray200};
88
89
  ${(props) => props.isBottomBorder && css`
@@ -95,6 +96,17 @@ export const WalletOptionContainer = styled.div`
95
96
  margin: 0 10px;
96
97
  }
97
98
  `
99
+ export const SectionLeft = styled.div`
100
+ display: flex;
101
+ flex-direction: row;
102
+ align-items: center;
103
+ `
104
+
105
+ export const SectionLeftText = styled.div`
106
+ display: flex;
107
+ flex-direction: column;
108
+ margin-left: 10px;
109
+ `
98
110
  export const PayCardSelected = styled.div`
99
111
  padding: 30px 0px 0px;
100
112
  `
@@ -8,7 +8,9 @@ import {
8
8
  useConfig,
9
9
  useSession,
10
10
  useValidationFields,
11
- useOrder
11
+ useOrder,
12
+ useToast,
13
+ ToastType
12
14
  } from 'ordering-components-external'
13
15
 
14
16
  import parsePhoneNumber from 'libphonenumber-js'
@@ -65,6 +67,7 @@ const MultiCheckoutUI = (props) => {
65
67
  cartGroup,
66
68
  cartUuid,
67
69
  totalCartsFee,
70
+ walletState,
68
71
  handleSearchRedirect
69
72
  } = props
70
73
 
@@ -76,12 +79,20 @@ const MultiCheckoutUI = (props) => {
76
79
  const [{ user }] = useSession()
77
80
  const [orderState] = useOrder()
78
81
  const history = useHistory()
82
+ const [, { showToast }] = useToast()
79
83
 
84
+ const [cardList, setCardList] = useState([])
80
85
  const [userErrors, setUserErrors] = useState([])
81
86
  const [isUserDetailsEdit, setIsUserDetailsEdit] = useState(null)
82
87
  const [alertState, setAlertState] = useState({ open: false, content: [] })
83
- const isDisablePlaceOrderButton = !(paymethodSelected?.paymethod_id || paymethodSelected?.wallet_id) || (paymethodSelected?.paymethod?.gateway === 'stripe' && !paymethodSelected?.paymethod_data)
88
+
84
89
  const walletCarts = (Object.values(orderState?.carts)?.filter(cart => cart?.products && cart?.products?.length && cart?.status !== 2 && cart?.valid_schedule && cart?.valid_products && cart?.valid_address && cart?.valid_maximum && cart?.valid_minimum && cart?.wallets) || null) || []
90
+ const isDisablePlaceOrderButton = cartGroup?.loading ||
91
+ (!(paymethodSelected?.paymethod_id || paymethodSelected?.wallet_id) && cartGroup?.result?.balance > 0) ||
92
+ (paymethodSelected?.paymethod?.gateway === 'stripe' && !paymethodSelected?.paymethod_data) ||
93
+ (paymethodSelected?.gateway === 'stripe' && cardList?.cards?.length === 0) ||
94
+ walletCarts.length > 0
95
+
85
96
  const isMultiDriverTips = configs?.checkout_multi_business_enabled?.value === '1'
86
97
  const driverTipsOptions = typeof configs?.driver_tip_options?.value === 'string'
87
98
  ? JSON.parse(configs?.driver_tip_options?.value) || []
@@ -95,8 +106,21 @@ const MultiCheckoutUI = (props) => {
95
106
  const loyalBusinessIds = creditPointPlan?.businesses?.filter((b) => b.accumulates).map((item) => item.business_id) ?? []
96
107
  const creditPointPlanOnBusiness = businessIds.every((bid) => loyalBusinessIds.includes(bid)) && creditPointPlan
97
108
 
109
+ const getIncludedTaxes = (cart) => {
110
+ if (cart?.taxes === null || !cart?.taxes) {
111
+ return cart.business.tax_type === 1 ? cart?.tax : 0
112
+ } else {
113
+ return cart?.taxes.reduce((taxIncluded, tax) => {
114
+ return taxIncluded + (tax.type === 1 ? tax.summary?.tax : 0)
115
+ }, 0)
116
+ }
117
+ }
118
+
98
119
  const loyaltyRewardValue = creditPointPlanOnBusiness?.accumulation_rate
99
- ? Math.round(openCarts.reduce((sum, cart) => sum + cart?.subtotal, 0) / creditPointPlanOnBusiness?.accumulation_rate) : 0
120
+ ? Math.round(
121
+ openCarts.reduce((sum, cart) => sum + cart?.subtotal + getIncludedTaxes(cart), 0) /
122
+ creditPointPlanOnBusiness?.accumulation_rate
123
+ ) : 0
100
124
 
101
125
  const handlePlaceOrder = () => {
102
126
  if (!userErrors.length) {
@@ -179,6 +203,12 @@ const MultiCheckoutUI = (props) => {
179
203
  onRedirectPage && onRedirectPage({ page: 'search' })
180
204
  }, [openCarts, cartGroup])
181
205
 
206
+ useEffect(() => {
207
+ if (walletState.error) {
208
+ showToast(ToastType.Error, t(walletState.error, walletState.error?.[0]?.replace(/_/g, ' ')))
209
+ }
210
+ }, [walletState.error])
211
+
182
212
  return (
183
213
  <>
184
214
  {((!cartGroup?.loading && openCarts.length === 0) || !cartUuid) ? (
@@ -222,12 +252,15 @@ const MultiCheckoutUI = (props) => {
222
252
  <MultiCartsPaymethodsAndWallets
223
253
  userId={props.userId}
224
254
  openCarts={openCarts}
255
+ balance={cartGroup?.result?.balance}
256
+ walletsPaymethod={cartGroup?.result?.wallets}
225
257
  paymethodSelected={paymethodSelected}
226
258
  handleSelectPaymethod={handleSelectPaymethod}
227
259
  handleSelectWallet={handleSelectWallet}
228
260
  handlePaymethodDataChange={handlePaymethodDataChange}
229
261
  cartUuid={cartUuid}
230
262
  isCustomerMode={isCustomerMode}
263
+ setCardList={setCardList}
231
264
  />
232
265
  </PaymentMethodContainer>
233
266
 
@@ -290,6 +323,7 @@ const MultiCheckoutUI = (props) => {
290
323
  isProducts={cart?.products?.length || 0}
291
324
  hideDeliveryFee={configs?.multi_business_checkout_show_combined_delivery_fee?.value === '1'}
292
325
  hideDriverTip={configs?.multi_business_checkout_show_combined_driver_tip?.value === '1'}
326
+ businessConfigs={cart?.business?.configs}
293
327
  />
294
328
  <DriverTipDivider />
295
329
  </React.Fragment>
@@ -7,6 +7,7 @@ export const Container = styled.div`
7
7
  width: 100%;
8
8
  box-sizing: border-box;
9
9
  position: relative;
10
+ min-height: calc(100vh - 320px);
10
11
 
11
12
  > h1 {
12
13
  font-weight: 600;
@@ -21,9 +22,6 @@ export const Container = styled.div`
21
22
  ${({ hideOrders }) => !hideOrders ? css`
22
23
  padding: 40px;
23
24
  width: 100%;
24
- @media (min-width: 993px) {
25
- min-height: calc(100vh - 382px);
26
- }
27
25
  ` : css`
28
26
  padding: 0;
29
27
  width: 100%;
@@ -78,7 +76,7 @@ export const NoOrdersWrapper = styled.div`
78
76
  padding: 50px 0px;
79
77
  position: absolute;
80
78
  box-sizing: border-box;
81
- height: calc(100% - 120px);
79
+ min-height: calc(100% - 120px);
82
80
  width: 100%;
83
81
 
84
82
  > p {
@@ -8,7 +8,7 @@ export const OrderEta = (props) => {
8
8
  outputFormat
9
9
  } = props
10
10
 
11
- const [{ parseDate }] = useUtils()
11
+ const [{ parseTime }] = useUtils()
12
12
  const [estimatedDeliveryTime, setEstimatedDeliveryTime] = useState(null)
13
13
 
14
14
  const getEstimatedDeliveryTime = () => {
@@ -36,9 +36,9 @@ export const OrderEta = (props) => {
36
36
  if (diffTimeAsMinutes <= 0) {
37
37
  totalEta += (Math.floor(Math.abs(diffTimeAsMinutes / order?.eta_current_status_time) + 1) * order?.eta_current_status_penalty_time)
38
38
  }
39
- _estimatedTime = parseDate(moment(_delivery).add(totalEta, 'minutes'))
39
+ _estimatedTime = moment(_delivery).add(totalEta, 'minutes')
40
40
  } else {
41
- _estimatedTime = parseDate(moment(_delivery).add(order?.eta_time, 'minutes'))
41
+ _estimatedTime = moment(_delivery).add(order?.eta_time, 'minutes')
42
42
  }
43
43
  setEstimatedDeliveryTime(_estimatedTime)
44
44
  }
@@ -53,7 +53,7 @@ export const OrderEta = (props) => {
53
53
 
54
54
  return (
55
55
  <>
56
- {!outputFormat ? estimatedDeliveryTime : moment(estimatedDeliveryTime).format(outputFormat)}
56
+ {!outputFormat ? parseTime(estimatedDeliveryTime) : parseTime(estimatedDeliveryTime, { outputFormat: 'hh:mm A' })}
57
57
  </>
58
58
  )
59
59
  }
@@ -96,9 +96,9 @@ const OrderProgressUI = (props) => {
96
96
  <span>{t('ESTIMATED_DELIVERY', 'Estimated delivery')}:&nbsp;</span>
97
97
  <span>
98
98
  {lastOrder?.delivery_datetime_utc
99
- ? parseTime(lastOrder?.delivery_datetime_utc, { outputFormat: 'hh:mm A' })
99
+ ? parseTime(lastOrder?.delivery_datetime_utc, { outputFormat: 'hh:mm A', utc: false })
100
100
  : parseTime(lastOrder?.delivery_datetime, { utc: false })}
101
- &nbsp;-&nbsp;
101
+ &nbsp;-&nbsp;
102
102
  <OrderEta order={lastOrder} outputFormat='hh:mm A' />
103
103
  </span>
104
104
  </TimeWrapper>