Hello,
On the Orders of Virtuemart, all orders are listed in rows and there are several columns (Order number / Invoice, Name / Email, Payment Method, Shipment, Print View, Order Date, Last Modified, Paid, Status, Notify Shopper?, Total, Order ID).
Is it possible to customize this page to show more information in columns?
For example, to show the mobile phone and city name of each order in one of the columns, too.
I am a beginner.
Joomla version = 3
Virtuemart version = 3
Thank you for any help!
Yes that is a very simple thing to do - just create an administrator template override of the
administrator/components/com_virtuemart/views/orders/tmpl/orders.php (this is the order list)
I also set some colours to indicate significant things such as a customer note and different shipping address
Here is an example of what I use in the the first column, this helps combine information and show more relevant things in the list - without the need to look at the order detail.
<?php
// change the background of the address if has ST details
$shippingaddresscolor = "";
if (!empty($order->st_type)){
$shippingaddresscolor= "style='background-color:#fffe69; padding: 3px; margin-top:2px;'";
}
// order note
$ordernotecolor = "";
if (!empty($order->customer_note)){
$ordernotecolor = "style='font-style: italic; color:#018201; padding: 3px;'";
}
?>
<!--Order name details-->
<td>
<?php
// show lots more information on the listing
$orderName = html_entity_decode($order->order_name);
if ($order->virtuemart_user_id) {
$userlink = JRoute::_ ('index.php?option=com_virtuemart&view=user&task=edit&virtuemart_user_id[]=' . $order->virtuemart_user_id, FALSE);
echo JHtml::_ ('link', $userlink, $orderName, array('title' => vmText::_ ('COM_VIRTUEMART_ORDER_EDIT_USER') . ' ' . $orderName) );
} else {
echo '<strong>'.$orderName.'</strong>';
}
echo "<br>";
echo "T: " . $order->phone . "";
echo "<br>";
echo $order->city . " - " . $order->zip . "</strong>";
echo "<br>";
echo $order->order_email;
if (!empty($order->st_type)){
echo "<div ". $shippingaddresscolor .">";
if (!empty($order->st_company)){
echo $order->st_company . " <br>";
}
echo "<b> ". $order->st_city . " - ". $order->st_zip."</b>";
echo "</div>";
}
if (!empty($order->customer_note)){
echo "<div ". $ordernotecolor .">";
echo "N: ".$order->customer_note;
echo "</div>";
}
?>
</td>
Thank you very much!
Excuse me!
I am a beginner. I found this file, how can I create an override of this?
I edited the file (administrator/components/com_virtuemart/views/orders/tmpl/orders.php),
Below codes just show me the name and email, and don't show the mobile and country name!
<td>
<?php
$orderName = html_entity_decode($order->order_name);
if ($order->virtuemart_user_id) {
$userlink = JRoute::_ ('index.php?option=com_virtuemart&view=user&task=edit&virtuemart_user_id[]=' . $order->virtuemart_user_id, FALSE);
echo JHtml::_ ('link', $userlink, $orderName, array('title' => vmText::_ ('COM_VIRTUEMART_ORDER_EDIT_USER') . ' ' . $orderName) );
} else {
echo $orderName;
}
echo '<br>';
echo $order->order_email;
echo '<br>';
echo $order->order_mobile;
echo '<br>';
echo $order->order_country;
?>
</td>
Thank you again!
The new file goes in
administrator/templates/YOURBACKENDTEMPLATE/html/com_virtuemart/orders/orders.php
Yes my code does not show all things - it is an example.
phone_2 is probably what you use for mobile - although I would get rid of any phone_2 and rename phone_1 to Phone in the display
The country is stored as an id in the data files - maybe someone will show you how to get the country name from that
Thank you for all your help!
Unfortunately, phone_2 didn't show anything!
I hope to discover a way to this problem!
need to any idea from anybody!