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

Do not suggest PackStation as service point #71

Open
robinero opened this issue Aug 15, 2024 · 0 comments
Open

Do not suggest PackStation as service point #71

robinero opened this issue Aug 15, 2024 · 0 comments

Comments

@robinero
Copy link

Related to #64.

Prerequisites:

  • ServicePoints enabled

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant