verbb / postie

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

Shipping costs not being added to the cart totals #72

Closed ax2000 closed 3 years ago

ax2000 commented 3 years ago

Hi Josh,

After fixing #69, I've come up with another different issue that doesn't appear to be related to that.

The shipping options appear correctly now, but once I select one of the options available, it seems to get added to the cart correctly (["shippingMethodHandle"]=> string(18) "AUS_PARCEL_EXPRESS") BUT the Shipping costs don't get added to the cart shipping nor to the cart total (["storedTotalShippingCost"]=> string(6) "0.0000").

If I select a native Commerce Shipping Method, the shipping costs get added to the cart as expected, which made me think that I might have missed something with Postie or maybe the latest Commerce updates broke something.

Please see below screenshot as reference:

Screen Shot 2021-07-21 at 17 13 02

I just updated to craft commerce dev branch as per #70 so not sure if it would have something to do with that?

Steps to reproduce

  1. Select shipping method
  2. Check cart and shipping costs don't appear under Shipping

Additional info

engram-design commented 3 years ago

I'm almost certain a Commerce update has broken this, as I can't get {{ cart.shippingMethod.name }} to work anymore either. I've been trying to get in touch with Luke today, but will file a formal GH issue shortly.

I believe this is because a change in behaviour from Commerce 3.3.x to 3.4.x where the shipping methods are only fetching the saved ones created through Commerce, not plugin-provided ones like Postie, or through your own modules.

engram-design commented 3 years ago

Should be fixed in Commerce 3.4.0.3 https://github.com/craftcms/commerce/issues/2279

angieherrera commented 1 year ago

Hey! I might just be missing something, but I'm running into this exact issue with Craft 4.3.0, Commerce 4.1.3, and Postie 3.0.1. Let me know if I should post to Craft's GH instead.

engram-design commented 1 year ago

I can't seem, to replicate that I'm afraid (the price applying). Selecting a shipping option saves the value to the order for me.

screencapture-commerce4-test-shop-checkout-shipping-2022-10-29-16_15_17

screencapture-commerce4-test-shop-checkout-payment-method-2022-10-29-16_15_31

However, what's interesting is that on the payment page its not showing which service was picked. This is because cart.shippingMethod is null. Despite cart.shippingMethodName being the correct value of Australia Post Parcel Post, so something is clearly an issue here - likely with Commerce again.

But the amount is certainly being applied to the order, and is there once paid.

angieherrera commented 1 year ago

Strange - neither are working for me using the Commerce example templates. I'll get in touch with Craft. Thanks for taking a look!