From d63ae7e242ebf7b38e16140049f4ece25b9d95bb Mon Sep 17 00:00:00 2001 From: Jesse van der Poel Date: Tue, 6 Feb 2024 14:52:23 +0100 Subject: [PATCH 1/2] fixed bug which caused customizable_options to not show in cart if it was a configurable product --- .../SelectedCustomizableOptions.tsx | 8 +++++--- .../plugins/ConfigurableCartItemActionCard.tsx | 5 +---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/magento-cart-items/components/SelectedCustomizableOptions/SelectedCustomizableOptions.tsx b/packages/magento-cart-items/components/SelectedCustomizableOptions/SelectedCustomizableOptions.tsx index 7a3c17bff4..964308ceed 100644 --- a/packages/magento-cart-items/components/SelectedCustomizableOptions/SelectedCustomizableOptions.tsx +++ b/packages/magento-cart-items/components/SelectedCustomizableOptions/SelectedCustomizableOptions.tsx @@ -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 diff --git a/packages/magento-product-configurable/plugins/ConfigurableCartItemActionCard.tsx b/packages/magento-product-configurable/plugins/ConfigurableCartItemActionCard.tsx index dd7cb4badc..56914ceaa2 100644 --- a/packages/magento-product-configurable/plugins/ConfigurableCartItemActionCard.tsx +++ b/packages/magento-product-configurable/plugins/ConfigurableCartItemActionCard.tsx @@ -33,10 +33,7 @@ export function ConfigurableCartItemActionCard( details={ <> {rest.details} - + } /> From 770a309cdf0586aaaed5defd345e451dee8d89c8 Mon Sep 17 00:00:00 2001 From: Jesse van der Poel Date: Tue, 6 Feb 2024 14:59:58 +0100 Subject: [PATCH 2/2] Added changeset --- .changeset/purple-eggs-float.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/purple-eggs-float.md diff --git a/.changeset/purple-eggs-float.md b/.changeset/purple-eggs-float.md new file mode 100644 index 0000000000..a2555791b6 --- /dev/null +++ b/.changeset/purple-eggs-float.md @@ -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.