Skip to content

Commit

Permalink
feat: add mailbox to dpd (#843)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
FlorianSDV authored May 29, 2024
1 parent 495ea80 commit 0fbd8ee
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 19 deletions.
2 changes: 2 additions & 0 deletions Model/Rate/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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,
Expand Down
28 changes: 28 additions & 0 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1307,6 +1307,34 @@
</depends>
</field>
</group>
<group id="mailbox" translate="label" type="text" sortOrder="420" showInDefault="1" showInWebsite="1"
showInStore="1">
<label>Mailbox settings</label>
<field id="active" translate="label" type="select" sortOrder="355" showInDefault="1" showInWebsite="1"
showInStore="1">
<label>Automate mailbox</label>
<tooltip>Select automatically mailbox packages based on weight or volume</tooltip>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="weight" translate="label comment" type="text" sortOrder="360" showInDefault="1"
showInWebsite="1" showInStore="1">
<label>Mailbox weight</label>
<tooltip>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.
</tooltip>
<depends>
<field id="active">1</field>
</depends>
</field>
<field id="fee" translate="label comment" type="text" sortOrder="365" showInDefault="1"
showInWebsite="1" showInStore="1">
<label>Mailbox fee</label>
<tooltip>Enter a basic price for a mailbox. The regular price will not affect this price.</tooltip>
<depends>
<field id="active">1</field>
</depends>
</field>
</group>
</section>
<section id="myparcelnl_magento_ups_settings" translate="label" type="text" sortOrder="200" showInDefault="1" showInWebsite="1" showInStore="1">
<label>UPS settings</label>
Expand Down
50 changes: 31 additions & 19 deletions etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
</dev>

<myparcelnl_magento_general>
<date_settings>
<allow_show_delivery_date>1</allow_show_delivery_date>
<deliverydays_window>7</deliverydays_window>
<dropoff_delay>0</dropoff_delay>
</date_settings>
<print>
<paper_type>A4</paper_type>
<label_description>%order_nr%</label_description>
Expand Down Expand Up @@ -233,25 +238,32 @@
</delivery>
</myparcelnl_magento_ups_settings>

<myparcelnl_magento_dpd_settings>
<default_options>
</default_options>
<general>
<deliverydays_window>3</deliverydays_window>
<cutoff_time>15,30,00</cutoff_time>
<dropoff_days>1,2,3,4,5</dropoff_days>
<monday_delivery_active>0</monday_delivery_active>
<saturday_cutoff_time>14,30,00</saturday_cutoff_time>
<dropoff_delay>0</dropoff_delay>
</general>
<delivery>
<active>1</active>
</delivery>
<pickup>
<active>1</active>
<fee>0</fee>
</pickup>
</myparcelnl_magento_dpd_settings>
<myparcelnl_magento_dpd_settings>
<default_options>
</default_options>
<general>
<deliverydays_window>3</deliverydays_window>
<cutoff_time>15,30,00</cutoff_time>
<dropoff_days>1,2,3,4,5</dropoff_days>
<monday_delivery_active>0</monday_delivery_active>
<saturday_cutoff_time>14,30,00</saturday_cutoff_time>
<dropoff_delay>0</dropoff_delay>
</general>
<delivery>
<active>1</active>
</delivery>
<pickup>
<active>1</active>
<fee>0</fee>
</pickup>
<mailbox>
<active>0</active>
<other_options>1</other_options>
<weight>2000</weight>
<fee>3.50</fee>
<pickup_mailbox>1</pickup_mailbox>
</mailbox>
</myparcelnl_magento_dpd_settings>

<sales_email>
<track>
Expand Down
1 change: 1 addition & 0 deletions i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions i18n/fr_FR.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions i18n/nl_NL.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions view/frontend/web/js/view/delivery-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},

/**
Expand Down

0 comments on commit 0fbd8ee

Please sign in to comment.