Related to #64.
Prerequisites:
When a customer enters their shipping address, a PackStation can be automatically selected as the shipping destination. However, it's not always clear whether the suggested PackStation requires a post number, which can cause issues for the shipping party.
The following code is responsible for selecting the closest service point:
|
public function getClosest($postalcode, $country) |
|
{ |
|
$servicePoints = $this->search($postalcode, $country, 13); |
|
|
|
if (!is_array($servicePoints)) { |
|
return false; |
|
} |
|
|
|
foreach ($servicePoints as $servicePoint) { |
|
if ($servicePoint->shopType !== 'packStation' || $servicePoint->country !== 'DE') { |
|
return $servicePoint; |
|
} |
|
} |
|
return false; |
|
} |
Wouldn't it be better to either exclude all PackStations or modify the if statement to verify whether the shipping address country is in a list of allowed PackStation countries that don't require a post number?
Related to #64.
Prerequisites:
When a customer enters their shipping address, a PackStation can be automatically selected as the shipping destination. However, it's not always clear whether the suggested PackStation requires a post number, which can cause issues for the shipping party.
The following code is responsible for selecting the closest service point:
plugin-magento2-release/Model/Service/ServicePoint.php
Lines 59 to 73 in d929411
Wouldn't it be better to either exclude all PackStations or modify the if statement to verify whether the shipping address country is in a list of allowed PackStation countries that don't require a post number?