How to show order history in frontend?

  • Posts: 134
  • Thank you received: 2
  • Hikashop Business
5 years 8 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: 62142
  • Thank you received: 8855
  • MODERATOR
5 years 8 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: 100
  • Thank you received: 0
3 months 2 weeks ago #287219

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


Joomla Developer | contact [at] yool.ir

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

  • Posts: 22332
  • Thank you received: 3477
  • MODERATOR
3 months 2 weeks 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: 100
  • Thank you received: 0
3 months 2 weeks 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 | contact [at] yool.ir

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

  • Posts: 62142
  • Thank you received: 8855
  • MODERATOR
3 months 2 weeks 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: 100
  • Thank you received: 0
3 months 2 weeks 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 | contact [at] yool.ir

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

  • Posts: 62142
  • Thank you received: 8855
  • MODERATOR
3 months 2 weeks 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.086 seconds
Powered by Kunena Forum