FREE Addon: Order History

[quote name='quicksilver1024' timestamp='1346733582' post='144238']Thanks, solesurvivor for creating this! This seems like a very useful add-on and I'll be installing it to my store. Thanks again![/quote]



Your welcome! Hope it works well for you.

I have the notice warnings turned on in my PHP. This must be why trying to run this add-on I get the error:





Notice: Use of undefined constant _status_history_group - assumed '_status_history_group' in /home/xxxxxxxxxxx/public_html/store/addons/order_history/func.php on line 7



Notice: Use of undefined constant _status_history - assumed '_status_history' in /home/xxxxxxxxxxx/public_html/store/addons/order_history/func.php on line 7





Line 7 in func.php is:

$entries = db_get_array("SELECT os.*,d.description as group_description,e.description as status_description FROM ?:order_status_history as os LEFT JOIN ?:common_descriptions as d ON d.object_id = os.group_id and d.object_holder like ?l LEFT JOIN ?:common_descriptions as e ON e.object_id = os.status_id and e.object_holder like ?l WHERE os.order_id = ?i", "%" . _status_history_group . "%","%" . _status_history . "%",$order_id);







Most online threads on this error say this Notice error is shown because of either a missing $ in a variable or missing quotes.

PHP is forgiving on this and will figure out what is meant, but it wastes extra processes.



Can anyone see what might be missing in the line above I'm getting this notice on?

I really like the mod and it is working, but it is just giving me the notice 'Use of undefined constant'.

[quote name='Tim Hensel' timestamp='1346764930' post='144280']

I have the notice warnings turned on in my PHP. This must be why trying to run this add-on I get the error:





Notice: Use of undefined constant _status_history_group - assumed '_status_history_group' in /home/xxxxxxxxxxx/public_html/store/addons/order_history/func.php on line 7



Notice: Use of undefined constant _status_history - assumed '_status_history' in /home/xxxxxxxxxxx/public_html/store/addons/order_history/func.php on line 7





Line 7 in func.php is:

$entries = db_get_array("SELECT os.*,d.description as group_description,e.description as status_description FROM ?:order_status_history as os LEFT JOIN ?:common_descriptions as d ON d.object_id = os.group_id and d.object_holder like ?l LEFT JOIN ?:common_descriptions as e ON e.object_id = os.status_id and e.object_holder like ?l WHERE os.order_id = ?i", "%" . _status_history_group . "%","%" . _status_history . "%",$order_id);







Most online threads on this error say this Notice error is shown because of either a missing $ in a variable or missing quotes.

PHP is forgiving on this and will figure out what is meant, but it wastes extra processes.



Can anyone see what might be missing in the line above I'm getting this notice on?

I really like the mod and it is working, but it is just giving me the notice 'Use of undefined constant'.

[/quote]



I don't understand fully how Cs-Cart handles like conditions but maybe changing it to:



$entries = db_get_array("SELECT os.*,d.description as group_description,e.description as status_description FROM ?:order_status_history as os LEFT JOIN ?:common_descriptions as d ON d.object_id = os.group_id and d.object_holder like ?l LEFT JOIN ?:common_descriptions as e ON e.object_id = os.status_id and e.object_holder like ?l WHERE os.order_id = ?i", "%_status_history_group%,"%_status_history%",$order_id);




Let me know if that fixes the problem.

[quote name=‘solesurvivor’ timestamp=‘1346767820’ post=‘144283’]

I don’t understand fully how Cs-Cart handles like conditions but maybe changing it to:


<br />
$entries = db_get_array("SELECT os.*,d.description as group_description,e.description as status_description FROM ?:order_status_history as os LEFT JOIN ?:common_descriptions as d ON d.object_id = os.group_id and d.object_holder like ?l LEFT JOIN ?:common_descriptions as e ON e.object_id = os.status_id  and e.object_holder like ?l WHERE os.order_id = ?i", "%_status_history_group%,"%_status_history%",$order_id);<br />

```<br />
<br />
Let me know if that fixes the problem.<br />
[/quote]<br />
<br />
Hi! Thanks for the help ... Unfortunately now it cuases this error to appear when I tried to install: <img src="upload://n4syhXZrRhsStKvmS4jT3Mp2S3k.png" class="bbc_emoticon" alt=":("><br />
<br />
[b]Parse error[/b][color=#000000]: syntax error, unexpected T_STRING in [/color][b]/home/jammaboa/public_html/store/addons/order_history/func.php[/b][color=#000000] on line [/color][b]22[/b]

Well darn. Maybe some else can chime in on this one?

Syntactically,

"%_status_history_group%

should be

“%_status_history_group%”

Whether this will give you the proper results from the query, I have no idea. But know that 'LIKE' operators require a full table scan and that indexes can't be used. So you automatically inject a performance issue.

Thank you tbirnseth!

That did fix the new error. It is now running okay, but there are now 4 more Notice: Use of undefined constant errors.



I tried then changing this code (where I was getting the 4 new errors) from:



if (is_numeric($entry[status_description]))
{
$status_description = $entry[status_description];
$status_substr = substr($status_description, -2);
$status_id = chr($status_substr);


$status_description = db_get_field("SELECT description FROM ?:status_descriptions WHERE type = ?s AND lang_code = ?s and status = ?s", 'O','EN', $status_id);
$entries[$counter][status_description] = $status_description;
}

$user_id = $entry[user_id];






To:



if (is_numeric($entry["status_description"]))
{
$status_description = $entry["status_description"];
$status_substr = substr($status_description, -2);
$status_id = chr($status_substr);


$status_description = db_get_field("SELECT description FROM ?:status_descriptions WHERE type = ?s AND lang_code = ?s and status = ?s", 'O','EN', $status_id);
$entries[$counter]["status_description"] = $status_description;
}

$user_id = $entry["user_id"];




You can see in the green color on [color=#008000]status_description[/color] and [color=#008000]user_id[/color] that I just added [color=#008000]" "[/color] around them.



Now, this made the Notice: Use of undefined constant errors go away … and it seems like it is working okay however I am not sure until I make an order change.



Making the change that I did, was this right?

I am just taking a guess at trying to fix it so I do not know if doing that was the right thing to do.





Also just to add my setup is (if this matters any):



Apache version 2.2.21

PHP version 5.2.17

MySQL version 5.1.63-cll





Thanks!

-T

Ugh … nevermind. It seems like it is working okay but still getting lots of this: :(







Notice: Use of undefined constant user_id - assumed ‘user_id’ in /home/xxxxxxxx/public_html/store/addons/order_history/func.php on line 31



Notice: Use of undefined constant firstname - assumed ‘firstname’ in /home/xxxxxxxx/public_html/store/addons/order_history/func.php on line 31



Notice: Use of undefined constant lastname - assumed ‘lastname’ in /home/xxxxxxxx/public_html/store/addons/order_history/func.php on line 31



Notice: Use of undefined constant user_login - assumed ‘user_login’ in /home/xxxxxxxx/public_html/store/addons/order_history/func.php on line 31

The array indexes need quotes (because they are strings). Without it, they are seen as constants.

Apparently the original author does not turn on error reporting/display_errors during development to ensure the code is clean.



Alternatively you can add an

ini_set('display_errors', false);

to the top of the code and then the notices will not be seen. But for correctness, the root-cause problem should be fixed.

good add on. Thanks

Sorry I posted something in the wrong thread.

I've used this addon since V2.2.4 and have been using the V3 build, too.



On a 3.0.6, I have found an issue which is caused by this addon. CS-Cart Support diagnosed the issue and found when this addon is disabled, the issue does not exist.



The issue exists on the “orders.details” dispatch, specifically on the order page, eg:


yourstore.com/index.php?dispatch=orders.details&order_id=1


If this page is set up to use 3 columns (Grid 3, Grid 7, Grid 3), the third column is displayed below the first column. The effect is the space for where the third column should be is blank.



Looking at the source code, the order details page should generate like this:

```php






```
However, it actually takes the third column and places it outwith the "container_16" class like so:
```php





```
Has anyone else on V3 used this add-on and found this problem?

Hello,



I have installed this addon, and it is cool stuf, but I have found small problem here, I have created my own statuses, and after changing status to my own this addont instead of showing staus name shows me product description…



Anyone knows how to fix it?

Hello



This is addon for version 4.0.

We significantly simplified this addon but we hope that will be useful.



Best regards

Robert Diak

order_history.tgz

[quote name='soft-solid' timestamp='1376552284' post='166855']

Hello



This is addon for version 4.0.

We significantly simplified this addon but we hope that will be useful.



Best regards

Robert Diak

[/quote]

I have used the “Order History” addon since v2 and have used it successfully between V2>V3 and now look to upgrade to V4. The database schema and values all look the same between my data in V2 and V3, yet on enabling your version of the addon, my Status History tab displays the dates correctly and the user who made the change but the status column is blank for every order.



I note the database schema is different in this V4 addon and is completely different to the original V2/V3 versions posted in this thread. The data is not updated to be compatible with this version of the addon so perhaps it would make sense to create a new thread for it.

hello, thanks for this useful addon but I cant download the file.It makes error.I dont understand why.

Can you upload again?

[quote name='ben_erhan' timestamp='1390607651' post='176006'] hello, thanks for this useful addon but I cant download the file.It makes error.I dont understand why. Can you upload again? [/quote]

I just downloaded it and worked fine. You may need to try a different browser.

[quote name='clips' timestamp='1390608358' post='176012'] I just downloaded it and worked fine. You may need to try a different browser. [/quote]



I have tried with 3 browsers chrome-explorer-yandex, but I couldnt download this addon.I have downloaded lots of files in this site but this addon wasnt be downloaded.



If you send the file, I will be happy.



thank you

I could download the file. Thank you friend

Using Firefox 26. Downloaded but cannot extract file. Get an error. I tried downloading 4 times the 1.1.2. I see the downloaded file only caontains a pdf page.



MsKitti