verbb / postie

A Craft Commerce shipping calculator plugin.
Other
12 stars 18 forks source link

UPS Sure Post rating does not work #28

Closed Mosnar closed 4 years ago

Mosnar commented 4 years ago

Description

I can't tell you how many hours I've sunk trying to figure this out, but I've finally got it.

Currently, if you try to use Sure Post to get shipping rates, it will not work. It turns out you can't "shop" Sure Post rates, you have to request that specific service.

So right now, you're calling:

$rates = $this->_client->shopRates($shipment);

which comes back with only the standard rates; however, in order to use Sure Post, you need to use:

            $service = new \Ups\Entity\Service;
            $service->setCode(\Ups\Entity\Service::S_SURE_POST);
            $service->setDescription($service->getName());
            $shipment->setService($service);

            $rate = $this->_client->getRate($shipment);

If you need help with this, I have access to a SurePost enabled UPS account and can be reached on discord.

Additional info

engram-design commented 4 years ago

I'm not familiar with Sure Post, but sounds like it needs a special case when in use. I'll catch up with you on Discord

engram-design commented 4 years ago

@Mosnar What's your Discord handle?