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

Paracel machine to paracel machine. #3

Open
SocialMediaStar opened this issue Jul 7, 2019 · 4 comments
Open

Paracel machine to paracel machine. #3

SocialMediaStar opened this issue Jul 7, 2019 · 4 comments

Comments

@SocialMediaStar
Copy link

Hi,
I checked ur code there is way to send receiver paracel machine but can't send out paracel machine pack?

@aur1mas
Copy link
Contributor

aur1mas commented Jul 9, 2019

hi @SocialMediaStar

Could you clarify what you want to achieve, because I think I didn't understand you correctly?

@SafeShipper
Copy link

Will be nice if there is a feature sender is postoffice/terminal.
Like now receiver...

if ($shipment->getReceiver()->isTypeTerminal()) {
    $terminal = $shipment->getReceiver()->getTerminal();

    $pickupPoint = new PickupPoint($terminal->getIdentifier());
    $pickupPoint->setType($terminal->isPostOffice() ? PickupPoint::TYPE_POST_OFFICE : PickupPoint::TYPE_TERMINAL);

    $receiver->setPickupPoint($pickupPoint);

    if ($shipment->getReceiver()->getPhone()) {
        $omnivaParcel->addService(Service::SMS());
    }

    if ($shipment->getReceiver()->getEmail()) {
        $omnivaParcel->addService(Service::EMAIL());
    }
} else {
    $receiver
        ->setCity($shipment->getReceiver()->getCity())
        ->setStreet($shipment->getReceiver()->getStreet())
        ->setPostCode($shipment->getReceiver()->getPostalCode())
    ;
}

@SafeShipper
Copy link

As i understand right...

Now it works like that:
Sender => Courier
Receiver => Courier or Parcel terminal or Post office

But will be nice if can set also sender
Courier or Parcel terminal or Post office

@aur1mas
Copy link
Contributor

aur1mas commented Sep 5, 2020

@SafeShipper you're correct. Currently, you can configure shipment to be sent from Courier to Door, Parcel terminal or Post Office.

Although, it's quite easy to make changes add an ability sender to be terminal.

Code API won't change, you only need to modify Client.php & add PickupPoint check. Also, double-check what parameters should be added (Omniva API documentation).

Pull Requests are welcome. Feel free to make one ;)

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

3 participants