Skip to content
Advertisement

Woocommerce fee not multiplying on multiple cart items?

This script is adding a fee if the product is in a particular category.
The script is working but only for one cart item.
But if there are 2 or more items it wil not multiply in the cart.
What am I doing wrong?

JavaScript

Advertisement

Answer

I think you missing basic summation in foreach. you override $iphone_fee_amount and $ipad_fee_amount you have to append each value to that variable. check the code below.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement