Closed johnj24 closed 10 months ago
Hi, Josh. Any updates on this even if it's just to say you're aware of the issue and exploring fixes? Or do you think this is a template/settings issue on my end?
Possibly related to https://github.com/verbb/postie/issues/104 with regards to products marked as "Free Shipping", they should be getting excluded from being sent to providers.
To get this early, run composer require verbb/postie:"dev-craft-4 as 3.0.3"
.
After updating to dev-craft-4
the Free Shipping items still show the same errors.
Our physical items with weight/size now show this error:
Error: Class "verbb\postie\services\PostieHelper" not found in /.../vendor/verbb/postie/src/services/Service.php:213
Stack trace:
#0 /.../vendor/verbb/postie/src/services/Service.php(154): verbb\postie\services\Service->applyFreeShipping(Object(craft\commerce\elements\Order))
#1 /.../vendor/verbb/postie/src/services/Service.php(181): verbb\postie\services\Service->getShippingMethodsForOrder(Object(craft\commerce\elements\Order))
#2 [internal function]: verbb\postie\services\Service->registerShippingMethods(Object(craft\commerce\events\RegisterAvailableShippingMethodsEvent))
#3 /.../vendor/yiisoft/yii2/base/Event.php(312): call_user_func(Array, Object(craft\commerce\events\RegisterAvailableShippingMethodsEvent))
#4 /.../vendor/yiisoft/yii2/base/Component.php(642): yii\base\Event::trigger('craft\\commerce\\...', 'registerAvailab...', Object(craft\commerce\events\RegisterAvailableShippingMethodsEvent))
#5 /.../vendor/craftcms/commerce/src/services/ShippingMethods.php(119): yii\base\Component->trigger('registerAvailab...', Object(craft\commerce\events\RegisterAvailableShippingMethodsEvent))
#6 /.../vendor/craftcms/commerce/src/elements/Order.php(1959): craft\commerce\services\ShippingMethods->getMatchingShippingMethods(Object(craft\commerce\elements\Order))
#7 /.../vendor/craftcms/commerce/src/elements/Order.php(1932): craft\commerce\elements\Order->getAvailableShippingMethodOptions()
#8 /.../vendor/craftcms/commerce/src/elements/Order.php(2014): craft\commerce\elements\Order->recalculate()
#9 /.../vendor/craftcms/cms/src/services/Elements.php(3166): craft\commerce\elements\Order->afterSave(false)
#10 /.../vendor/craftcms/cms/src/services/Elements.php(1063): craft\services\Elements->_saveElementInternal(Object(craft\commerce\elements\Order), false, false, true, Array, false)
#11 /.../vendor/craftcms/commerce/src/controllers/CartController.php(461): craft\services\Elements->saveElement(Object(craft\commerce\elements\Order), false, false, true)
#12 /.../vendor/craftcms/commerce/src/controllers/CartController.php(277): craft\commerce\controllers\CartController->_returnCart()
#13 [internal function]: craft\commerce\controllers\CartController->actionUpdateCart()
#14 /.../vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#15 /.../vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#16 /.../vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('update-cart', Array)
#17 /.../vendor/craftcms/cms/src/web/Application.php(304): yii\base\Module->runAction('commerce/cart/u...', Array)
#18 /.../vendor/craftcms/cms/src/web/Application.php(607): craft\web\Application->runAction('commerce/cart/u...', Array)
#19 /.../vendor/craftcms/cms/src/web/Application.php(283): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#20 /.../vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#21 /.../public/index.php(21): yii\base\Application->run()
#22 {main}
Just pushed a fix for that error (just run composer require ...
again). As for the error, that's actually expected behaviour if all you have in your cart are non-shippable products. The USPS API is essentially saying you need to have packages in your rate request, and because you don't have any shippable products to add to packages, it's an invalid call.
This shouldn't actually return an error unless you have the debugging settings set to show errors?
I thought I may have had debugging on, but I checked the config and it's not.
'hasCpSection' => true,
'applyFreeShipping' => true,
'displayDebug' => false,
'providers' => [
'usps' => [
'name' => 'USPS',
'enabled' => true,
'settings' => [
'username' => 'XXXXXXXXXX',
],
// Mark-Up
'markUpRate' => '0.50',
'markUpBase' => 'value',
// Units
'weightUnit' => 'lb',
'dimensionUnit' => 'in',
// Packing method
'packingMethod' => 'boxPacking',
],
],
With displayDebug
set to true
I now get this error when adding just a PDF to the cart:
"USPS: Domestic rate service call"
I just wanted to confirm your comment but now each time you enter an address the next screen you see is full of errors
you shouldn’t see any errors, it should just return no available shipping methods and log this error to your postie.log file.
are you seeing something different?
This is the screen I see after addresses are entered:
So that seems like a Craft::dd()
call in PHP, or a {% dd %}
call in Twig, which certainly isn't what I'm seeing. Is there any chance you've added that on your end for debugging? I can't tell from the stack trace exactly where it's coming from. It might show in your storage/logs/*.log
files though.
Well, I poked around config files and ended up adding 'displayErrors' => false
to postie.php
and that -- at least for now -- has removed the error screen from what I can tell. I'm able to get all the way to the payment page uninterrupted now.
So by default, that should be set to false
anyway, but yes - that will show errors from providers.
That's what I thought too, which is why I left it out of the original config settings. I guess maybe not?
Very strange, as the default is certainly false
Describe the bug
Hello. We have a digital product type where no sizing or weights are available. We have Free Shipping enabled on this product type. We were selling digital pdf's just fine a few months ago, but now each time you enter an address the next screen you see is full of errors. No site updates were made in the past two months so my only guess is USPS made changes on their end that is now effecting us. I did update Postie, Commerce, and CraftCMS today to see if that would fix our issues, but it did not.
I've pasted the errors below:
Steps to reproduce
Craft CMS version
4.4.15
Plugin version
3.0.3
Multi-site?
No
Additional context
No response