ordering-ui-react-native 0.16.78 → 0.16.79
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/package.json
CHANGED
|
@@ -125,6 +125,8 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
125
125
|
const [currentProduct, setCurrentProduct] = useState(null)
|
|
126
126
|
|
|
127
127
|
const isCheckoutMultiBusinessEnabled: Boolean = configs?.checkout_multi_business_enabled?.value === '1'
|
|
128
|
+
const openCarts = (Object.values(orderState?.carts)?.filter((cart: any) => 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) || []
|
|
129
|
+
|
|
128
130
|
const currentCart: any = Object.values(orderState.carts).find((cart: any) => cart?.business?.slug === business?.slug) ?? {}
|
|
129
131
|
const isOpenFiltProducts = isOpenSearchBar && !!searchValue
|
|
130
132
|
const filtProductsHeight = Platform.OS === 'ios' ? 0 : 100
|
|
@@ -151,7 +153,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
151
153
|
}
|
|
152
154
|
|
|
153
155
|
const handleUpsellingPage = () => {
|
|
154
|
-
if (isCheckoutMultiBusinessEnabled) {
|
|
156
|
+
if (isCheckoutMultiBusinessEnabled && openCarts.length > 1) {
|
|
155
157
|
onRedirect('CheckoutNavigator', {
|
|
156
158
|
screen: 'MultiCheckout'
|
|
157
159
|
})
|
|
@@ -62,6 +62,7 @@ const CartUI = (props: any) => {
|
|
|
62
62
|
const isCartPending = cart?.status === 2
|
|
63
63
|
const isCouponEnabled = validationFields?.fields?.checkout?.coupon?.enabled
|
|
64
64
|
const isCheckoutMultiBusinessEnabled: Boolean = configs?.checkout_multi_business_enabled?.value === '1'
|
|
65
|
+
const openCarts = (Object.values(orderState?.carts)?.filter((cart: any) => 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) || []
|
|
65
66
|
|
|
66
67
|
const business: any = (orderState?.carts && Object.values(orderState.carts).find((_cart: any) => _cart?.uuid === props.cartuuid)) ?? {}
|
|
67
68
|
const businessId = business?.business_id ?? null
|
|
@@ -103,7 +104,7 @@ const CartUI = (props: any) => {
|
|
|
103
104
|
const handleUpsellingPage = () => {
|
|
104
105
|
setOpenUpselling(false)
|
|
105
106
|
setCanOpenUpselling(false)
|
|
106
|
-
if (isCheckoutMultiBusinessEnabled) {
|
|
107
|
+
if (isCheckoutMultiBusinessEnabled && openCarts.length > 1) {
|
|
107
108
|
props.onNavigationRedirect('CheckoutNavigator', {
|
|
108
109
|
screen: 'MultiCheckout'
|
|
109
110
|
})
|
|
@@ -79,6 +79,7 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
79
79
|
const isPreOrder = configs?.preorder_status_enabled?.value === '1'
|
|
80
80
|
const maximumCarts = 5
|
|
81
81
|
const isDisablePlaceOrderButton = !(paymethodSelected?.paymethod_id || paymethodSelected?.wallet_id) || openCarts.length > maximumCarts
|
|
82
|
+
const walletCarts = (Object.values(carts)?.filter((cart: any) => 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) || []
|
|
82
83
|
|
|
83
84
|
const [isUserDetailsEdit, setIsUserDetailsEdit] = useState(false);
|
|
84
85
|
const [phoneUpdate, setPhoneUpdate] = useState(false);
|
|
@@ -253,6 +254,11 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
253
254
|
</OText>
|
|
254
255
|
</CCNotCarts>
|
|
255
256
|
)}
|
|
257
|
+
{walletCarts.length > 0 && (
|
|
258
|
+
<OText size={14} color={theme.colors.danger5} style={{ marginVertical: 20 }}>
|
|
259
|
+
{t('WARNING_PARTIAL_WALLET_CARTS', 'Important: One or more carts can`t be completed due a partial payment with cash/points wallet and requires to be paid individually')}
|
|
260
|
+
</OText>
|
|
261
|
+
)}
|
|
256
262
|
{openCarts.length > 0 && (
|
|
257
263
|
<ChCartsTotal>
|
|
258
264
|
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
|