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

fix: remove weight from large format option #877

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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: 0 additions & 1 deletion Model/Sales/Repository/PackageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand Down
17 changes: 2 additions & 15 deletions Model/Source/DefaultOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
}

/**
Expand Down
2 changes: 0 additions & 2 deletions Model/Source/LargeFormatOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public function toOptionArray()
{
return [
['value' => 'price', 'label' => __('Price')],
['value' => 'weight', 'label' => __('Weight')],
['value' => '0', 'label' => __('No')]
];
}
Expand All @@ -49,7 +48,6 @@ public function toArray()
{
return [
'price' => __('Price'),
'weight' => __('Weight'),
'0' => __('No')
];
}
Expand Down
4 changes: 2 additions & 2 deletions i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions i18n/fr_FR.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions i18n/nl_NL.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down