Sorry, 156c. Product Pricing - tested manual and auto, both had the same issue. OK I will dig in on my side.
Sorry, 156c. Product Pricing - tested manual and auto, both had the same issue. OK I will dig in on my side.
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.
Investigating ...
admin/includes/functions/extra_functions/edit_orders_functions.php lines 1429-1445 you are referencing $order->totals[$i]['class'].
This should be $order->totals[$i]['code'] shouldn't it?
(lines are same between EO 4.5.0 and 4.5.1)
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.
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.
The root cause of the deleted tax line is in the block that handles the "rogue" ot_tax value.
(Around 1449 of ./includes/functions/extra_functions/edit_orders_functions.php).
My tax title is Sales tax (if any) + Shipping Tax (0.0000%) + Tax:
which does not work for the clause
`title` NOT IN ($tax_groups)
Perhaps a LIKE would be better - something like
Code:foreach ($tax_groups as &$tax_group) { $tax_group = '%' . $db->prepareInput($tax_group) .'%'. ':'; } $tax_groups = "'" . implode("', '", $tax_groups) . "'"; ... $query = "DELETE FROM " . TABLE_ORDERS_TOTAL . " WHERE orders_id = $oID AND `class` = 'ot_tax' AND `title` NOT IN ("; for ($i = 0; $i < count($tax_groups); $i++) { if ($i > 0) $query .= ","; $query .= $tax_groups[$i]; } $query .= ")";
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.
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.
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.