Jump to content

[Resolved] Dashboard - UnSettled orders


jka

Recommended Posts

  • 3 months later...
  • 4 weeks later...

BSmither,

On a different note, I have possibly figured out how to add a line on the un-settled orders to also show 'product_code'. The product code is is in _order_inventory table. 

Here is a code from /admin-folder/sources/dashboard.index.inc.php. If we can add code to also get data from the order_inventory table, we will be able to then display the Product_Code for each order in the dashboard.

## Pending Orders Tab
$page  = (isset($_GET['orders'])) ? $_GET['orders'] : 1;
$unsettled_count  = $GLOBALS['db']->count('CubeCart_order_summary', 'cart_order_id', array('status' => array(1, 2)));
$results_per_page = 25;
$unsettled_orders = $GLOBALS['db']->select('CubeCart_order_summary', array('cart_order_id', 'name', 'first_name', 'last_name', 'order_date', 'customer_id', 'total', 'status'), 'status IN (1,2) OR `dashboard` = 1', '`dashboard` DESC, `status` DESC,`order_date` ASC', $results_per_page, $page);

 

Link to comment
Share on other sites

Try this:

In dashboard.index.inc.php, near line 263, find:

$GLOBALS['smarty']->assign('ORDERS', $orders);

ABOVE that, add:

if(($inventories = $GLOBALS['db']->select('CubeCart_order_inventory', '`cart_order_id`,`product_code`', array('cart_order_id' => $cart_order_ids))) !== false){
	foreach($inventories as $inventory){
		$order_inventory[$inventory['cart_order_id']]['inventory'][] = $inventory;
	}
	$orders = merge_array($orders,$order_inventory);
}
In the template dashboard.index.php, find near line 160:

<td>{$order.date}</td>

AFTER that, add:

<td>{foreach $order.inventory as $prod}{$prod.product_code}{/foreach}</td>

Find near line 137:

<td>{$LANG.common.date}</td>

AFTER that, add:

<td>Inventory</td>

You now have a column holding product codes for each respective order.

I will leave it up to you to style the list of product codes in the table cell. (I was thinking about a drop-down list if more than one item in the order.)

Link to comment
Share on other sites

Thanks & Thanks to you BSmither. 

It works great. I did this for the multiple products in an order and it works great.

                   <td>
                    {foreach $order.inventory as $prod}
                    <div class = row>
                    {$prod.product_code} {/foreach}
                    </div>    
                    </td>
                

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
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...