Administrator
- Join Date:
- Sep 2009
- Location:
- Stuart, FL
- Posts:
- 14,068
- Plugin Contributions:
- 56
Edit Orders v4.0 Support Thread
swguy:
admin/includes/classes/editOrders.php lines 270, 274: should $this->shipping_tax_rate be cast as a float in case it's null?
(Getting SQL error on line 270)
It's taken a long time to get all those other float-casts out of EO (trying to get rid of those penny-off calculations), but I'll update this section of the class' *initializeOrderShippingTax *method:
switch ($action) {
case 'update_order':
[B]$this->shipping_tax_rate = $_POST['shipping_tax'];[/B]
$order->info['shipping_tax'] = $this->calculateOrderShippingTax(true);
break;
case 'add_prdct':
$this->shipping_tax_rate = $tax_rate->fields['shipping_tax_rate'];
$order->info['shipping_tax'] = $this->eoRoundCurrencyValue(zen_calculate_tax($order->info['shipping_cost'], $this->shipping_tax_rate));
break;
default:
$this->shipping_tax_rate = $tax_rate->fields['shipping_tax_rate'];
$order->info['shipping_tax'] = $this->calculateOrderShippingTax(false);
break;
}
to sanitize that value on entry.
See this GitHub issue for follow-on: https://github.com/lat9/edit_orders/issues/157