ordering-ui-external 2.4.5 → 2.5.0

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 (135) hide show
  1. package/_bundles/{0.ordering-ui.83ddb51fdc85c2b920b0.js → 0.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
  2. package/_bundles/{1.ordering-ui.83ddb51fdc85c2b920b0.js → 1.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
  3. package/_bundles/{2.ordering-ui.83ddb51fdc85c2b920b0.js → 2.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
  4. package/_bundles/{4.ordering-ui.83ddb51fdc85c2b920b0.js → 4.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
  5. package/_bundles/{5.ordering-ui.83ddb51fdc85c2b920b0.js → 5.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
  6. package/_bundles/{6.ordering-ui.83ddb51fdc85c2b920b0.js → 6.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
  7. package/_bundles/{7.ordering-ui.83ddb51fdc85c2b920b0.js → 7.ordering-ui.5657c6a53b3791887fd7.js} +2 -2
  8. package/_bundles/{8.ordering-ui.83ddb51fdc85c2b920b0.js → 8.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
  9. package/_bundles/{9.ordering-ui.83ddb51fdc85c2b920b0.js → 9.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
  10. package/_bundles/ordering-ui.5657c6a53b3791887fd7.js +2 -0
  11. package/_modules/components/OrdersOption/styles.js +1 -1
  12. package/_modules/components/VerticalOrdersLayout/SingleOrderCard/index.js +15 -8
  13. package/_modules/components/VerticalOrdersLayout/styles.js +2 -2
  14. package/_modules/contexts/ThemeContext/index.js +1 -0
  15. package/_modules/themes/five/src/components/AddressList/index.js +8 -7
  16. package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +28 -22
  17. package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +22 -21
  18. package/_modules/themes/five/src/components/BusinessController/index.js +5 -3
  19. package/_modules/themes/five/src/components/BusinessInformation/index.js +16 -10
  20. package/_modules/themes/five/src/components/BusinessItemAccordion/index.js +5 -8
  21. package/_modules/themes/five/src/components/BusinessListingSearch/index.js +93 -74
  22. package/_modules/themes/five/src/components/BusinessListingSearch/styles.js +10 -4
  23. package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +7 -2
  24. package/_modules/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
  25. package/_modules/themes/five/src/components/BusinessProductsList/index.js +1 -1
  26. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +38 -13
  27. package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +20 -9
  28. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +35 -23
  29. package/_modules/themes/five/src/components/Cart/index.js +7 -3
  30. package/_modules/themes/five/src/components/Checkout/index.js +12 -11
  31. package/_modules/themes/five/src/components/Checkout/styles.js +8 -4
  32. package/_modules/themes/five/src/components/GiftCard/GiftCardUI/index.js +1 -0
  33. package/_modules/themes/five/src/components/GiftCard/PurchaseGiftCard/index.js +4 -3
  34. package/_modules/themes/five/src/components/GiftCard/PurchaseGiftCard/styles.js +14 -8
  35. package/_modules/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +1 -1
  36. package/_modules/themes/five/src/components/Header/index.js +29 -21
  37. package/_modules/themes/five/src/components/Header/styles.js +44 -40
  38. package/_modules/themes/five/src/components/MultiCheckout/index.js +18 -16
  39. package/_modules/themes/five/src/components/MultiOrdersDetails/SingleOrderCard.js +6 -4
  40. package/_modules/themes/five/src/components/MyOrders/index.js +16 -10
  41. package/_modules/themes/five/src/components/MyOrders/styles.js +15 -12
  42. package/_modules/themes/five/src/components/OrderDetails/OrderEta.js +5 -2
  43. package/_modules/themes/five/src/components/OrderDetails/OrderHistory.js +2 -2
  44. package/_modules/themes/five/src/components/OrderDetails/index.js +2 -2
  45. package/_modules/themes/five/src/components/OrderItAgain/styles.js +1 -1
  46. package/_modules/themes/five/src/components/OrderProgress/index.js +15 -4
  47. package/_modules/themes/five/src/components/OrderTypeSelectorContent/index.js +16 -4
  48. package/_modules/themes/five/src/components/PageBanner/styles.js +1 -1
  49. package/_modules/themes/five/src/components/ProductForm/index.js +27 -7
  50. package/_modules/themes/five/src/components/ProductForm/styles.js +40 -31
  51. package/_modules/themes/five/src/components/ProductItemAccordion/index.js +6 -6
  52. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +3 -3
  53. package/_modules/themes/five/src/components/ReviewProduct/index.js +9 -4
  54. package/_modules/themes/five/src/components/ServiceForm/index.js +22 -3
  55. package/_modules/themes/five/src/components/ServiceForm/styles.js +9 -3
  56. package/_modules/themes/five/src/components/SidebarMenu/index.js +19 -10
  57. package/_modules/themes/five/src/components/SignUpForm/index.js +56 -29
  58. package/_modules/themes/five/src/components/SingleOrderCard/index.js +1 -1
  59. package/_modules/themes/five/src/components/SingleOrderCard/styles.js +26 -24
  60. package/_modules/themes/five/src/components/SingleProductCard/layouts/original/index.js +9 -5
  61. package/_modules/themes/five/src/components/SingleProductCard/layouts/original/styles.js +2 -2
  62. package/_modules/themes/five/src/components/UpsellingPage/index.js +2 -1
  63. package/_modules/themes/five/src/components/UserFormDetails/index.js +58 -18
  64. package/_modules/themes/five/src/components/UserFormDetails/styles.js +7 -3
  65. package/_modules/themes/five/src/components/UserPopover/index.js +41 -25
  66. package/_modules/themes/five/src/components/UserProfileForm/index.js +19 -11
  67. package/_modules/themes/five/src/styles/Buttons/index.js +68 -58
  68. package/_modules/themes/five/src/styles/Inputs/index.js +40 -16
  69. package/_modules/utils/index.js +8 -2
  70. package/index.html +1 -1
  71. package/package.json +3 -2
  72. package/src/components/OrdersOption/styles.js +1 -0
  73. package/src/components/VerticalOrdersLayout/SingleOrderCard/index.js +35 -17
  74. package/src/components/VerticalOrdersLayout/styles.js +9 -0
  75. package/src/contexts/ThemeContext/index.js +1 -0
  76. package/src/themes/five/src/components/AddressList/index.js +6 -6
  77. package/src/themes/five/src/components/BusinessBasicInformation/index.js +24 -22
  78. package/src/themes/five/src/components/BusinessBasicInformation/styles.js +24 -3
  79. package/src/themes/five/src/components/BusinessController/index.js +4 -2
  80. package/src/themes/five/src/components/BusinessInformation/index.js +24 -12
  81. package/src/themes/five/src/components/BusinessItemAccordion/index.js +5 -6
  82. package/src/themes/five/src/components/BusinessListingSearch/index.js +127 -101
  83. package/src/themes/five/src/components/BusinessListingSearch/styles.js +15 -0
  84. package/src/themes/five/src/components/BusinessProductsCategories/index.js +7 -2
  85. package/src/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
  86. package/src/themes/five/src/components/BusinessProductsList/index.js +1 -1
  87. package/src/themes/five/src/components/BusinessProductsListing/index.js +34 -9
  88. package/src/themes/five/src/components/BusinessProductsListing/styles.js +26 -0
  89. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +9 -2
  90. package/src/themes/five/src/components/Cart/index.js +3 -4
  91. package/src/themes/five/src/components/Checkout/index.js +18 -4
  92. package/src/themes/five/src/components/Checkout/styles.js +22 -0
  93. package/src/themes/five/src/components/GiftCard/GiftCardUI/index.js +1 -0
  94. package/src/themes/five/src/components/GiftCard/PurchaseGiftCard/index.js +41 -31
  95. package/src/themes/five/src/components/GiftCard/PurchaseGiftCard/styles.js +15 -4
  96. package/src/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +2 -2
  97. package/src/themes/five/src/components/Header/index.js +17 -5
  98. package/src/themes/five/src/components/Header/styles.js +9 -6
  99. package/src/themes/five/src/components/MultiCheckout/index.js +9 -10
  100. package/src/themes/five/src/components/MultiOrdersDetails/SingleOrderCard.js +8 -5
  101. package/src/themes/five/src/components/MyOrders/index.js +13 -9
  102. package/src/themes/five/src/components/MyOrders/styles.js +3 -1
  103. package/src/themes/five/src/components/OrderDetails/OrderEta.js +3 -2
  104. package/src/themes/five/src/components/OrderDetails/OrderHistory.js +8 -2
  105. package/src/themes/five/src/components/OrderDetails/index.js +2 -2
  106. package/src/themes/five/src/components/OrderItAgain/styles.js +1 -1
  107. package/src/themes/five/src/components/OrderProgress/index.js +16 -5
  108. package/src/themes/five/src/components/OrderTypeSelectorContent/index.js +7 -4
  109. package/src/themes/five/src/components/PageBanner/styles.js +1 -4
  110. package/src/themes/five/src/components/ProductForm/index.js +23 -5
  111. package/src/themes/five/src/components/ProductForm/styles.js +36 -1
  112. package/src/themes/five/src/components/ProductItemAccordion/index.js +37 -29
  113. package/src/themes/five/src/components/RenderProductsLayout/index.js +3 -3
  114. package/src/themes/five/src/components/ReviewProduct/index.js +14 -6
  115. package/src/themes/five/src/components/ServiceForm/index.js +22 -4
  116. package/src/themes/five/src/components/ServiceForm/styles.js +16 -0
  117. package/src/themes/five/src/components/SidebarMenu/index.js +162 -144
  118. package/src/themes/five/src/components/SignUpForm/index.js +4 -3
  119. package/src/themes/five/src/components/SingleOrderCard/index.js +1 -1
  120. package/src/themes/five/src/components/SingleOrderCard/styles.js +9 -1
  121. package/src/themes/five/src/components/SingleProductCard/layouts/original/index.js +13 -3
  122. package/src/themes/five/src/components/SingleProductCard/layouts/original/styles.js +2 -2
  123. package/src/themes/five/src/components/UpsellingPage/index.js +1 -1
  124. package/src/themes/five/src/components/UserFormDetails/index.js +58 -14
  125. package/src/themes/five/src/components/UserFormDetails/styles.js +16 -0
  126. package/src/themes/five/src/components/UserPopover/index.js +26 -15
  127. package/src/themes/five/src/components/UserProfileForm/index.js +18 -9
  128. package/src/themes/five/src/styles/Buttons/index.js +11 -0
  129. package/src/themes/five/src/styles/Inputs/index.js +34 -0
  130. package/src/utils/index.js +5 -0
  131. package/template/app.js +5 -3
  132. package/template/theme.json +335 -24
  133. package/_bundles/ordering-ui.83ddb51fdc85c2b920b0.js +0 -2
  134. /package/_bundles/{7.ordering-ui.83ddb51fdc85c2b920b0.js.LICENSE.txt → 7.ordering-ui.5657c6a53b3791887fd7.js.LICENSE.txt} +0 -0
  135. /package/_bundles/{ordering-ui.83ddb51fdc85c2b920b0.js.LICENSE.txt → ordering-ui.5657c6a53b3791887fd7.js.LICENSE.txt} +0 -0
@@ -1,5 +1,6 @@
1
1
  import React, { useState, useEffect, useRef } from 'react'
2
2
  import Skeleton from 'react-loading-skeleton'
3
+ import { nanoid } from 'nanoid'
3
4
  import FiMinusCircle from '@meronex/icons/fi/FiMinusCircle'
4
5
  import FiPlusCircle from '@meronex/icons/fi/FiPlusCircle'
5
6
  import MdcPlayCircleOutline from '@meronex/icons/mdc/MdcPlayCircleOutline'
@@ -17,7 +18,7 @@ import {
17
18
  useConfig
18
19
  } from 'ordering-components-external'
19
20
 
20
- import { scrollTo } from '../../../../../utils'
21
+ import { scrollTo, orderTypeList } from '../../../../../utils'
21
22
  import { useWindowSize } from '../../../../../hooks/useWindowSize'
22
23
 
23
24
  import { ProductIngredient } from '../ProductIngredient'
@@ -62,7 +63,8 @@ import {
62
63
  ProductTagsListContainer,
63
64
  ProductTagWrapper,
64
65
  VideoGalleryWrapper,
65
- TitleWrapper
66
+ TitleWrapper,
67
+ GuestUserLink
66
68
  } from './styles'
67
69
  import { useTheme } from 'styled-components'
68
70
  import { Input, TextArea } from '../../styles/Inputs'
@@ -95,7 +97,9 @@ const ProductOptionsUI = (props) => {
95
97
  handleChangeSuboptionState,
96
98
  handleChangeCommentState,
97
99
  productAddedToCartLength,
98
- handleFavoriteProduct
100
+ handleFavoriteProduct,
101
+ handleCreateGuestUser,
102
+ actionStatus
99
103
  } = props
100
104
 
101
105
  const { product, loading, error } = productObject
@@ -129,6 +133,9 @@ const ProductOptionsUI = (props) => {
129
133
 
130
134
  const [{ configs }] = useConfig()
131
135
  const unaddressedTypes = configs?.unaddressed_order_types_allowed?.value.split('|').map(value => Number(value)) || []
136
+ const guestCheckoutEnabled = configs?.guest_checkout_enabled?.value === '1'
137
+ const orderTypeEnabled = !orderTypeList[orderState?.options?.type - 1] || configs?.allowed_order_types_guest_checkout?.value?.includes(orderTypeList[orderState?.options?.type - 1])
138
+ const hideProductDescription = theme?.business_view?.components?.products?.components?.product?.components?.description?.hidden
132
139
 
133
140
  const closeModal = () => {
134
141
  setModalIsOpen(false)
@@ -246,6 +253,11 @@ const ProductOptionsUI = (props) => {
246
253
  }
247
254
  }
248
255
 
256
+ const handleUpdateGuest = () => {
257
+ const guestToken = nanoid()
258
+ if (guestToken) handleCreateGuestUser({ guest_token: guestToken })
259
+ }
260
+
249
261
  const handleSlideChange = () => {
250
262
  var videos = document.querySelectorAll('iframe, video')
251
263
  Array.prototype.forEach.call(videos, function (video) {
@@ -526,7 +538,7 @@ const ProductOptionsUI = (props) => {
526
538
  )}
527
539
  </ProductMeta>
528
540
  </Properties>
529
- {product?.description && (
541
+ {product?.description && !hideProductDescription && (
530
542
  <ProductDescription>
531
543
  <LinkableText
532
544
  text={product?.description}
@@ -662,7 +674,7 @@ const ProductOptionsUI = (props) => {
662
674
  <MidComponent key={i} {...props} />))
663
675
  }
664
676
  </ProductEdition>
665
- <ProductActions>
677
+ <ProductActions isColumn={(auth && !(orderState.options?.address_id || unaddressedTypes.includes(orderState?.options?.type)))}>
666
678
  <div className='price-amount-block'>
667
679
  <div className='price'>
668
680
  <h4>{productCart.total && parsePrice(productCart.total)}</h4>
@@ -737,6 +749,7 @@ const ProductOptionsUI = (props) => {
737
749
  ) : (
738
750
  <AddressList
739
751
  isModal
752
+ isProfile
740
753
  userId={isNaN(userCustomer?.id) ? null : userCustomer?.id}
741
754
  addressList={isNaN(userCustomer?.id) ? user.addresses : null}
742
755
  isProductForm
@@ -755,6 +768,11 @@ const ProductOptionsUI = (props) => {
755
768
  {isSoldOut || maxProductQuantity <= 0 ? t('SOLD_OUT', theme?.defaultLanguages?.SOLD_OUT || 'Sold out') : t('LOGIN_SIGNUP', theme?.defaultLanguages?.LOGIN_SIGNUP || 'Login / Sign Up')}
756
769
  </Button>
757
770
  )}
771
+ {!auth && guestCheckoutEnabled && orderTypeEnabled && (
772
+ <GuestUserLink onClick={handleUpdateGuest}>
773
+ {actionStatus?.loading ? <Skeleton height={25} width={70} /> : t('WITH_GUEST_USER', 'With Guest user')}
774
+ </GuestUserLink>
775
+ )}
758
776
  </ProductActions>
759
777
  </ProductInfo>
760
778
  </>
@@ -314,7 +314,7 @@ export const ProductActions = styled.div`
314
314
  div.price-amount-block {
315
315
  display: flex;
316
316
  justify-content: space-between;
317
- width: 80%
317
+ width: 70%
318
318
  }
319
319
 
320
320
  svg {
@@ -356,6 +356,17 @@ export const ProductActions = styled.div`
356
356
  margin: 0 10px;
357
357
  }
358
358
 
359
+ #address_control {
360
+ button.add {
361
+ width: calc(100% - 20px) !important;
362
+ margin: 10px 10px 0 10px;
363
+ }
364
+ }
365
+
366
+ div#address_list {
367
+ padding: 0;
368
+ }
369
+
359
370
  @media (min-width: 577px) {
360
371
  position: sticky;
361
372
  }
@@ -370,6 +381,13 @@ export const ProductActions = styled.div`
370
381
  padding: 10px 20px;
371
382
  box-sizing: border-box;
372
383
 
384
+ ${({ isColumn }) => isColumn && css`
385
+ flex-direction: column;
386
+ div.price-amount-block {
387
+ margin-bottom: 15px;
388
+ }
389
+ `}
390
+
373
391
  div.price {
374
392
  width: 25%;
375
393
  }
@@ -602,3 +620,20 @@ export const VideoGalleryWrapper = styled.div`
602
620
  font-size: 28px;
603
621
  }
604
622
  `
623
+
624
+ export const GuestUserLink = styled.div`
625
+ font-size: 14px;
626
+ color: ${props => props.theme.colors.primary};
627
+ text-align: center;
628
+ cursor: pointer;
629
+ margin: 15px 0;
630
+ white-space: nowrap;
631
+ &:hover {
632
+ text-decoration: underline;
633
+ }
634
+ margin-left: 10px;
635
+ ${props => props.theme.rtl && css`
636
+ margin-left: 0;
637
+ margin-right: 10px;
638
+ `}
639
+ `
@@ -63,7 +63,7 @@ export const ProductItemAccordion = (props) => {
63
63
  const productActionsDelete = useRef(null)
64
64
 
65
65
  const viewString = isConfirmationPage ? 'confirmation' : isStore ? 'business_view' : 'header'
66
- const showProductImage = !orderingTheme?.theme?.[viewString]?.components?.cart?.components?.products?.components?.image?.hidden
66
+ const showProductImage = !theme?.[viewString]?.components?.cart?.components?.products?.components?.image?.hidden
67
67
 
68
68
  const productInfo = () => {
69
69
  if (isCartProduct) {
@@ -224,13 +224,15 @@ export const ProductItemAccordion = (props) => {
224
224
  <Pencil color='#B1BCCC' />
225
225
  </ProductActionsEdit>
226
226
  )}
227
- <ProductActionsDelete
228
- ref={productActionsDelete}
229
- onClick={() => onDeleteProduct(product)}
230
- disabled={orderState.loading}
231
- >
232
- <Trash color='#B1BCCC' />
233
- </ProductActionsDelete>
227
+ {onDeleteProduct && (
228
+ <ProductActionsDelete
229
+ ref={productActionsDelete}
230
+ onClick={() => onDeleteProduct(product)}
231
+ disabled={orderState.loading}
232
+ >
233
+ <Trash color='#B1BCCC' />
234
+ </ProductActionsDelete>
235
+ )}
234
236
  </ProductActions>
235
237
  )}
236
238
  </ProductPriceSection>
@@ -238,13 +240,15 @@ export const ProductItemAccordion = (props) => {
238
240
  </>
239
241
  ) : (
240
242
  <ProductActions>
241
- <ProductActionsDelete
242
- ref={productActionsDelete}
243
- onClick={() => onDeleteProduct(product)}
244
- disabled={orderState.loading}
245
- >
246
- <Trash color='#B1BCCC' />
247
- </ProductActionsDelete>
243
+ {onDeleteProduct && (
244
+ <ProductActionsDelete
245
+ ref={productActionsDelete}
246
+ onClick={() => onDeleteProduct(product)}
247
+ disabled={orderState.loading}
248
+ >
249
+ <Trash color='#B1BCCC' />
250
+ </ProductActionsDelete>
251
+ )}
248
252
  </ProductActions>
249
253
  )}
250
254
 
@@ -260,13 +264,15 @@ export const ProductItemAccordion = (props) => {
260
264
  <Pencil color='#B1BCCC' />
261
265
  </ProductActionsEdit>
262
266
  )}
263
- <ProductActionsDelete
264
- ref={productActionsDelete}
265
- onClick={() => onDeleteProduct(product)}
266
- disabled={orderState.loading}
267
- >
268
- <Trash color='#B1BCCC' />
269
- </ProductActionsDelete>
267
+ {onDeleteProduct && (
268
+ <ProductActionsDelete
269
+ ref={productActionsDelete}
270
+ onClick={() => onDeleteProduct(product)}
271
+ disabled={orderState.loading}
272
+ >
273
+ <Trash color='#B1BCCC' />
274
+ </ProductActionsDelete>
275
+ )}
270
276
  </ProductActions>
271
277
  <ProductNotAvailable>
272
278
  {t('NOT_AVAILABLE', 'Not available')}
@@ -277,13 +283,15 @@ export const ProductItemAccordion = (props) => {
277
283
  {!product?.valid_menu && isCartProduct && !isCartPending && (
278
284
  <ProductError>
279
285
  <ProductActions>
280
- <ProductActionsDelete
281
- ref={productActionsDelete}
282
- onClick={() => onDeleteProduct(product)}
283
- disabled={orderState.loading}
284
- >
285
- <Trash color='#D81212' />
286
- </ProductActionsDelete>
286
+ {onDeleteProduct && (
287
+ <ProductActionsDelete
288
+ ref={productActionsDelete}
289
+ onClick={() => onDeleteProduct(product)}
290
+ disabled={orderState.loading}
291
+ >
292
+ <Trash color='#D81212' />
293
+ </ProductActionsDelete>
294
+ )}
287
295
  </ProductActions>
288
296
  <ProductNotAvailable>
289
297
  {t('NOT_AVAILABLE', 'Not available')}
@@ -209,7 +209,7 @@ export const RenderProductsLayout = (props) => {
209
209
  </WrapperSearch>
210
210
  </>
211
211
  )}
212
- {!business?.loading && business?.previously_products?.length > 0 && !hidePreviousOrdered && windowSize.width < 993 && !categoryClicked && (
212
+ {!business?.loading && business?.previously_products?.length > 0 && !hidePreviousOrdered && !categoryClicked && (
213
213
  <OrderItAgain
214
214
  onProductClick={onProductClick}
215
215
  productList={business?.previously_products}
@@ -321,7 +321,7 @@ export const RenderProductsLayout = (props) => {
321
321
  />
322
322
  </WrapContent>
323
323
  </BusinessCategoryProductWrapper>
324
- {showCartOnProductList && (
324
+ {(windowSize.width >= 1000 && windowSize.height >= 600) && showCartOnProductList && (
325
325
  <BusinessCartContainer isProfessional={business?.professionals?.length > 0 && !useKioskApp}>
326
326
  <BusinessCartContent maxHeight={window.innerHeight - 100}>
327
327
  {currentCart?.products?.length > 0 ? (
@@ -399,7 +399,7 @@ export const RenderProductsLayout = (props) => {
399
399
  {(categoryClicked || windowSize.width >= 993) && (
400
400
  <BusinessCategoryProductWrapper>
401
401
  <WrapContent isGroceries id='groceries'>
402
- {!business?.loading && business?.previously_products?.length > 0 && windowSize.width >= 993 && (
402
+ {!business?.loading && !hidePreviousOrdered && business?.previously_products?.length > 0 && windowSize.width >= 993 && (
403
403
  <OrderItAgain
404
404
  onProductClick={onProductClick}
405
405
  productList={business?.previously_products}
@@ -209,12 +209,20 @@ const ReviewProductUI = (props) => {
209
209
  {props.beforeComponents?.map((BeforeComponent, i) => (
210
210
  <BeforeComponent key={i} {...props} />))}
211
211
  <ReviewProductContainer onSubmit={handleSubmit(onSubmit)}>
212
- {order?.products && order.products.length > 0 && order.products.map((product, i) => !product?.deleted && (
213
- <SingleProductReview
214
- {...props}
215
- key={i}
216
- product={product}
217
- />
212
+ {order?.products && order.products.length > 0 && order?.products.map(productsOrder => (
213
+ productsOrder?.length ? productsOrder?.map((product, i) => !product?.deleted && (
214
+ <SingleProductReview
215
+ {...props}
216
+ key={i}
217
+ product={product}
218
+ />
219
+ )) : !productsOrder?.deleted && (
220
+ <SingleProductReview
221
+ {...props}
222
+ key={i}
223
+ product={productsOrder}
224
+ />
225
+ )
218
226
  ))}
219
227
  <ActionBlock>
220
228
  <span onClick={closeReviewProduct}>{t('SKIP', 'Skip')}</span>
@@ -1,6 +1,7 @@
1
1
  import React, { useEffect, useRef, useState } from 'react'
2
2
  import { Swiper, SwiperSlide } from 'swiper/react'
3
- import { useUtils, useLanguage, useSession, useConfig, ProductForm as ProductFormController } from 'ordering-components-external'
3
+ import { nanoid } from 'nanoid'
4
+ import { useUtils, useLanguage, useSession, useConfig, ProductForm as ProductFormController, useOrder } from 'ordering-components-external'
4
5
  import Skeleton from 'react-loading-skeleton'
5
6
  import { Alert } from '../Confirm'
6
7
  import { Modal } from '../Modal'
@@ -13,7 +14,7 @@ import { ChevronLeft, ChevronRight, ChevronDown } from 'react-bootstrap-icons'
13
14
  import BsCaretLeftFill from '@meronex/icons/bs/BsCaretLeftFill'
14
15
  import { Button } from '../../styles/Buttons'
15
16
  import moment from 'moment'
16
- import { getTimes } from '../../../../../utils'
17
+ import { getTimes, orderTypeList } from '../../../../../utils'
17
18
  import SwiperCore, { Navigation } from 'swiper'
18
19
  import 'swiper/swiper-bundle.min.css'
19
20
  import 'swiper/swiper.min.css'
@@ -47,7 +48,8 @@ import {
47
48
  DayNumber,
48
49
  TimeListWrapper,
49
50
  TimeItem,
50
- ClosedBusinessMsg
51
+ ClosedBusinessMsg,
52
+ GuestUserLink
51
53
  } from './styles'
52
54
  SwiperCore.use([Navigation])
53
55
 
@@ -62,13 +64,16 @@ const ServiceFormUI = (props) => {
62
64
  maxProductQuantity,
63
65
  productCart,
64
66
  isCartProduct,
65
- professionalListState
67
+ professionalListState,
68
+ handleCreateGuestUser,
69
+ actionStatus
66
70
  } = props
67
71
 
68
72
  const { product, loading, error } = productObject
69
73
  const theme = useTheme()
70
74
  const [, t] = useLanguage()
71
75
  const [{ configs }] = useConfig()
76
+ const [orderState] = useOrder()
72
77
  const [{ parsePrice, parseDate }] = useUtils()
73
78
  const [{ auth }, { login }] = useSession()
74
79
  const [modalPageToShow, setModalPageToShow] = useState('login')
@@ -81,6 +86,9 @@ const ServiceFormUI = (props) => {
81
86
  const [isEnabled, setIsEnabled] = useState(false)
82
87
  const [datesList, setDatesList] = useState([])
83
88
 
89
+ const guestCheckoutEnabled = configs?.guest_checkout_enabled?.value === '1'
90
+ const orderTypeEnabled = !orderTypeList[orderState?.options?.type - 1] || configs?.allowed_order_types_guest_checkout?.value?.includes(orderTypeList[orderState?.options?.type - 1])
91
+
84
92
  const dropDownRef = useRef()
85
93
  const is12Hours = configs?.format_time?.value === '12'
86
94
 
@@ -89,6 +97,11 @@ const ServiceFormUI = (props) => {
89
97
  setModalPageToShow('login')
90
98
  }
91
99
 
100
+ const handleUpdateGuest = () => {
101
+ const guestToken = nanoid()
102
+ if (guestToken) handleCreateGuestUser({ guest_token: guestToken })
103
+ }
104
+
92
105
  const handleSuccessLogin = (user) => {
93
106
  if (user) {
94
107
  closeModal()
@@ -485,6 +498,11 @@ const ServiceFormUI = (props) => {
485
498
  {isSoldOut || maxProductQuantity <= 0 ? t('SOLD_OUT', theme?.defaultLanguages?.SOLD_OUT || 'Sold out') : t('LOGIN_SIGNUP', theme?.defaultLanguages?.LOGIN_SIGNUP || 'Login / Sign Up')}
486
499
  </Button>
487
500
  )}
501
+ {!auth && guestCheckoutEnabled && orderTypeEnabled && (
502
+ <GuestUserLink onClick={handleUpdateGuest}>
503
+ {actionStatus?.loading ? <Skeleton height={25} width={70} /> : t('WITH_GUEST_USER', 'With Guest user')}
504
+ </GuestUserLink>
505
+ )}
488
506
  </ButtonWrapper>
489
507
  </>
490
508
  )}
@@ -469,3 +469,19 @@ export const ClosedBusinessMsg = styled.div`
469
469
  font-size: 16px;
470
470
  width: 100%;
471
471
  `
472
+
473
+ export const GuestUserLink = styled.div`
474
+ font-size: 14px;
475
+ color: ${props => props.theme.colors.primary};
476
+ cursor: pointer;
477
+ margin: 15px 0;
478
+ white-space: nowrap;
479
+ &:hover {
480
+ text-decoration: underline;
481
+ }
482
+ margin-left: 10px;
483
+ ${props => props.theme.rtl && css`
484
+ margin-left: 0;
485
+ margin-right: 10px;
486
+ `}
487
+ `