Skip to content

Do not suggest PackStation as service point #71

@robinero

Description

@robinero

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions