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)
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)
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
As created by the class, yes - but by the time it gets to eo_update_database_order_totals, the array entries have been changed. See screenshot.
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
Aside: sorry, that suggested code didn't come out quite right - I was thinking a LIKE with all strings concatenated with % between strings (and before and after).
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
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:
to sanitize that value on entry.Code:switch ($action) { case 'update_order': $this->shipping_tax_rate = $_POST['shipping_tax']; $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; }
See this GitHub issue for follow-on: https://github.com/lat9/edit_orders/issues/157
Last edited by lat9; 22 Jun 2020 at 12:38 PM. Reason: Referrence GitHub issue
As an alternative, you could not do the update when the value is null. But I'm ok with either solution. Thanks!
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
Bookmarks