Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Commit 05ea6ef

Browse files
committed
GraphQL-474: Cannot return null for non-nullable field SelectedCustomizableOptionValue.sort_order and Call to a member function getPriceType() on null
1 parent b115f1c commit 05ea6ef

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private function extractCustomizableOptions(array $cartItemData): array
132132
$customizableOptionsData = [];
133133
foreach ($cartItemData['customizable_options'] as $customizableOption) {
134134
if (isset($customizableOption['value_string'])) {
135-
$customizableOptionsData[$customizableOption['id']] = $this->convertCustomOptions(
135+
$customizableOptionsData[$customizableOption['id']] = $this->convertCustomOptionValue(
136136
$customizableOption['value_string']
137137
);
138138
}
@@ -158,10 +158,12 @@ private function createBuyRequest(float $quantity, array $customOptions): DataOb
158158
}
159159

160160
/**
161+
* Convert custom options vakue
162+
*
161163
* @param string $value
162164
* @return string|array
163165
*/
164-
private function convertCustomOptions(string $value)
166+
private function convertCustomOptionValue(string $value)
165167
{
166168
$value = trim($value);
167169
if (substr($value, 0, 1) === "[" &&

0 commit comments

Comments
 (0)