From d2c00acab1124dbae302ec5f1553d92e7f6ea01f Mon Sep 17 00:00:00 2001 From: Marcin Kwiatkowski Date: Thu, 23 Jun 2022 16:02:44 +0200 Subject: [PATCH] fix: m2-860. cart, checkout - size and colour values are wrongly displayed --- .../composables/useCart/commands/addItemCommand.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/theme/modules/checkout/composables/useCart/commands/addItemCommand.ts b/packages/theme/modules/checkout/composables/useCart/commands/addItemCommand.ts index aaaf4e9e9..b4febfdf2 100644 --- a/packages/theme/modules/checkout/composables/useCart/commands/addItemCommand.ts +++ b/packages/theme/modules/checkout/composables/useCart/commands/addItemCommand.ts @@ -61,13 +61,16 @@ export const addItemCommand = { .addProductsToCart .cart as unknown as Cart; case 'ConfigurableProduct': + const selectedOptions = product.configurable_product_options_selection.options_available_for_selection + .flatMap((attr) => attr.option_value_uids); + const configurableCartInput: AddProductsToCartInput = { cartId, cartItems: [ { - parent_sku: product.sku, quantity, - sku: product.configurable_product_options_selection?.variant?.sku || '', + sku: product.sku, + selected_options: selectedOptions, }, ], };