lat9 / edit_orders

Edit Orders: Updates for continued operation on Zen Cart v1.5.8 and later
GNU General Public License v2.0
5 stars 9 forks source link

fixes warnings when POST is empty or non-numeric #166

Closed proseLA closed 3 years ago

proseLA commented 3 years ago

take an order with tax where the store charges tax on the shipping cost. the store admin goes in to edit the order and wants to remove the shipping cost from the order. if the admin just deletes the shipping cost and leaves it as blank, you will generate warnings for non-numeric calculations when it comes to calculate tax. this fix addresses that situation.

lat9 commented 3 years ago

... or, even better, use floatval instead of a direct (float) cast.

proseLA commented 3 years ago

Apologies for the late response; I just noticed this one.

no worries. i still :heart: you.

The use of a (float) cast on currency values is something that I've (hopefully) worked out of the remaining EO calculations, as that can lead to those stinking penny-off calculations.

i am a big fan of numbers adding up. and you did a :+1: job on it!

i changed it to floatval as recommended. totally works for me!

best.