Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: activate dpd for myparcel contract #822

Merged
merged 4 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Model/Sales/TrackTraceHolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ public function convertDataFromMagentoToApi(Track $magentoTrack, array $options)
->setPickupCountry($pickupLocationAdapter->getCountry())
->setPickupLocationName($pickupLocationAdapter->getLocationName())
->setPickupLocationCode($pickupLocationAdapter->getLocationCode())
->setPickupNetworkId($pickupLocationAdapter->getPickupNetworkId())
->setReturn(false);

if ($pickupLocationAdapter->getRetailNetworkId()) {
Expand Down
57 changes: 57 additions & 0 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,63 @@
</field>
</group>
</section>
<section id="myparcelnl_magento_dpd_settings" translate="label" type="text" sortOrder="200" showInDefault="1" showInWebsite="1" showInStore="1">
<label>DPD settings</label>
<tab>myparcelnl_magento</tab>
<resource>MyParcelNL_Magento::myparcelnl_magento</resource>
<group id="general" translate="label comment" type="text" sortOrder="270" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Basic settings</label>
<field id="allow_show_delivery_date" translate="label comment" type="select" sortOrder="275" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Show delivery date</label>
<tooltip>Show a delivery date in the checkout.</tooltip>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="deliverydays_window" translate="label comment" type="select" sortOrder="276" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Number of days</label>
<depends>
<field id="allow_show_delivery_date">1</field>
</depends>
<source_model>MyParcelNL\Magento\Model\Source\NumberOfDays</source_model>
<tooltip>Amount of days in the future customers can choose from in the checkout.</tooltip>
</field>
<field id="cutoff_time" translate="label comment" type="time" sortOrder="280" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Cutoff time</label>
<tooltip>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.</tooltip>
</field>
<field id="dropoff_days" translate="label comment" type="multiselect" sortOrder="285" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Drop-off days</label>
<source_model>MyParcelNL\Magento\Model\Source\DropOffDays</source_model>
<tooltip>Select the days that you send the orders.</tooltip>
<can_be_empty>1</can_be_empty>
</field>
<field id="dropoff_delay" translate="label comment" type="select" sortOrder="290" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Drop-off-delay</label>
<tooltip>This options allows you to set the number of days it takes you to pick, pack and hand in your parcels at DPD when ordered before the cutoff time.</tooltip>
<source_model>MyParcelNL\Magento\Model\Source\DropOffDelayDays</source_model>
</field>
</group>
<group id="delivery" translate="label comment" type="text" sortOrder="300" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Delivery settings</label>
<field id="active" translate="label comment" type="select" sortOrder="305" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Delivery enabled</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
</group>
<group id="pickup" translate="label comment" type="text" sortOrder="400" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Pickup at DPD location</label>
<field id="active" translate="label comment" type="select" sortOrder="405" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Pickup active</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="fee" translate="label comment" type="text" sortOrder="410" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Pickup fee</label>
<tooltip>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.</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>
<tab>myparcelnl_magento</tab>
Expand Down
20 changes: 20 additions & 0 deletions etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,26 @@
</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>

<sales_email>
<track>
<enabled>1</enabled>
Expand Down
1 change: 1 addition & 0 deletions i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ myparcelnl_magento_dhleuroplus_settings/delivery, DHL Europlus delivery
myparcelnl_magento_dhlparcelconnect_settings/delivery, DHL Parcel Connect delivery
myparcelnl_magento_ups_settings/delivery, UPS delivery
myparcelnl_magento_dpd_settings/delivery, DPD delivery
myparcelnl_magento_dpd_settings/pickup, DPD pickup location
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"postinstall": "node postinstall.js"
},
"dependencies": {
"@myparcel/delivery-options": "^5.12",
"@myparcel/delivery-options": "^5.14",
"custom-event-polyfill": "^1.0.7",
"object-path": "^0.11.5"
},
Expand Down
4 changes: 2 additions & 2 deletions view/frontend/web/js/vendor/myparcel.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ __metadata:
languageName: node
linkType: hard

"@myparcel/delivery-options@npm:^5.12":
version: 5.12.0
resolution: "@myparcel/delivery-options@npm:5.12.0"
"@myparcel/delivery-options@npm:^5.14":
version: 5.14.1
resolution: "@myparcel/delivery-options@npm:5.14.1"
dependencies:
"@fortawesome/free-solid-svg-icons": "npm:^5.15.4"
"@myparcel/js-sdk": "npm:^2.0.3"
Expand All @@ -176,7 +176,7 @@ __metadata:
vue-async-computed: "npm:^3.9.0"
vue-click-outside: "npm:^1.1.0"
vue-fa: "npm:^2.0.1"
checksum: 37c4df9b7137f0493aeb84355292fa2f41acf486e79ba5c283db08bde1a88b06d628a1c5591e67388a6e98ca551fb4ed6d6dd419eec12ab849bf235fdb48887d
checksum: 0966e5652910bd7cdfc3e1f1241a619eda122d9b29e5febb5f1491737ffe9771b4efa78ee420c16ea5c58c87cb006ee1f8b15ee4bb386ea49990898748e2c16a
languageName: node
linkType: hard

Expand Down Expand Up @@ -225,7 +225,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@myparcel/magento@workspace:."
dependencies:
"@myparcel/delivery-options": "npm:^5.12"
"@myparcel/delivery-options": "npm:^5.14"
"@myparcel/eslint-config": "npm:^3.6.1"
"@myparcel/semantic-release-config": "npm:^4.0.0"
"@types/knockout": "npm:^3.4.72"
Expand Down