From 7d953fb3a20d22635a7f7aa6a669d3cf8ed883ea Mon Sep 17 00:00:00 2001 From: Joeri van Veen Date: Tue, 17 Dec 2024 17:53:12 +0100 Subject: [PATCH] fix: remove weight from large format option INT-755 --- Model/Sales/Repository/PackageRepository.php | 1 - Model/Source/DefaultOptions.php | 17 ++--------------- Model/Source/LargeFormatOptions.php | 2 -- i18n/en_US.csv | 4 ++-- i18n/fr_FR.csv | 4 ++-- i18n/nl_NL.csv | 4 ++-- 6 files changed, 8 insertions(+), 24 deletions(-) diff --git a/Model/Sales/Repository/PackageRepository.php b/Model/Sales/Repository/PackageRepository.php index ee2e0a53..f9f7b65f 100755 --- a/Model/Sales/Repository/PackageRepository.php +++ b/Model/Sales/Repository/PackageRepository.php @@ -30,7 +30,6 @@ class PackageRepository extends Package public const DEFAULT_MAXIMUM_MAILBOX_WEIGHT = 2000; public const MAXIMUM_DIGITAL_STAMP_WEIGHT = 2000; public const MAXIMUM_PACKAGE_SMALL_WEIGHT = 2000; - public const DEFAULT_LARGE_FORMAT_WEIGHT = 23000; public const CARRIER_TYPE_CUSTOM = 'custom'; /** diff --git a/Model/Source/DefaultOptions.php b/Model/Source/DefaultOptions.php index cb95e025..21ece199 100755 --- a/Model/Source/DefaultOptions.php +++ b/Model/Source/DefaultOptions.php @@ -137,26 +137,13 @@ public function getMaxCompanyName(?string $company): ?string public function hasDefaultLargeFormat(string $carrier, string $option): bool { $price = $this->order->getGrandTotal(); - $weight = $this->helper->convertToGrams($this->order->getWeight()); $settings = $this->helper->getStandardConfig($carrier, 'default_options'); $activeKey = "{$option}_active"; - if (isset($settings[$activeKey]) && - 'weight' === $settings[$activeKey] && - $weight >= PackageRepository::DEFAULT_LARGE_FORMAT_WEIGHT - ) { - return true; - } - - if (isset($settings[$activeKey]) && + return isset($settings[$activeKey]) && 'price' === $settings[$activeKey] && - $price >= $settings["{$option}_from_price"] - ) { - return true; - } - - return false; + $price >= $settings["{$option}_from_price"]; } /** diff --git a/Model/Source/LargeFormatOptions.php b/Model/Source/LargeFormatOptions.php index 65a6d235..c0bb80c4 100755 --- a/Model/Source/LargeFormatOptions.php +++ b/Model/Source/LargeFormatOptions.php @@ -35,7 +35,6 @@ public function toOptionArray() { return [ ['value' => 'price', 'label' => __('Price')], - ['value' => 'weight', 'label' => __('Weight')], ['value' => '0', 'label' => __('No')] ]; } @@ -49,7 +48,6 @@ public function toArray() { return [ 'price' => __('Price'), - 'weight' => __('Weight'), '0' => __('No') ]; } diff --git a/i18n/en_US.csv b/i18n/en_US.csv index cece314f..48b5a516 100755 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -58,8 +58,8 @@ location_page, location manager package_small, Small package show_total_price, Show total price show_surcharge_price, Show surcharge -Automate 'Large format',Automate 'Larger than 100 x 70 x 58 cm or heavier than 23 kg' -Large package,Larger than 100 x 70 x 58 cm or heavier than 23 kg +Automate 'Large format',Automate 'Larger than 100 x 70 x 58 cm' +Large package,Larger than 100 x 70 x 58 cm delivery_title, Delivery Options standard_title, Standard Delivery diff --git a/i18n/fr_FR.csv b/i18n/fr_FR.csv index a3080b5b..a45afbac 100644 --- a/i18n/fr_FR.csv +++ b/i18n/fr_FR.csv @@ -211,8 +211,8 @@ Thursday,Jeudi Friday,Vendredi Saturday,Samedi Sunday,Dimanche -Automate 'Large format',Automatiser "Plus grand que 100 x 70 x 58 cm ou plus lourd que 23 kg" -Large package,Plus grand que 100 x 70 x 58 cm ou plus lourd que 23 kg +Automate 'Large format',Automatiser "Plus grand que 100 x 70 x 58 cm" +Large package,Plus grand que 100 x 70 x 58 cm Delivery fee,Frais de livraison {field} is required.,{field} est requis. diff --git a/i18n/nl_NL.csv b/i18n/nl_NL.csv index 6112ef9f..ab0fb5a9 100755 --- a/i18n/nl_NL.csv +++ b/i18n/nl_NL.csv @@ -93,8 +93,8 @@ Automate 'Collect package',Automatiseer 'Pakket laten ophalen' Automate 'Receipt code',Automatiseer 'Ontvangstcode' Automate 'Home address only',Automatiseer 'Alleen huisadres' Automate 'Return if no answer',Automatiseer 'Retour bij geen gehoor' -Automate 'Large format',Automatiseer 'Groter dan 100 x 70 x 58 cm of zwaarder dan 23 kg' -Large package,Groter dan 100 x 70 x 58 cm of zwaarder dan 23 kg +Automate 'Large format',Automatiseer 'Groter dan 100 x 70 x 58 cm' +Large package,Groter dan 100 x 70 x 58 cm Automate 'Age check 18+',Automatiseer 'Leeftijdscontrole 18+' Automate 'Insurance € 100',Automatiseer 'Verzekerd tot €100' Automate 'Insurance € 250',Automatiseer 'Verzekerd tot €250'