Skip to content

Commit

Permalink
fix: allow package type mailbox when postnl is disabled (#850)
Browse files Browse the repository at this point in the history
  • Loading branch information
joerivanveen authored Jun 27, 2024
1 parent 52bc15f commit c3357eb
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
3 changes: 1 addition & 2 deletions Model/Checkout/Carrier.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ public static function getMethods()
*/
public function getAllowedMethods()
{
$methods = self::getMethods();
return $methods;
return self::getMethods();
}

/**
Expand Down
8 changes: 4 additions & 4 deletions Model/Quote/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ public function __construct(
$this->cart = $cart->getQuote();
$this->package = $package;
$this->currency = $currency;

$this->package->setMailboxSettings();
$this->package->setDigitalStampSettings();
$this->package->setPackageSmallSettings();
}

/**
Expand Down Expand Up @@ -375,6 +371,10 @@ public function checkPackageType(string $carrier, ?string $country = null): stri
$canHaveMailbox = $consignment->canHavePackageType(AbstractConsignment::PACKAGE_TYPE_MAILBOX_NAME);
$canHavePackageSmall = $consignment->canHavePackageType(AbstractConsignment::PACKAGE_TYPE_PACKAGE_SMALL_NAME);

$this->package->setMailboxSettings($carrierPath);
$this->package->setDigitalStampSettings($carrierPath);
$this->package->setPackageSmallSettings($carrierPath);

if ($canHaveMailbox) {
if (AbstractConsignment::CC_NL === $country) {
$this->package->setMailboxActive($this->helper->getBoolConfig($carrierPath, 'mailbox/active'));
Expand Down
2 changes: 1 addition & 1 deletion Model/Sales/Repository/PackageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public function setPackageSmallSettings(string $carrierPath = self::XML_PATH_POS
$settings = $this->getConfigValue("{$carrierPath}package_small");

if (null === $settings || ! array_key_exists('active', $settings)) {
$this->_logger->critical("Can't set settings with path: {$carrierPath}digital_stamp");
$this->_logger->critical("Can't set settings with path: {$carrierPath}package_small");

return $this;
}
Expand Down
1 change: 1 addition & 0 deletions i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ myparcelnl_magento_dhlforyou_settings/delivery/signature, DHL For You delivery w
myparcelnl_magento_dhlforyou_settings/delivery/only_recipient, DHL For You delivery with only recipient
myparcelnl_magento_dhlforyou_settings/delivery/only_recipient/signature, DHL For You delivery with only recipient and signature
myparcelnl_magento_dhlforyou_settings/pickup, DHL For You pickup location
myparcelnl_magento_dhlforyou_settings/mailbox, DHL For You mailbox
myparcelnl_magento_dhleuroplus_settings/delivery, DHL Europlus delivery
myparcelnl_magento_dhlparcelconnect_settings/delivery, DHL Parcel Connect delivery
myparcelnl_magento_dhlparcelconnect_settings/pickup, DHL Parcel Connect pickup
Expand Down
1 change: 1 addition & 0 deletions i18n/fr_FR.csv
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ myparcelnl_magento_dhlforyou_settings/delivery/signature, Livraison avec signatu
myparcelnl_magento_dhlforyou_settings/delivery/only_recipient, Livraison uniquement au destinataire DHL For You
myparcelnl_magento_dhlforyou_settings/delivery/only_recipient/signature, Livraison uniquement au destinataire avec signature DHL For You
myparcelnl_magento_dhlforyou_settings/pickup, Collecte DHL For You
myparcelnl_magento_dhlforyou_settings/mailbox, Boîte aux lettres DHL For You
myparcelnl_magento_dhleuroplus_settings/delivery, Livraison DHL Europlus
myparcelnl_magento_dhlparcelconnect_settings/delivery, Livraison DHL Parcel Connect
myparcelnl_magento_dhlparcelconnect_settings/pickup, Collecte DHL Parcel Connect
Expand Down
1 change: 1 addition & 0 deletions i18n/nl_NL.csv
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ myparcelnl_magento_dhlforyou_settings/delivery/signature, DHL For You bezorging
myparcelnl_magento_dhlforyou_settings/delivery/only_recipient, DHL For You bezorging met alleen ontvanger
myparcelnl_magento_dhlforyou_settings/delivery/only_recipient/signature, DHL For You bezorging met alleen ontvanger en handtekening
myparcelnl_magento_dhlforyou_settings/pickup, DHL For You afhaallocatie
myparcelnl_magento_dhlforyou_settings/mailbox, DHL For You brievenbuspakje
myparcelnl_magento_dhleuroplus_settings/delivery, DHL Europlus bezorging
myparcelnl_magento_dhlparcelconnect_settings/delivery, DHL Parcel Connect bezorging
myparcelnl_magento_dhlparcelconnect_settings/pickup, DHL Parcel Connect afhaallocatie
Expand Down

0 comments on commit c3357eb

Please sign in to comment.