Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

display product listing with all orders listing....


elari

Recommended Posts

if you want to know the products ordered by customers without when checking list of all orders without click on "edit"....

 

In admin/orders.php

Find

default:

if (is_object($oInfo)) {

$heading[] = array('text' => '<b>[' . $oInfo->orders_id . ']  ' . tep_datetime_short($oInfo->date_purchased) . '</b>');

 

$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');

$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>');

$contents[] = array('text' => '<br>' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased));

if (tep_not_null($oInfo->last_modified)) $contents[] = array('text' => TEXT_DATE_ORDER_LAST_MODIFIED . ' ' . tep_date_short($oInfo->last_modified));

$contents[] = array('text' => '<br>' . TEXT_INFO_PAYMENT_METHOD . ' ' . $oInfo->payment_method);

 

 

Add After

 

// elari added to display product list for selected order

$order = new order($oInfo->orders_id);

$contents[] = array('text' => sizeof($order->products) . ' Products ' );

for ($i=0; $i<sizeof($order->products); $i++) {

$contents[] = array('text' => $order->products[$i]['qty'] . ' x' . $order->products[$i]['name']);

 

if (sizeof($order->products[$i]['attributes']) > 0) {

for ($j=0; $j<sizeof($order->products[$i]['attributes']); $j++) {

$contents[] = array('text' => '<small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>' );

}

}

}

// elari End add display products

 

 

maybe should be usefull to add a config value in admin to set it on / off...

 

order_listing_show_products.gif

Link to comment
Share on other sites

  • 1 month later...

Thanks elari,

 

But... :?

 

What does this mod change? I added it into the admin/orders.php, but I did not see any change in the way the customer orders show when clicking on the orders link. Does it only work if a new order is made or is it also for old orders as well?

 

What I'm I missing? I used the code from your post.

 

Here's my admin/order.php (section with your code):

 

if (is_object($oInfo)) {

$heading[] = array('text' => '<b>[' . $oInfo->orders_id . ']  ' . tep_datetime_short($oInfo->date_purchased) . '</b>');

 

$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');

$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>');

$contents[] = array('text' => '<br>' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased));

if (tep_not_null($oInfo->last_modified)) $contents[] = array('text' => TEXT_DATE_ORDER_LAST_MODIFIED . ' ' . tep_date_short($oInfo->last_modified));

$contents[] = array('text' => '<br>' . TEXT_INFO_PAYMENT_METHOD . ' ' . $oInfo->payment_method);

}

break;

}

// elari added to display product list for selected order

$order = new order($oInfo->orders_id);

$contents[] = array('text' => sizeof($order->products) . ' Products ' );

for ($i=0; $i<sizeof($order->products); $i++) {

$contents[] = array('text' => $order->products[$i]['qty'] . ' x' . $order->products[$i]['name']);

 

if (sizeof($order->products[$i]['attributes']) > 0) {

for ($j=0; $j<sizeof($order->products[$i]['attributes']); $j++) {

$contents[] = array('text' => '<small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>' );

}

}

}

// elari End add display products

Running osC - 2.2MS2. P.S. Please don't ask for a link to my site, it is on a production server and not available for the general public, yet!

Link to comment
Share on other sites

Elari,

Great mod, thanks! :D

 

I have found one slight problem though... with the calculation of the number of products.

 

If a customer purchases more than one of the same product it only counts it as one product... where I think it should count it as whatever the number of products really are.

 

Example:

4 Products  

1 xFlightcom IIsx 

2 xDenali ANR 

 - Colour: Yellow 

 - Model: Fixed Wing 

 - Power: 12-24 Volt aircraft panel (Fixed

1 xClassic ANR 

1 xDenali ANR 

 - Colour: Yellow 

 - Model: Helicopter 

 - Power: 9 Volt drop-in battery

 

Actually... just found one more problem...

In the example above, the " - Power: 12-24 Volt aircraft panel (Fixed" line is actually longer, but it's been truncated.

Is it possible to make the line longer so it doesn't get cut short?

 

Many thanks,

Tony

"The price of success is perseverance. The price of failure comes much cheaper."

Link to comment
Share on other sites

i know.

i had no need of exact qty of products, only number or different items...

it is just to have a fast look on order without the need of any query

 

change Products by Refefences :)

 

 

i don't know why is truncated line (try to remove the /nobr ?)

Link to comment
Share on other sites

Thanks elari,

 

Works now. I checked my admin today and my orders section looks like the example screenshot from your post.

 

Good one. 8)

Running osC - 2.2MS2. P.S. Please don't ask for a link to my site, it is on a production server and not available for the general public, yet!

Link to comment
Share on other sites

Works now. I checked my admin today and my orders section looks like the example screenshot from your post.

 

I've tried and tried, and I just can't get mine to look the same...

 

How do I configure that big purple circle? Is it in a stylesheet? :roll:

 

 

 

P.S.

YES! I'm kidding! :D :D

 

Well done Elari, great mod!

"The price of success is perseverance. The price of failure comes much cheaper."

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...