To my knowledge split orders works.. when I have time to test I will..
Printable View
has anyone else got this appearing in their log files?
its generated a huge amount of log files - 1000's per dayCode:[13-Aug-2015 21:13:57 UTC] PHP Warning: mysql_query(): Access denied for user ''@'localhost' (using password: NO) in /xxx/admin/orders.php on line 1217
[13-Aug-2015 21:13:57 UTC] PHP Warning: mysql_query(): A link to the server could not be established in /xxx/admin/orders.php on line 1217
[13-Aug-2015 21:13:57 UTC] PHP Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /xxx/admin/orders.php on line 1218
looked like the wrong SQL code was being used
so locate admin/orders.php line 1215-1222
and replace withCode:<!-- BOF added to get currency type and value for totals -->
<?php $dbc="select currency, currency_value from " . TABLE_ORDERS . " where orders_id ='" . $_GET['oID'] . "'";
$result = mysql_query($dbc);
$row = mysql_fetch_array ($result, MYSQL_NUM);
$cu = $row[0];
$cv = $row[1];
?>
<!-- EOF added to get currency type and value for totals -->
seems to be it didn't like $dbc instead of $dbCode:<!-- BOF added to get currency type and value for totals -->
<?php $db="select currency, currency_value from " . TABLE_ORDERS . " where orders_id ='" . $_GET['oID'] . "'";
$result = mysql_query($db);
$row = mysql_fetch_array ($result, MYSQL_NUM);
$cu = $row[0];
$cv = $row[1];
?>
<!-- EOF added to get currency type and value for totals -->
no idea if this is just mine of anyone elses :) but in case hope this helps
Thanks
Sarah
grr ignore still not liking it!!
It is the use of mysql_query that your server/version of php doesn't like.
It is something that will need to be rectified at some point in the super-orders code.
All this bit of code is doing is getting the currency for the order to display in the page under the order totals. As the store that I used it on is single currency all I did was comment out the query and set the values by hand like this:
As you can see mine is in British Pounds but you could make it what you wantCode:<!-- BOF added to get currency type and value for totals -->
<?php $dbc="select currency, currency_value from " . TABLE_ORDERS . " where orders_id ='" . $_GET['oID'] . "'";
//$result = mysql_query($dbc);
//$row = mysql_fetch_array ($result, MYSQL_NUM);
$cu = 'GBP';
$cv = 1;
?>
<!-- EOF added to get currency type and value for totals -->
If you wanted a more complete solution you will have to do something like:
I have just writen that off the top of my head and it is not tested.Code:<!-- BOF added to get currency type and value for totals -->
<?php $dbc="select currency, currency_value from " . TABLE_ORDERS . " where orders_id ='" . $_GET['oID'] . "'";
$result = $db->Execute($dbh);
$cu = $result->fields['currency'];
$cv = $result->fields['currency_value'];
?>
<!-- EOF added to get currency type and value for totals -->
Correct, it is not a good solution. First of all though, the details of 1. ZC version, 2. PHP version, and 3. SO version were not provided... More recent versons of these do not use mysql_ related functions. Renaming $dbc to $db replaces any use of the global $db value representing the database, so that is not a good thng to do/apply.
Verify that using the most recent version of Super Orders as action has been taken to remove this error...
Thanks Nick I have just hidden it - as like you its not really needed
as far as I am aware it is the latest version - but I will check though as it was certainly put on this year - but this isn't the first issue I am seeing with this super-order so maybe I did get a "odd" one
ZC1.5.4
and yes I was only trying DB and I could see that DBC was not used as well as the mysql_query was not used anywhere else either!
really frustrating - at least being hidden I avoid the logs files while I figure out whats gone wrong
thanks and yeah sorry premature posting and then I couldn't edit to add the real details back in!
@Sarah
Yes, check that you have the most recent version. Super Orders is a complex module and worth having the most recent anyway. But this does actually exist in the most recent version.
Hiding it is fine and won't cause any problems so it is a satisfactory solution for you.
Pretty sure that the second lot of code will work for anyone who runs a multi-currency site. But they could let us know.
And the updating of modules is constant work and done 100% voluntarily so this, I am sure, will get amended at some point but only when busy people find the time.
yes latest version :) I will leave hidden for now - thank you :)
The fix posted by niccol is equivalent to what is posted in the github version of Super Orders. Because the admin orders.php file is in line with the other base code initiation (and not within a function that needs to bring the $db variable in as a global variable), the use of $db->Execute should work and the use of the resulting fields also.