diff --git a/Helper/ShipmentOptions.php b/Helper/ShipmentOptions.php index b387f001..ce4b52b7 100644 --- a/Helper/ShipmentOptions.php +++ b/Helper/ShipmentOptions.php @@ -253,11 +253,11 @@ public static function getValueFromAttribute( */ public static function getValueOfOptionWhenSet(string $key, array $options): ?bool { - if ($options[$key] || false === $options[$key]) { - return (bool) $options[$key]; + if (! isset($options[$key])) { + return null; } - return null; + return (bool) $options[$key]; } /** @@ -358,7 +358,7 @@ public function getItemsCollectionByShipmentId($shipmentId): array */ private function optionIsEnabled($optionKey): bool { - if ($this->options[$optionKey] === null) { + if (! isset($this->options[$optionKey])) { return self::$defaultOptions->hasDefault($optionKey, $this->carrier); }