Skip to content

Commit

Permalink
fix(export): restore automate shipment options settings
Browse files Browse the repository at this point in the history
  • Loading branch information
joerivanveen committed Oct 22, 2024
1 parent 88cb140 commit 3ac55a6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Helper/ShipmentOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ public function hasSignature(): bool
}

$signatureFromOptions = self::getValueOfOptionWhenSet(self::SIGNATURE, $this->options);

file_put_contents('/Applications/MAMP/htdocs/magento246/var/log/joeri.log',
'SIGNATURE: ' . var_export($signatureFromOptions, true) . ', ' . var_export($this->optionIsEnabled(self::SIGNATURE), true) . PHP_EOL
, FILE_APPEND);
return $signatureFromOptions ?? $this->optionIsEnabled(self::SIGNATURE);
}

Expand Down Expand Up @@ -364,7 +366,10 @@ public function getItemsCollectionByShipmentId($shipmentId): array
private function optionIsEnabled($optionKey): bool
{
if (! isset($this->options[$optionKey])) {
return self::$defaultOptions->hasDefault($optionKey, $this->carrier);
/** @var $configService \MyParcelNL\Magento\Helper\Data */
$configService = $this->objectManager->get(Data::class);

return '1' === $configService->getCarrierConfig("default_options/{$optionKey}_active", Data::CARRIERS_XML_PATH_MAP[$this->carrier] ?? 'general');
}

return (bool) $this->options[$optionKey];
Expand Down

0 comments on commit 3ac55a6

Please sign in to comment.