Closed lat9 closed 4 months ago
While not a correction, I'll note that v4.7.0 of EO will no longer include that zen_get_tax_rate_from_desc
function as it's now available for use in the admin.
Having (now) traced that log back, it appears that that function is the victim, having been passed invalid data from
zen_get_tax_rate_from_desc() called at [/path/includes/modules/order_total/ot_quantity_discount.php:369]
As reported on the Zen Cart forum's support thread by Dave224: I'm getting an undefined array key 'tax_rate' error when editing orders with no tax. The myDEBUG log is:
No errors occur if tax>0. I've found that edit orders changes the tax_groups array in the order class from '0.0000'=>'1' to 'Tax'=>'0.0'. Then when function zen_get_tax_rate_from_desc queries the tax_rate table, it can't find 'Tax' and the undefined array key warning occurs. 'Tax' is the value of TEXT_UNKNOWN_TAX_RATE in admin.
An obvious fix is to test whether the query finds a valid tax rate in zen_get_tax_rate_from_desc, but I'm not sure that's the best solution. Any suggested fixes would be appreciated.
zc1.5.7c, edit orders 4.6.2, php 8.0.2. Line numbers in the log may differ slightly from out-of-the-box code due to troubleshooting code. Testing done on development system.