From 0fbd8eef099f7f21b03d8bafe0c99a78680d801b Mon Sep 17 00:00:00 2001 From: Florian Riecker- de Vries <93703843+FlorianSDV@users.noreply.github.com> Date: Wed, 29 May 2024 15:44:23 +0200 Subject: [PATCH] feat: add mailbox to dpd (#843) * feature: added mailbox settings to dpd * feat: added date settings to general * style: fix formatting * feat(checkout): show delivery date by default * feat(checkout): added dpd mailbox to options --- Model/Rate/Result.php | 2 + etc/adminhtml/system.xml | 28 +++++++++++ etc/config.xml | 50 ++++++++++++------- i18n/en_US.csv | 1 + i18n/fr_FR.csv | 1 + i18n/nl_NL.csv | 1 + view/frontend/web/js/view/delivery-options.js | 1 + 7 files changed, 65 insertions(+), 19 deletions(-) diff --git a/Model/Rate/Result.php b/Model/Rate/Result.php index 08e9f1cd..12562455 100755 --- a/Model/Rate/Result.php +++ b/Model/Rate/Result.php @@ -25,6 +25,7 @@ use MyParcelNL\Magento\Helper\Data; use MyParcelNL\Magento\Model\Sales\Repository\PackageRepository; use MyParcelNL\Sdk\src\Model\Carrier\CarrierDHLForYou; +use MyParcelNL\Sdk\src\Model\Carrier\CarrierDPD; use MyParcelNL\Sdk\src\Model\Carrier\CarrierPostNL; use MyParcelNL\Sdk\src\Model\Consignment\AbstractConsignment; @@ -37,6 +38,7 @@ class Result extends \Magento\Shipping\Model\Rate\Result private const CARRIERS_WITH_MAILBOX = [ CarrierPostNL::NAME, CarrierDHLForYou::NAME, + CarrierDPD::NAME, ]; public const CARRIERS_WITH_DIGITAL_STAMP = [ CarrierPostNL::NAME, diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 2f39a557..fc371260 100755 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -1307,6 +1307,34 @@ + + + + + Select automatically mailbox packages based on weight or volume + Magento\Config\Model\Config\Source\Yesno + + + + To use this optimally, set a weight or 'Fit in mailbox' volume of each product. Regardless, + shipments heavier than the weight specified here will not be mailbox. + + + 1 + + + + + Enter a basic price for a mailbox. The regular price will not affect this price. + + 1 + + +
diff --git a/etc/config.xml b/etc/config.xml index 0de7be64..d959ae4a 100755 --- a/etc/config.xml +++ b/etc/config.xml @@ -16,6 +16,11 @@ + + 1 + 7 + 0 + A4 %order_nr% @@ -233,25 +238,32 @@ - - - - - 3 - 15,30,00 - 1,2,3,4,5 - 0 - 14,30,00 - 0 - - - 1 - - - 1 - 0 - - + + + + + 3 + 15,30,00 + 1,2,3,4,5 + 0 + 14,30,00 + 0 + + + 1 + + + 1 + 0 + + + 0 + 1 + 2000 + 3.50 + 1 + + diff --git a/i18n/en_US.csv b/i18n/en_US.csv index 65169299..2f08711f 100755 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -49,6 +49,7 @@ myparcelnl_magento_dhlparcelconnect_settings/pickup, DHL Parcel Connect pickup myparcelnl_magento_ups_settings/delivery, UPS delivery myparcelnl_magento_dpd_settings/delivery, DPD delivery myparcelnl_magento_dpd_settings/pickup, DPD pickup location +myparcelnl_magento_dpd_settings/mailbox, DPD mailbox myparcelnl_magento_error_no_shipments_to_process, No MyParcel shipments to process. no_account_settings, No account settings found. Press the import button in general configuration to fetch account settings. manage_drop_off_point, Manage your default drop-off point in the diff --git a/i18n/fr_FR.csv b/i18n/fr_FR.csv index ae86b367..571f7f34 100644 --- a/i18n/fr_FR.csv +++ b/i18n/fr_FR.csv @@ -53,6 +53,7 @@ myparcelnl_magento_dhlparcelconnect_settings/delivery, Livraison DHL Parcel Conn myparcelnl_magento_dhlparcelconnect_settings/pickup, Collecte DHL Parcel Connect myparcelnl_magento_ups_settings/delivery, Livraison UPS myparcelnl_magento_dpd_settings/delivery, Livraison DPD +myparcelnl_magento_dpd_settings/mailbox, Boîte aux lettres DPD myparcelnl_magento_error_no_shipments_to_process, Non-pas d' envois MyParcel à traiter. package_small,Petit paquet Packet,Petit paquet diff --git a/i18n/nl_NL.csv b/i18n/nl_NL.csv index 139d0abf..a03d8031 100755 --- a/i18n/nl_NL.csv +++ b/i18n/nl_NL.csv @@ -54,6 +54,7 @@ myparcelnl_magento_dpd_settings/delivery_title, DPD bezorging myparcelnl_magento_dpd_settings/pickup_title, DPD ophaallocatie myparcelnl_magento_dpd_settings/delivery, DPD bezorging myparcelnl_magento_dpd_settings/pickup, DPD ophaallocatie +myparcelnl_magento_dpd_settings/mailbox, DPD brievenbuspakje myparcelnl_magento_error_no_shipments_to_process, Geen MyParcel zendingen om te verwerken. package_small,Klein pakket Packet,Klein pakket diff --git a/view/frontend/web/js/view/delivery-options.js b/view/frontend/web/js/view/delivery-options.js index f67188a7..82366ffd 100644 --- a/view/frontend/web/js/view/delivery-options.js +++ b/view/frontend/web/js/view/delivery-options.js @@ -85,6 +85,7 @@ define( 'myparcelnl_magento_ups_settings/delivery': 'config.carrierSettings.ups.priceStandardDelivery', 'myparcelnl_magento_dpd_settings/delivery': 'config.carrierSettings.dpd.priceStandardDelivery', 'myparcelnl_magento_dpd_settings/pickup': 'config.carrierSettings.dpd.pricePickup', + 'myparcelnl_magento_dpd_settings/mailbox': 'config.carrierSettings.dpd.pricePackageTypeMailbox', }, /**