Skip to content

Commit

Permalink
fixed bug which caused customizable_options to not show in cart if it…
Browse files Browse the repository at this point in the history
… was a configurable product
  • Loading branch information
Jessevdpoel committed Feb 6, 2024
1 parent 062a876 commit d63ae7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import { SelectedCustomizableOptionFragment } from './SelectedCustomizableOption

type SelectedCustomizableOptionProps = CartItemFragment & {
customizable_options?: (SelectedCustomizableOptionFragment | null | undefined)[] | null
configurable_customizable?: (SelectedCustomizableOptionFragment | null | undefined)[] | null
}

export function SelectedCustomizableOptions(props: SelectedCustomizableOptionProps) {
const { customizable_options, product } = props

const options = filterNonNullableKeys(customizable_options, [])
const { customizable_options, product, configurable_customizable } = props
const options = customizable_options
? filterNonNullableKeys(customizable_options, [])
: filterNonNullableKeys(configurable_customizable, [])

if (!options.length) return null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ export function ConfigurableCartItemActionCard(
details={
<>
{rest.details}
<ConfigurableCartItemOptions
{...rest.cartItem}
productPrice={rest.cartItem.product.price_range.minimum_price.final_price.value}
/>
<ConfigurableCartItemOptions {...rest.cartItem} />
</>
}
/>
Expand Down

0 comments on commit d63ae7e

Please sign in to comment.