WPprodigy / woocommerce-product-fees

Add additional fees at checkout based on products that are in the cart.
https://wordpress.org/plugins/woocommerce-product-fees/
Other
26 stars 19 forks source link

Glitch with multiple products in cart that have special fees #26

Closed anix1 closed 7 years ago

anix1 commented 7 years ago

I am testing two items and each have a $1 per unit fee and the identical fee name. When I add one to the cart, the fees display correctly. When I add the second, there are no additional fees added for that item. When I delete the first item, the fees for the second item will then appear.

For example: I add 2 units of Product A to my cart. Product A has a quantity of 2 and it displays the special product fee of $2.00.

I add 1 unit of Product B to my cart. The special product fee is $2.00, not $3.00.

I remove the 2 units of Product A from my cart. The special product fee is $1.00.

I can add the products in reverse order, and the fees will be correct for the first item, but never for the addition of the second item. The fees for the first item will always be the amount listed, not a total of the first and second items.

anix1 commented 7 years ago

I noticed that my fee names were slightly different for each product. One was in all uppercase and the other in Upper Lower. Note, only one fee was listed where if the fee name is case sensitive, then it should have displayed twice as I would think they should have been considered separate fees. Now with the fee names being identical, the fees are adding properly. Not sure if you still consider this a glitch with the difference in uppercase vs upper/lower case names.

WPprodigy commented 7 years ago

Ahh, I see the issue. Need to convert to all lowercase when checking if the fees are identical or not. Will patch in the next release, thanks!