diff --git a/src/Traits/OrderItemCustomerOptionCapableTrait.php b/src/Traits/OrderItemCustomerOptionCapableTrait.php index 4d42e7ca..b13272df 100644 --- a/src/Traits/OrderItemCustomerOptionCapableTrait.php +++ b/src/Traits/OrderItemCustomerOptionCapableTrait.php @@ -110,6 +110,27 @@ public function equals(SyliusOrderItemInterface $item): bool // iterate over all options and compare their values foreach ($itemCustomerConfiguration as $code => $value) { + // If one option is multi-select and the other one isn't they're not equal + if (is_array($value) !== is_array($curItemCustomerConfiguration[$code])) { + return false; + } + + // If it's multi-select + if (is_array($value)) { + if (count($value) !== count($curItemCustomerConfiguration[$code])) { + return false; + } + + foreach ($curItemCustomerConfiguration[$code] as $optionKey => $multiSelectValue) { + if ($multiSelectValue->getOptionValue() !== $value[$optionKey]->getOptionValue()) { + return false; + } + } + + return false; + } + + // It's a normal value option if ($curItemCustomerConfiguration[$code]->getOptionValue() !== $value->getOptionValue()) { return false; }