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: add carrier ups #787

Merged
merged 10 commits into from
Dec 21, 2023
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
2 changes: 2 additions & 0 deletions Block/Sales/NewShipmentForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
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\Carrier\CarrierUPS;
use MyParcelNL\Sdk\src\Model\Consignment\AbstractConsignment;

class NewShipmentForm
Expand All @@ -18,6 +19,7 @@ class NewShipmentForm
CarrierDHLForYou::class,
CarrierDHLEuroplus::class,
CarrierDHLParcelConnect::class,
CarrierUPS::class,
CarrierDPD::class,
];

Expand Down
3 changes: 3 additions & 0 deletions Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
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\Carrier\CarrierUPS;
use MyParcelNL\Sdk\src\Model\Consignment\AbstractConsignment;
use MyParcelNL\Sdk\src\Model\Consignment\DropOffPoint;
use MyParcelNL\Sdk\src\Services\CheckApiKeyService;
Expand All @@ -26,13 +27,15 @@ 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_UPS_SETTINGS = 'myparcelnl_magento_ups_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,
CarrierUPS::NAME => self::XML_PATH_UPS_SETTINGS,
CarrierDPD::NAME => self::XML_PATH_DPD_SETTINGS,
];

Expand Down
28 changes: 3 additions & 25 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -905,8 +905,8 @@
</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>
<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>
<resource>MyParcelNL_Magento::myparcelnl_magento</resource>
<group id="general" translate="label comment" type="text" sortOrder="270" showInDefault="1" showInWebsite="1" showInStore="1">
Expand All @@ -916,14 +916,6 @@
<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>
Expand All @@ -936,7 +928,7 @@
</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 PostNL when ordered before the cutoff time.</tooltip>
<tooltip>This options allows you to set the number of days it takes you to pick, pack and hand in your parcels at UPS when ordered before the cutoff time.</tooltip>
<source_model>MyParcelNL\Magento\Model\Source\DropOffDelayDays</source_model>
</field>
</group>
Expand All @@ -947,20 +939,6 @@
<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 DHL 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="sales_email">
<group id="track" translate="label" type="text" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="1">
Expand Down
8 changes: 2 additions & 6 deletions etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
</pickup>
</myparcelnl_magento_dhlparcelconnect_settings>

<myparcelnl_magento_dpd_settings>
<myparcelnl_magento_ups_settings>
<default_options>
</default_options>
<general>
Expand All @@ -231,11 +231,7 @@
<delivery>
<active>1</active>
</delivery>
<pickup>
<active>1</active>
<fee>0</fee>
</pickup>
</myparcelnl_magento_dpd_settings>
</myparcelnl_magento_ups_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 @@ -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_ups_settings/delivery, UPS 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.
Expand Down
1 change: 1 addition & 0 deletions i18n/nl_NL.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
myparcelnl_magento_ups_settings.delivery, UPS 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
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.10.0",
"@myparcel/delivery-options": "^5.11.1",
"custom-event-polyfill": "^1.0.7",
"object-path": "^0.11.5"
},
Expand Down
6 changes: 3 additions & 3 deletions view/adminhtml/web/template/grid/order_massaction.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
<label class="admin__field-label" for="mypa_carrier_dhlparcelconnect" trans="DHL Parcel Connect"></label>
</div>
<div class="admin__field admin__field-option">
<input type="radio" class="admin__control-radio" id="mypa_carrier_dpd"
name="mypa_carrier" value="dpd">
<label class="admin__field-label" for="mypa_carrier_dpd" trans="DPD"></label>
<input type="radio" class="admin__control-radio" id="mypa_carrier_ups"
name="mypa_carrier" value="ups">
<label class="admin__field-label" for="mypa_carrier_ups" trans="UPS"></label>
</div>
</div>
</div>
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 @@ -87,6 +87,7 @@ 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_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',
},
Expand Down