Thank you..
Printable View
Change line 19 to be:
This was tested so should solve the issue.Code:if (@sizeof($customer_orders)==0) {
thank you so much!! its work.
I need the tracking input fields shown in orders.php to remove spaces from the input before putting them into the db, on an older version of ty track I had this code in orders.php that would do the job.
I can't find or figure out a place to put a str_replace to do the job on the latest version.Code:// BEGIN TY TRACKER 1 - DEFINE VALUES ----------------------------------------------
$track_id1 = str_replace(" ", "", zen_db_prepare_input($_POST['track_id1']));
$track_id2 = str_replace(" ", "", zen_db_prepare_input($_POST['track_id2']));
$track_id3 = str_replace(" ", "", zen_db_prepare_input($_POST['track_id3']));
$track_id4 = str_replace(" ", "", zen_db_prepare_input($_POST['track_id4']));
$track_id5 = str_replace(" ", "", zen_db_prepare_input($_POST['track_id5']));
$track_id6 = str_replace(" ", "", zen_db_prepare_input($_POST['track_id6']));
$track_id7 = str_replace(" ", "", zen_db_prepare_input($_POST['track_id7']));
// END TY TRACKER 1 - DEFINE VALUES ------------------------------------------------------------------
I've found the similar code in edit_orders that uses an array and I've modified that to do what I need, but the orders.php code is different, any help greatly received.
Edit includes/functions/functions_osh_update.php
find
replace withCode:// Begin Ty Package Tracker
foreach($track_id as $id => $track) {
$osh_sql['track_id' . $id] = zen_db_input($track);
}
Code:// Begin Ty Package Tracker
foreach($track_id as $id => $track) {
$osh_sql['track_id' . $id] = str_replace(" ", "", zen_db_input($track));
}
I loaded this plug in in 1.5.7 and it appears the only error I keep getting is:
PHP Warning: Invalid argument supplied for foreach() in /****/****/public_html/****/includes/functions/functions_osh_update.php on line 206.
Can you supply a fix for this issue?
Thank You
1.5.7a
PHP 7.4
Attachment 19266
I have Package tracker running in 1.5.7a but I am getting a PHP error stating:
PHP Warning: Invalid argument supplied for foreach() in /home2/***/public_html/ZC157/includes/functions/functions_osh_update.php on line 206.
While there were a few other issues that were easy to resolve in functions_osh_update it appears to be this portion of code below causing the issue:
Will the edit to trackid below resolve this error:Code:// Begin Ty Package Tracker
foreach($track_id as $id => $track) {
$osh_sql['track_id' . $id] = zen_db_input($track);
}
Thank You for any assistance it is greatly appreciatedCode:// Begin Ty Package Tracker
foreach('track_id' as $id => $track) {
$osh_sql['track_id' . $id] = str_replace(" ", "", zen_db_input($track));
}
That edit broke the entire web site and caused the below error:
[code]
[04-Nov-2020 19:41:01 UTC] PHP Parse error: syntax error, unexpected 'foreach' (T_FOREACH) in /home2/***/public_html/ZC157/includes/functions/functions_osh_update.php on line 207
[04-Nov-2020 19:41:01 UTC] Request URI: /ZC157/***/index.php?cmd=login, IP address: ***
--> PHP Parse error: syntax error, unexpected 'foreach' (T_FOREACH) in /home2/***/public_html/ZC157/includes/functions/functions_osh_update.php on line 207.
Missing a right-paren:
Code:// Begin Ty Package Tracker
if (is_array($track_id)) {
foreach($track_id as $id => $track) {
$osh_sql['track_id' . $id] = zen_db_input($track);
}
}