How to show order history in frontend?

  • Posts: 174
  • Thank you received: 2
  • Hikashop Business
12 years 2 months ago #62264

nicolas, can you write exactly what needs to be done to achieve this?

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
12 years 2 months ago #62377

Go in the menu Display>Custom fields. Create a new custom field of the table "order" and of the type "file" which is unpublished for the front end and save.
That's all.

Please Log in or Create an account to join the conversation.

  • Posts: 138
  • Thank you received: 4
6 years 9 months ago #287219

hi,
I do it in hikashop 3.2 , but error.
please update code .thanks


Joomla Developer | am.ebrahimzadeh[at]gmail.com

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
6 years 9 months ago #287220

Hi,

I don't know what code you're talking about exactly but for what I can see in page 1, it's still some valid code.

Regards


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 138
  • Thank you received: 4
6 years 9 months ago #287263

I use this code for display history reason in front-end order list :
echo JText::_( 'REASON_HISTORY' ), ' ',$row->history[0]->history_reason;

but dont show value.


Joomla Developer | am.ebrahimzadeh[at]gmail.com

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
6 years 9 months ago #287267

Hi,

Where exactly in the listing file are you adding that code ?

Please Log in or Create an account to join the conversation.

  • Posts: 138
  • Thank you received: 4
6 years 9 months ago #287343

component/com_hikashop/veiw/order/tmpl/listing.php

<td class="hikashop_order_date_value">
<?php
echo JText::_( 'DATA_HISTORY_YOOL' ), ' '.hikashop_getDate($row->order_modified,'%Y-%m-%d %H:%M').' ';
echo JText::_( 'STAT_HISTORY_YOOL' ), ' ',$this->order_statuses->trans($row->order_status). ' ',JText::_( 'STAT2_HISTORY_YOOL' );
echo JText::_( 'REASON_HISTORY_YOOL' ), ' ',$row->history[0]->history_reason; ?>
</td>


Joomla Developer | am.ebrahimzadeh[at]gmail.com

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
6 years 9 months ago #287346

Hi,

The history is not loaded for each order on the listing.
This code was for displaying the history in the "show" file of the "order" view.
In the listing, you would have to do something like that:

<?php $database = JFactory::getDBO();
$query='SELECT * FROM '.hikashop_table('history').' WHERE history_order_id='.$row->order_id.' ORDER BY history_created DESC';
$database->setQuery($query);
$row->history = $database->loadObjectList();
?>
so that you can then use $row->history

Please Log in or Create an account to join the conversation.

Time to create page: 0.076 seconds
Powered by Kunena Forum