Skip to content

Commit 7d9a133

Browse files
committed
Adjusted option values according to the latest changes
1 parent 9787c95 commit 7d9a133

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/code/Magento/QuoteGraphQl/Model/Cart/UpdateCartItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function execute(Quote $cart, int $cartItemId, float $qty, array $customi
4747
{
4848
$customizableOptions = [];
4949
foreach ($customizableOptionsData as $customizableOption) {
50-
$customizableOptions[$customizableOption['id']] = $customizableOption['value'];
50+
$customizableOptions[$customizableOption['id']] = $customizableOption['value_string'];
5151
}
5252

5353
try {

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/EditQuoteItemCustomOptionsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public function testOptionSetPersistsOnExtraOptionWithIncorrectId()
168168
$customOptionsValues = $this->getCustomOptionsValuesForQuery($sku);
169169

170170
/* Add nonexistent option to the query */
171-
$customOptionsValues[] = ['id' => -10, 'value' => 'value'];
171+
$customOptionsValues[] = ['id' => -10, 'value_string' => 'value'];
172172

173173
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
174174
$customizableOptionsQuery = preg_replace('/"([^"]+)"\s*:\s*/', '$1:', json_encode($customOptionsValues));
@@ -259,13 +259,13 @@ private function getCustomOptionsValuesForQuery(string $sku): array
259259
if ($optionType == 'field' || $optionType == 'area') {
260260
$customOptionsValues[] = [
261261
'id' => (int) $customOption->getOptionId(),
262-
'value' => 'test'
262+
'value_string' => 'test'
263263
];
264264
} elseif ($optionType == 'drop_down') {
265265
$optionSelectValues = $customOption->getValues();
266266
$customOptionsValues[] = [
267267
'id' => (int) $customOption->getOptionId(),
268-
'value' => reset($optionSelectValues)->getOptionTypeId()
268+
'value_string' => reset($optionSelectValues)->getOptionTypeId()
269269
];
270270
}
271271
}

0 commit comments

Comments
 (0)