Imac89 Posted December 14, 2013 Posted December 14, 2013 I'm trying to get the Customer ID to show up on the admin - orders page, but not having any luck. I did get the Order ID to show up there, but I need the Customer ID to show. Can anyone help me with this? Thanks
Guest Posted December 14, 2013 Posted December 14, 2013 hi, On what page are you trying to get the id?
Dan Cole Posted December 14, 2013 Posted December 14, 2013 @@Imac89 If you want to add it to orders.php....you can add... <tr> <td class="main"><b><?php echo 'Customer ID: '; ?></b></td> <td class="main"><?php echo '<a href="'.HTTP_CATALOG_SERVER.DIR_WS_CATALOG.'NAME OF YOUR ADMIN DIRECTORY/customers.php?search='. $order->customer['customers_id'] .'&page=1&cID='.$order->customer['customers_id'].'&action=edit"><u>'.$order->customer['customers_id'] . '</u></a>'; ?></td> </tr> under where the billing address is echoed out or somewhere in that area. Replace NAME OF YOUR ADMIN DIRECTORY with the name of your directory. Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here.
Imac89 Posted December 14, 2013 Author Posted December 14, 2013 @@Imac89 If you want to add it to orders.php....you can add... <tr> <td class="main"><b><?php echo 'Customer ID: '; ?></b></td> <td class="main"><?php echo '<a href="'.HTTP_CATALOG_SERVER.DIR_WS_CATALOG.'NAME OF YOUR ADMIN DIRECTORY/customers.php?search='. $order->customer['customers_id'] .'&page=1&cID='.$order->customer['customers_id'].'&action=edit"><u>'.$order->customer['customers_id'] . '</u></a>'; ?></td> </tr> under where the billing address is echoed out or somewhere in that area. Replace NAME OF YOUR ADMIN DIRECTORY with the name of your directory. That put it on the edit orders page, but I would like to have it just on the orders page where I can see the list of customers, customer ID, order ID, order total ,date purchased and status. I got the order ID on there and I can get the customer ID heading and column there, but the actual customer ID's won't show up. Thanks for the help.
Imac89 Posted December 14, 2013 Author Posted December 14, 2013 hi, On what page are you trying to get the id? On the Admins, Orders page. Where I can see a list of the orders and the customers with there ID's. Thanks
Dan Cole Posted December 15, 2013 Posted December 15, 2013 @@Imac89 I see...you want it on the order list rather than on the order itself....in that case it's on the same page but further down in orders.php and you need to change the echo to... <td class="dataTableContent"><?php echo $orders['customers_id']; ?></td> you'll also need to ensure that the query includes the customers_id...like this... o.customers_id, and finally set up the heading and add the define to the language file. Dan Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here.
npn2531 Posted December 15, 2013 Posted December 15, 2013 To get the id to show up in the orders listing you need to do two things. 1 on admin/orders.php find all three instances of the query that starts with: $orders_query_raw add after o.customers_name this; o.customers_id, so it reads: o.customers_name, o.customers_id, In other words, add the field o.customers_id to the three queries Then find: <?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit') . '">' . '</a> ' . $orders['customers_name']; ?> and change it to: <?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit') . '">' . '</a> ' . $orders['customers_name'].', '.$orders['customers_id']; ?> You will get the order_id following the name like this: Jim Jones, 1235 WIth a bit more work you can use the same principles to create a new column for customer_id instead of having it in the same column as the name, as I have it here. Oscommerce site: OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120
Imac89 Posted December 15, 2013 Author Posted December 15, 2013 Ah thank you both, that got it working. @@npn2531 That was exactly what I needed. @@Dan Cole That's what I tried first, but I think where I left out the o.customers_id in the query, is why it didn't work.
npn2531 Posted December 15, 2013 Posted December 15, 2013 Glad it worked, you apparently caught my error where I meant 'customer_id' but typed 'order_id' in my explanation above. Oscommerce site: OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120
Dan Cole Posted December 15, 2013 Posted December 15, 2013 @@Dan Cole That's what I tried first, but I think where I left out the o.customers_id in the query, is why it didn't work. No problem...glad I could be of help. Dan Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.