Skip to content

Commit

Permalink
Adjusted option values according to the latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rogyar committed May 8, 2019
1 parent 9787c95 commit 7d9a133
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function execute(Quote $cart, int $cartItemId, float $qty, array $customi
{
$customizableOptions = [];
foreach ($customizableOptionsData as $customizableOption) {
$customizableOptions[$customizableOption['id']] = $customizableOption['value'];
$customizableOptions[$customizableOption['id']] = $customizableOption['value_string'];
}

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function testOptionSetPersistsOnExtraOptionWithIncorrectId()
$customOptionsValues = $this->getCustomOptionsValuesForQuery($sku);

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

$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$customizableOptionsQuery = preg_replace('/"([^"]+)"\s*:\s*/', '$1:', json_encode($customOptionsValues));
Expand Down Expand Up @@ -259,13 +259,13 @@ private function getCustomOptionsValuesForQuery(string $sku): array
if ($optionType == 'field' || $optionType == 'area') {
$customOptionsValues[] = [
'id' => (int) $customOption->getOptionId(),
'value' => 'test'
'value_string' => 'test'
];
} elseif ($optionType == 'drop_down') {
$optionSelectValues = $customOption->getValues();
$customOptionsValues[] = [
'id' => (int) $customOption->getOptionId(),
'value' => reset($optionSelectValues)->getOptionTypeId()
'value_string' => reset($optionSelectValues)->getOptionTypeId()
];
}
}
Expand Down

0 comments on commit 7d9a133

Please sign in to comment.