Skip to content

Commit

Permalink
Merge pull request #2190 from graphcommerce-org/fix/customizable-opti…
Browse files Browse the repository at this point in the history
…ons-do-not-show-in-cart

Fix/customizable options do not show in cart
  • Loading branch information
paales authored Feb 6, 2024
2 parents 062a876 + 770a309 commit 0d27a76
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .changeset/purple-eggs-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@graphcommerce/magento-product-configurable": patch
"@graphcommerce/magento-cart-items": patch
---

Fixed a bug concerning customizable options. Customizable options of configurable products are shown again in the cart.
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 0d27a76

Please sign in to comment.