I've been trying to add a shipping type column to the orders page in oscommerce administration.
I've created the following function in the /cart/admin/includes/functions/general.php
function get_shipping_type($oID) {
$shipping_query = tep_db_query("select title from " . TABLE_ORDERS_TOTAL . " where class='ot_shipping' AND orders_id = '" . (int)$oID . "'");
$shipping_value = tep_db_fetch_array($shipping_query);
return substr($shipping_value['title'], 0, -1);
}
and I've added this line to /cart/admin/orders.php
<td class="dataTableContent" align="right"><?php echo get_shipping_type($oID); ?></td>
(The above line would be between the ...$orders['date_purchased']... and the ...$orders['orders_status_name']... lines)
I have also created the appropriate header for the column.
Now this seems to sort of work. When the report is initially run no entries are shown for the column, but when I click on where the column entry should be for a particular order it generates that ot_shipping value for all rows displayed. Now it is the correct value for the order that I've clicked on but again populates all rows shown with that value.
Any ideas here???
Latest News: (loading..)
admin orders page
Started by hmsims, Jun 08 2009, 23:02
2 replies to this topic
#1
Posted 08 June 2009, 23:02
"We're having a perfectly normal conversation aren't we?"
#2
Posted 08 June 2009, 23:37
ANSWERED THIS BEFORE I HAD A RESPONSE
the variable being passed from /cart/admin/orders.php needed to be a reference to the array value, thus:
php echo get_shipping_type($orders['orders_id']);
Hope someone else may find this of use as well.
the variable being passed from /cart/admin/orders.php needed to be a reference to the array value, thus:
php echo get_shipping_type($orders['orders_id']);
Hope someone else may find this of use as well.
"We're having a perfectly normal conversation aren't we?"
#3
Posted 10 April 2011, 00:23
Really nice. Thanks!














