From e87fe71959a97b1222335828a5dd1022b22bf153 Mon Sep 17 00:00:00 2001 From: Thijmen Wijers <106662400+wthijmen@users.noreply.github.com> Date: Fri, 1 Dec 2023 15:41:03 +0100 Subject: [PATCH] feat: add carrier dpd (#786) * feat: add carrier dpd --- Block/Sales/NewShipmentForm.php | 2 + Helper/Data.php | 3 + etc/adminhtml/system.xml | 57 +++++++++++++++++++ etc/config.xml | 20 +++++++ i18n/en_US.csv | 1 + i18n/nl_NL.csv | 1 + .../web/template/grid/order_massaction.html | 5 ++ view/frontend/web/js/view/delivery-options.js | 2 + 8 files changed, 91 insertions(+) diff --git a/Block/Sales/NewShipmentForm.php b/Block/Sales/NewShipmentForm.php index 2899aabd..97f73ecf 100644 --- a/Block/Sales/NewShipmentForm.php +++ b/Block/Sales/NewShipmentForm.php @@ -6,6 +6,7 @@ use MyParcelNL\Sdk\src\Model\Carrier\CarrierDHLEuroplus; use MyParcelNL\Sdk\src\Model\Carrier\CarrierDHLForYou; use MyParcelNL\Sdk\src\Model\Carrier\CarrierDHLParcelConnect; +use MyParcelNL\Sdk\src\Model\Carrier\CarrierDPD; use MyParcelNL\Sdk\src\Model\Carrier\CarrierFactory; use MyParcelNL\Sdk\src\Model\Carrier\CarrierPostNL; use MyParcelNL\Sdk\src\Model\Consignment\AbstractConsignment; @@ -17,6 +18,7 @@ class NewShipmentForm CarrierDHLForYou::class, CarrierDHLEuroplus::class, CarrierDHLParcelConnect::class, + CarrierDPD::class, ]; public const PACKAGE_TYPE_HUMAN_MAP = [ diff --git a/Helper/Data.php b/Helper/Data.php index 2ab71245..9cf587f5 100755 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -12,6 +12,7 @@ use MyParcelNL\Sdk\src\Model\Carrier\CarrierDHLEuroplus; use MyParcelNL\Sdk\src\Model\Carrier\CarrierDHLForYou; use MyParcelNL\Sdk\src\Model\Carrier\CarrierDHLParcelConnect; +use MyParcelNL\Sdk\src\Model\Carrier\CarrierDPD; use MyParcelNL\Sdk\src\Model\Carrier\CarrierPostNL; use MyParcelNL\Sdk\src\Model\Consignment\AbstractConsignment; use MyParcelNL\Sdk\src\Model\Consignment\DropOffPoint; @@ -25,12 +26,14 @@ class Data extends AbstractHelper public const XML_PATH_DHLFORYOU_SETTINGS = 'myparcelnl_magento_dhlforyou_settings/'; public const XML_PATH_DHLEUROPLUS_SETTINGS = 'myparcelnl_magento_dhleuroplus_settings/'; public const XML_PATH_DHLPARCELCONNECT_SETTINGS = 'myparcelnl_magento_dhlparcelconnect_settings/'; + public const XML_PATH_DPD_SETTINGS = 'myparcelnl_magento_dpd_settings/'; public const DEFAULT_WEIGHT = 1000; public const CARRIERS_XML_PATH_MAP = [ CarrierPostNL::NAME => self::XML_PATH_POSTNL_SETTINGS, CarrierDHLForYou::NAME => self::XML_PATH_DHLFORYOU_SETTINGS, CarrierDHLEuroplus::NAME => self::XML_PATH_DHLEUROPLUS_SETTINGS, CarrierDHLParcelConnect::NAME => self::XML_PATH_DHLPARCELCONNECT_SETTINGS, + CarrierDPD::NAME => self::XML_PATH_DPD_SETTINGS, ]; /** diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 8a176085..5dcb91b1 100755 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -905,6 +905,63 @@ +
+ + myparcelnl_magento + MyParcelNL_Magento::myparcelnl_magento + + + + + Show a delivery date in the checkout. + Magento\Config\Model\Config\Source\Yesno + + + + + 1 + + MyParcelNL\Magento\Model\Source\NumberOfDays + Amount of days in the future customers can choose from in the checkout. + + + + If a request is made for the delivery options between Friday after, and Monday before, cut-off time then Tuesday will be shown as the next possible delivery date. + + + + MyParcelNL\Magento\Model\Source\DropOffDays + Select the days that you send the orders. + 1 + + + + This options allows you to set the number of days it takes you to pick, pack and hand in your parcels at PostNL when ordered before the cutoff time. + MyParcelNL\Magento\Model\Source\DropOffDelayDays + + + + + + + Magento\Config\Model\Config\Source\Yesno + + + + + + + Magento\Config\Model\Config\Source\Yesno + + + + Enter an amount that is either positive or negative. For example, do you want to give a discount for using this function or do you want to charge extra for this delivery option. + + 1 + + + +
diff --git a/etc/config.xml b/etc/config.xml index 025ce628..e2ccb311 100755 --- a/etc/config.xml +++ b/etc/config.xml @@ -217,6 +217,26 @@ + + + + + 3 + 15,30,00 + 1,2,3,4,5 + 0 + 14,30,00 + 0 + + + 1 + + + 1 + 0 + + + 1 diff --git a/i18n/en_US.csv b/i18n/en_US.csv index dff91744..10daa1ef 100755 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -44,6 +44,7 @@ myparcelnl_magento_dhlforyou_settings/delivery/only_recipient, DHL For You deliv myparcelnl_magento_dhlforyou_settings/delivery/only_recipient/signature, DHL For You delivery with only recipient and signature myparcelnl_magento_dhleuroplus_settings/delivery, DHL Europlus delivery myparcelnl_magento_dhlparcelconnect_settings/delivery, DHL Parcel Connect delivery +myparcelnl_magento_dpd_settings/delivery, DPD delivery 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/nl_NL.csv b/i18n/nl_NL.csv index d7390347..886cfe7f 100755 --- a/i18n/nl_NL.csv +++ b/i18n/nl_NL.csv @@ -36,6 +36,7 @@ myparcelnl_magento_dhlforyou_settings/delivery/only_recipient, DHL For You bezor myparcelnl_magento_dhlforyou_settings/delivery/only_recipient/signature, DHL For You bezorging met alleen ontvanger en handtekening myparcelnl_magento_dhleuroplus_settings/delivery, DHL Europlus bezorging myparcelnl_magento_dhlparcelconnect_settings/delivery, DHL Parcel Connect bezorging +myparcenl_magento_dpd_settings/delivery, DPD bezorging myparcelnl_magento_error_no_shipments_to_process, Geen MyParcel zendingen om te verwerken. Version and support,Versie en support General settings,Algemene instellingen diff --git a/view/adminhtml/web/template/grid/order_massaction.html b/view/adminhtml/web/template/grid/order_massaction.html index b6b9f6c1..26880f5b 100755 --- a/view/adminhtml/web/template/grid/order_massaction.html +++ b/view/adminhtml/web/template/grid/order_massaction.html @@ -56,6 +56,11 @@ name="mypa_carrier" value="dhlparcelconnect"> +
+ + +
diff --git a/view/frontend/web/js/view/delivery-options.js b/view/frontend/web/js/view/delivery-options.js index aadd6a75..305ae2da 100644 --- a/view/frontend/web/js/view/delivery-options.js +++ b/view/frontend/web/js/view/delivery-options.js @@ -87,6 +87,8 @@ define( 'myparcelnl_magento_dhlforyou_settings/delivery/only_recipient/same_day_delivery': 'config.carrierSettings.dhlforyou.priceSameDayDeliveryAndOnlyRecipient', 'myparcelnl_magento_dhleuroplus_settings/delivery': 'config.carrierSettings.dhleuroplus.priceStandardDelivery', 'myparcelnl_magento_dhlparcelconnect_settings/delivery': 'config.carrierSettings.dhlparcelconnect.priceStandardDelivery', + 'myparcelnl_magento_dpd_settings/delivery': 'config.carrierSettings.dpd.priceStandardDelivery', + 'myparcelnl_magento_dpd_settings/pickup': 'config.carrierSettings.dpd.pricePickup', }, /**