craftcms / commerce

Fully integrated ecommerce for Craft CMS.
https://craftcms.com/commerce
Other
226 stars 170 forks source link

Free shipping discount code doesn't take "maximum shipping cost" into account #699

Closed echantigny closed 5 years ago

echantigny commented 5 years ago

Description

When you setup a shipping method and price it "Per Item", and set a maximum a user will pay, a "Free shipping" discount code on a per item basis will discount the full amount, not the set maximum.

Steps to reproduce

  1. Create a shipping rule that costs Per Item Rate of 10$ and a Maximum Total Shipping Cost of 10$
  2. Create a Discount Code that doesn't have any conditions other than the "Set shipping costs to zero for matching products" checked
  3. Add 3 items to your cart. You should see a total shipping charge of 30$, a adjustment for maximum of -20$ and then, a Discount code for 30$.

2019-02-08 13_09_26-shopping cart great boardgames

Additional info

lukeholder commented 5 years ago

This should now be been fixed in 1c2ab411480ca1c3edda2521bc65b4f00bf9671e and 2cc02e9c43fc19e7a45bedd723120d1304c418bc. Coming in the next release.

This adds a whole order free shipping setting on discounts and also improves the logic for free shipping items and a max shipping rate.