- Posts: 126
- Thank you received: 2
Display "Reason" field in "My orders"
14 years 1 month ago #60355
by mett
Display "Reason" field in "My orders" was created by mett
Hello,
When i changed the status for an order, i can add also a reason and notify the user. I would like to display this reason to users in "My order" area, where they can see details about own orders made.
How can i do this?
Thank you
When i changed the status for an order, i can add also a reason and notify the user. I would like to display this reason to users in "My order" area, where they can see details about own orders made.
How can i do this?
Thank you
Please Log in or Create an account to join the conversation.
14 years 1 month ago #60417
by nicolas
Replied by nicolas on topic Re: Display "Reason" field in "My orders"
Hi,
There is no option for that.
You would have to add such code in the file 'show' of the view 'order' via the menu Display->Views:
<?php
$database=& JFactory::getDBO();
$database->setQuery('SELECT * FROM '.hikashop_table('history').' WHERE history_order_id='.$this->order->order_id.' ORDER BY history_created DESC');
$order->history = $database->loadObjectList();
foreach($order->history as $history{ echo $history->history_reason; }
?>
There is no option for that.
You would have to add such code in the file 'show' of the view 'order' via the menu Display->Views:
<?php
$database=& JFactory::getDBO();
$database->setQuery('SELECT * FROM '.hikashop_table('history').' WHERE history_order_id='.$this->order->order_id.' ORDER BY history_created DESC');
$order->history = $database->loadObjectList();
foreach($order->history as $history{ echo $history->history_reason; }
?>
Please Log in or Create an account to join the conversation.
14 years 1 month ago #61184
by mett
Replied by mett on topic Re: Display "Reason" field in "My orders"
Many thanks for help, nicolas.
P.S: there is a missing ) after as $history. For anyone who need tabular info:
<?php
$database=& JFactory::getDBO();
$database->setQuery('SELECT *, from_unixtime(history_created) as ORDERDATE FROM '.hikashop_table('history').' WHERE history_order_id='.$this->order->order_id.' ORDER BY history_created DESC');
$order->history = $database->loadObjectList();
?>
<table class="hikashop_entries_table adminlist" cellpadding="1" width="100%">
<?php
foreach($order->history as $history) { echo '<tr><td>'.$history->ORDERDATE.'</td><td>'.$history->history_new_status.'</td><td>'.$history->history_reason.'</td></tr>'; }
?>
</table>
P.S: there is a missing ) after as $history. For anyone who need tabular info:
<?php
$database=& JFactory::getDBO();
$database->setQuery('SELECT *, from_unixtime(history_created) as ORDERDATE FROM '.hikashop_table('history').' WHERE history_order_id='.$this->order->order_id.' ORDER BY history_created DESC');
$order->history = $database->loadObjectList();
?>
<table class="hikashop_entries_table adminlist" cellpadding="1" width="100%">
<?php
foreach($order->history as $history) { echo '<tr><td>'.$history->ORDERDATE.'</td><td>'.$history->history_new_status.'</td><td>'.$history->history_reason.'</td></tr>'; }
?>
</table>
The following user(s) said Thank You: nicolas, pepecortez
Please Log in or Create an account to join the conversation.
Time to create page: 0.151 seconds