Skip to content

Commit

Permalink
fix: products with required modifier can add to quote quickly
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlLiu2023 authored and BrianJiang2021 committed Jul 11, 2023
1 parent 546167b commit 4c87f38
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ function ShoppingListDetails({ setOpenPage }: ShoppingListDetailsProps) {

await updateShoppingList(params)

snackbar.success('Shopping list status updated successfully')
snackbar.success('Shopping list status updated successfully', {
isClose: true,
})
tableRef.current?.initSearch()
} finally {
setIsRequestLoading(false)
Expand Down
9 changes: 7 additions & 2 deletions apps/storefront/src/utils/b3Product/shared/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,13 @@ export const getAllModifierDefaultValue = (modifiers: CustomFieldItems) => {
modifierInfo.defaultValue = defaultInfo?.id || ''

if (required) {
modifierInfo.isVerified =
modifierInfo.defaultValue.toString().length > 0
if (type === 'checkbox') {
modifierInfo.isVerified =
defaultInfo?.value_data?.checked_value || false
} else {
modifierInfo.isVerified =
modifierInfo.defaultValue.toString().length > 0
}
}
}

Expand Down

0 comments on commit 4c87f38

Please sign in to comment.