Skip to content

Commit

Permalink
fix(checkout): show nicer messages in delivery options (#842)
Browse files Browse the repository at this point in the history
* fix(checkout): show nicer messages in delivery options
  • Loading branch information
joerivanveen committed May 13, 2024
1 parent 8c10cc3 commit ae71d80
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 19 deletions.
26 changes: 20 additions & 6 deletions Model/Quote/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,30 +304,44 @@ private function getDeliveryOptionsStrings(): array
'deliveryStandardTitle' => $this->helper->getGeneralConfig('delivery_titles/standard_delivery_title'),
'deliveryMorningTitle' => $this->helper->getGeneralConfig('delivery_titles/morning_title'),
'deliveryEveningTitle' => $this->helper->getGeneralConfig('delivery_titles/evening_title'),
'deliveryPickupTitle' => $this->helper->getGeneralConfig('delivery_titles/pickup_title'),
'pickupTitle' => $this->helper->getGeneralConfig('delivery_titles/pickup_title'),
'deliverySameDayTitle' => $this->helper->getGeneralConfig('delivery_titles/same_day_title') ?: __('Same day delivery'),
'hideSenderTitle' => $this->helper->getGeneralConfig('delivery_titles/hide_sender_title') ?: __('Hide sender'),
'list' => $this->helper->getGeneralConfig('delivery_titles/pickup_list_button_title'),
'map' => $this->helper->getGeneralConfig('delivery_titles/pickup_map_button_title'),
'packageTypeMailbox' => $this->helper->getGeneralConfig('delivery_titles/mailbox_title'),
'packageTypeDigitalStamp' => $this->helper->getGeneralConfig('delivery_titles/digital_stamp_title'),
'pickupTitle' => $this->helper->getGeneralConfig('delivery_titles/pickup_title'),
'pickupLocationsListButton' => $this->helper->getGeneralConfig('delivery_titles/pickup_list_button_title'),
'pickupLocationsMapButton' => $this->helper->getGeneralConfig('delivery_titles/pickup_map_button_title'),
'packageTypePackageSmall' => $this->helper->getGeneralConfig('delivery_titles/package_small_title') ?: __('Packet'),
'signatureTitle' => $this->helper->getGeneralConfig('delivery_titles/signature_title'),
'onlyRecipientTitle' => $this->helper->getGeneralConfig('delivery_titles/only_recipient_title'),
'saturdayDeliveryTitle' => $this->helper->getGeneralConfig('delivery_titles/saturday_title'),

'wrongPostalCodeCity' => __('Postcode/city combination unknown'),
'addressNotFound' => __('Address details are not entered'),
'closed' => __('Closed'),
'discount' => __('Discount'),
'ecoFriendly' => __('Most sustainable'),
'free' => __('Free'),
'from' => __('From'),
'retry' => __('Again'),
'parcelLocker' => __('Parcel locker'),
'pickUpFrom' => __('Pick up from'),
'openingHours' => __('Opening hours'),
'showMoreHours' => __('Show more opening hours'),
'showMoreLocations' => __('Show more locations'),

'error3212' => __('{field} is required.'),
'error3501' => __('Address not found.'),
'error3505' => __('Postal code is invalid for the current country.'),

'cityText' => __('City'),
'postalCodeText' => __('Postcode'),
'numberText' => __('House number'),
'city' => __('City'),
'postcode' => __('Postcode'),
'cc' => __('Country'),
'houseNumber' => __('House number'),
'numberText' => __('House number'),
'postalCode' => __('Postal code'),
'street' => __('Street'),
];
}

Expand Down
25 changes: 17 additions & 8 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,33 +123,42 @@
<label>Signature on receipt title</label>
<tooltip>The times will be visible when nothing is filled in</tooltip>
</field>
<field id="only_recipient_title" translate="label comment" type="text" sortOrder="224" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="hide_sender_title" translate="label comment" type="text" sortOrder="224" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Hide sender title</label>
</field>
<field id="only_recipient_title" translate="label comment" type="text" sortOrder="225" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Home address only title</label>
<tooltip>The times will be visible when nothing is filled in</tooltip>
</field>
<field id="morning_title" translate="label comment" type="text" sortOrder="227" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="morning_title" translate="label comment" type="text" sortOrder="226" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Morning title</label>
<tooltip>The times will be visible when nothing is filled in</tooltip>
</field>
<field id="evening_title" translate="label comment" type="text" sortOrder="228" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="evening_title" translate="label comment" type="text" sortOrder="227" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Evening title</label>
<tooltip>The times will be visible when nothing is filled in</tooltip>
</field>
<field id="mailbox_title" translate="label comment" type="text" sortOrder="229" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="mailbox_title" translate="label comment" type="text" sortOrder="228" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Mailbox title</label>
</field>
<field id="digital_stamp_title" translate="label comment" type="text" sortOrder="230" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="digital_stamp_title" translate="label comment" type="text" sortOrder="229" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Digital stamp title</label>
</field>
<field id="pickup_title" translate="label comment" type="text" sortOrder="231" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="package_small_title" translate="label comment" type="text" sortOrder="230" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Packet title</label>
</field>
<field id="same_day_title" translate="label comment" type="text" sortOrder="231" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Same day title</label>
</field>
<field id="pickup_title" translate="label comment" type="text" sortOrder="232" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Pickup title</label>
</field>

<field id="pickup_list_button_title" translate="label comment" type="text" sortOrder="232" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="pickup_list_button_title" translate="label comment" type="text" sortOrder="233" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Pickup list button text</label>
</field>

<field id="pickup_map_button_title" translate="label comment" type="text" sortOrder="233" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="pickup_map_button_title" translate="label comment" type="text" sortOrder="234" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Pickup map button text</label>
</field>
</group>
Expand Down
24 changes: 23 additions & 1 deletion i18n/fr_FR.csv
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ 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.
package_small,Petit paquet
Packet,Petit paquet
Pacet title,Titre petit paquet
Parcel locker,Casier de colis
show_total_price,Afficher le prix total
show_surcharge_price,Afficher le prix supplémentaire
Version and support,Version et support
General settings,Paramètres généraux
API settings,Paramètres API
Expand All @@ -76,6 +82,9 @@ Track status,Statut du suivi
Track action,Action de suivi
MyParcel options,Options MyParcel
Package,Colis
Signature on receipt,Signature pour réception
Home address only,Livraison à domicile uniquement
Hide sender title,Titre de masquer l'expéditeur
Insured up to:,Assuré jusqu'à :
Download package label,Télécharger l'étiquette du colis
Create new concept,Créer une nouveau concept
Expand Down Expand Up @@ -124,6 +133,8 @@ Cut-off time,Heure limite de commande
"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.","Lorsqu'une commande est passée après la dernière heure de commande le vendredi et avant celle-ci le lundi, c'est donc le mardi qui sera affiché comme premier jour de livraison."
Drop-off days,Jours de dépôt
Monday delivery,Livraison le lundi
Same day delivery,Livraison le jour même
Same day title,Titre le jour même
"Delivery on monday may require special conditions compared to other (week)days including but not limited to fee and cutoff time.","La livraison le lundi peut nécessiter des conditions spéciales par rapport aux autres jours de la semaine, y compris mais sans s'y limiter, des frais et heure limite de commande."
Number of days,Nombre de jours
Delivery enabled,Livraison active
Expand Down Expand Up @@ -161,14 +172,21 @@ You not have entered the correct API key. Go to the general settings in the back
Address details are not entered,Les données relatives à l'adresse ne sont pas complétées
The times will be visible when nothing is filled in,Les temps ne seront pas visibles si aucune donnée n'est complétée
"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.","Introduisez ici un montant positif ou négatif. Si vous souhaitez par exemple proposer une réduction pour cette fonction ou décompter des frais supplémentaires pour cette option de livraison."
Discount,Rabais
Most sustainable,Le plus durable
Free,Gratuit
From,Depuis
Pick up from,Retrait à partir de
Pick up at a pick-up point,Retrait au point de ramassage
Opening hours,Heures d'ouverture
Show more opening hours,Montrer plus d'heures d'ouverture
Show more locations,Montrer plus d'emplacements
Closed,Fermé
Postcode,Code postal
Postal code,Code postal
House number,Numéro de rue
City,Ville
Country,Pays
Street,Rue
Again,A nouveau
Postcode/city combination unknown,Combinaison inconnue du code postal et de la ville
Deliver as quickly as possible,Livraison le plus vite possible
Expand All @@ -180,3 +198,7 @@ Thursday,Jeudi
Friday,Vendredi
Saturday,Samedi
Sunday,Dimanche

{field} is required.,{field} est requis.
Address not found.,Adresse introuvable.
Postal code is invalid for the current country.,Le code postal n’est pas valide pour le pays actuel.
23 changes: 19 additions & 4 deletions i18n/nl_NL.csv
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ myparcelnl_magento_dpd_settings/pickup_title, DPD ophaallocatie
myparcelnl_magento_dpd_settings/delivery, DPD bezorging
myparcelnl_magento_dpd_settings/pickup, DPD ophaallocatie
myparcelnl_magento_error_no_shipments_to_process, Geen MyParcel zendingen om te verwerken.
package_small, Klein pakket
package_small,Klein pakket
Packet,Klein pakket
Packet title,Klein pakket titel
Parcel locker,Pakketautomaat
show_total_price, Toon totaalprijs
show_surcharge_price, Toon meerprijs
Version and support,Versie en support
Expand Down Expand Up @@ -108,6 +111,8 @@ Enter a basic price for a mailbox. The regular price will not affect this price.
Morning delivery,Ochtendlevering
Evening delivery,Avondlevering
Evening delivery fee,Avondlevering kosten
Same day delivery,Zelfde dag bezorgd
Same day title,Zelfde dag titel
Morning delivery active,Ochtendlevering ingeschakeld
If age check is active then the evening delivery is not possible,Als de leeftijdscontrole actief is dan is avondbezorging niet mogelijk
If age check is active then the morning delivery is not possible,Als de leeftijdscontrole actief is dan is ochtendbezorging niet mogelijk
Expand Down Expand Up @@ -222,12 +227,11 @@ If both have been selected this price will be added to the regular shipping pric
"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.","Om deze functie optimaal te gebruiken, stel je eerst het gewicht of volume in van jouw producten. Ongeacht deze instelling, zendingen zwaarder dan het hier opgegeven gewicht zullen niet als brievenbuspakket worden verzonden."
This will be added to the regular shipping price,Dit zal bij de normale verzendkosten worden opgeteld
Pickup at PostNL location,Ophalen bij een PostNL locatie
List,Lijst
Map,Kaart
Pickup active,Ophalen actief
Standard delivery Title,Standaard bezorg titel
Signature on receipt title,Handtekening voor ontvangst titel
Home address only title,Alleen huisadres titel
Hide sender title,Afzender verbergen titel
Morning title,Ochtendlevering titel
Evening title,Avondlevering titel
Mailbox title,Brievenbuspakje titel
Expand All @@ -243,14 +247,21 @@ You not have entered the correct API key. Go to the general settings in the back
Address details are not entered,Adresgegevens zijn niet ingevuld
The times will be visible when nothing is filled in,De tijden zullen zichtbaar zijn wanneer niets is ingevuld
"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.","Voer een bedrag in dat positief of negatief is. Wilt u bijvoorbeeld een korting geven voor het gebruik van deze functie of wilt u extra in rekening brengen voor deze leveringsoptie."
Discount,Korting
Most sustainable,Meest duurzaam
Free,Gratis
From,Vanaf
Pick up from,Ophalen vanaf
Pick up at a pick-up point,Ophalen bij een afhaalpunt
Opening hours,Openingstijden
Show more opening hours,Toon meer openingstijden
Show more locations,Toon meer locaties
Closed,Gesloten
Postcode,Postcode
Postal code,Postcode
House number,Huisnummer
City,Stad
Country,Land
Street,Straat
Again,Opnieuw
Postcode/city combination unknown,Postcode/plaats combinatie onbekend
Deliver as quickly as possible,Zo snel mogelijk bezorgen
Expand All @@ -272,6 +283,10 @@ Default,Standaard
No,Nee
Yes,Ja

{field} is required.,{field} is verplicht.
Address not found.,Dit adres is niet gevonden.
Postal code is invalid for the current country.,Postcode is niet geldig voor het gekozen land.

no_account_settings, Geen accountsettings gevonden. Klik op de importeer knop in het algemene configuratie scherm.
manage_drop_off_point, Beheer jouw standaard afleverpunt in de
location_page, locatiewijzer
Expand Down

0 comments on commit ae71d80

Please sign in to comment.