Skip to content

Commit

Permalink
fix(checkout): stabilise choosing pickup point (#841)
Browse files Browse the repository at this point in the history
* fix(checkout): stabilise choosing pickup point

Co-authored-by: Freek van Rijt <[email protected]>
  • Loading branch information
joerivanveen and FreekVR authored Apr 30, 2024
1 parent d77c76f commit aaa21d4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ myparcelnl_magento_dhlforyou_settings/delivery/only_recipient/signature, DHL For
myparcelnl_magento_dhlforyou_settings/pickup, DHL For You pickup location
myparcelnl_magento_dhleuroplus_settings/delivery, DHL Europlus delivery
myparcelnl_magento_dhlparcelconnect_settings/delivery, DHL Parcel Connect delivery
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
Expand Down
2 changes: 1 addition & 1 deletion i18n/fr_FR.csv
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ myparcelnl_magento_dhlforyou_settings/delivery/only_recipient/signature, Livrais
myparcelnl_magento_dhlforyou_settings/pickup, Collecte DHL For You
myparcelnl_magento_dhleuroplus_settings/delivery, Livraison DHL Europlus
myparcelnl_magento_dhlparcelconnect_settings/delivery, Livraison DHL Parcel Connect
myparcelnl_magento_dhleuroplus_settings/delivery, Livraison DHL Europlus
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_error_no_shipments_to_process, Non-pas d' envois MyParcel à traiter.
Expand Down
3 changes: 1 addition & 2 deletions i18n/nl_NL.csv
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ myparcelnl_magento_dhlforyou_settings/delivery/only_recipient/signature, DHL For
myparcelnl_magento_dhlforyou_settings/pickup, DHL For You afhaallocatie
myparcelnl_magento_dhleuroplus_settings/delivery, DHL Europlus bezorging
myparcelnl_magento_dhlparcelconnect_settings/delivery, DHL Parcel Connect bezorging
myparcelnl_magento_dhleuroplus_settings/delivery, DHL Europlus bezorging
myparcelnl_magento_dhlparcelconnect_settings/delivery, DHL Parcel Connect bezorging
myparcelnl_magento_dhlparcelconnect_settings/pickup, DHL Parcel Connect afhaallocatie
myparcelnl_magento_ups_settings/delivery, UPS bezorging
myparcelnl_magento_dpd_settings/delivery_title, DPD bezorging
myparcelnl_magento_dpd_settings/pickup_title, DPD ophaallocatie
Expand Down
8 changes: 3 additions & 5 deletions view/frontend/web/js/view/delivery-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ define(
*
* @param {string} address - Full address.
*
* @returns {string|undefined} - The house number, if found. Otherwise null.
* @returns {integer|null} - The house number, if found. Otherwise null.
*/
getHouseNumber: function(address) {
var result = deliveryOptions.splitStreetRegex.exec(address);
var numberIndex = 2;
return result ? result[numberIndex] : null;
return result ? parseInt(result[numberIndex]) : null;
},

/**
Expand All @@ -221,13 +221,11 @@ define(
* @param {Object?} address - Quote.shippingAddress from Magento.
*/
updateAddress: function(address) {
var newAddress;

if (!deliveryOptions.isUsingMyParcelMethod) {
return;
}

newAddress = deliveryOptions.getAddress(address || quote.shippingAddress());
const newAddress = deliveryOptions.getAddress(address || quote.shippingAddress());
if (_.isEqual(newAddress, window.MyParcelConfig.address)) {
return;
}
Expand Down

0 comments on commit aaa21d4

Please sign in to comment.