verbb / postie

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

Free shipping line items are still included when fetching rates. #104

Closed zollf closed 10 months ago

zollf commented 1 year ago

Describe the bug

We want to set up free shipping discount on a product category, however Postie does not take line item with free shipping into account. Digging into it more even when I toggle free shipping on a product, postie will still fetch rates.

image image

Our use case is to have a free shipping discount on certain line items, which is supported by commerce and their discount system.

Looking at the plugin code, when packing box maybe ignore line items that have free shipping.

This is what Commerce have done when they get prices for an order:

https://github.com/craftcms/commerce/blob/fc08a7be4bd723fbdc37f1f248b87bfd8a172605/src/base/ShippingMethod.php#L177-L178

The indented outcome is for free shipping line items to not be accounted for in shipping estimation. This would include free shipping discounts on specific line items.

Steps to reproduce

  1. Enable and configure any shipping provider
  2. Create product type and a product with configurations so that Postie can normally fetch shipping rates on it
  3. Set that product to have free shipping
  4. Check the order and you'll see the order still have shipping

Craft CMS version

3.8.14

Plugin version

2.4.22

Multi-site?

No

Additional context

PHP Version: 7.4.30 OS version: Linux 5.10.124-linuxkit Craft Commerce: 3.4.22.1

engram-design commented 1 year ago

Fixed for the next release. To get this early, run composer require verbb/postie:"dev-craft-3 as 2.4.22".

engram-design commented 10 months ago

Fixed in 2.4.23