verbb / postie

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

Handle estimated shipping addresses #74

Closed stuart-haas closed 2 years ago

stuart-haas commented 2 years ago

What are you trying to do?

Add condition to allow estimated shipping addresses for unauthenticated users.

What's your proposed solution?

I had to copy the plugin into the project so it's under our source control now.

Here's the change I'm proposing in base/Provider.php on line 394.

        if (!$order->shippingAddress && !$order->estimatedShippingAddress) {
            Provider::log($this, 'No shipping address for order.');

            return;
        }

Additional context

Currently if you try to provide an estimateShippingAddress in the update-cart action these errors will be logged in postie.log.

[-][-][-][info][postie] UPS: No line items for order.
[-][-][-][info][postie] UPS: No line items for order.
[-][-][-][info][postie] UPS: No shipping address for order.
[-][-][-][info][postie] UPS: No shipping address for order.
[-][-][-][info][application] $_GET = []

$_POST = [
    'action' => 'commerce/cart/update-cart'
    'purchasableId' => '59548'
    'qty' => '10'
    'estimatedShippingAddress' => [
        'zipCode' => 'redacted'
    ]
]
engram-design commented 2 years ago

Fixed for the next release. To get the fix early, change your verbb/postie requirement in composer.json to:

"require": {
  "verbb/postie": "dev-craft-3 as 2.4.8",
  "...": "..."
}

Then run composer update.

joshparylak commented 2 years ago

@engram-design Do you have an idea when the next release is? We'd like to get back on the stable release track when we can.

engram-design commented 2 years ago

Was still awaiting some feedback from other support tickets, but tagged a 2.4.9 release