Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

admin orders page


  • You cannot reply to this topic
2 replies to this topic

#1 hmsims

  • Community Member
  • 12 posts
  • Real Name:herman m sims

Posted 08 June 2009, 23:02

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???
"We're having a perfectly normal conversation aren't we?"

#2 hmsims

  • Community Member
  • 12 posts
  • Real Name:herman m sims

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.
"We're having a perfectly normal conversation aren't we?"

#3 w3coy

  • Community Member
  • 12 posts
  • Real Name:Chris
  • Gender:Male

Posted 10 April 2011, 00:23

Really nice. Thanks!