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
+
+
+