News:

Looking for documentation? Take a look on our wiki

Main Menu

Wrong date last modified on details_order.php

Started by doc_denis, February 10, 2017, 15:31:38 PM

Previous topic - Next topic

doc_denis

hello,

The details_order.php file does not display the last change at the top of the view.
file :
components/com_virtuemart/views/orders/tmpl/details_order.php

I propose to replace:

    <tr>
<td class=""><?php echo vmText::_('COM_VIRTUEMART_LAST_UPDATED'?></td>
<td align="left"><?php echo vmJsApi::date($this->orderdetails['details']['BT']->modified_on'LC4'true); ?></td>
    </tr>


By this code (to display the last modification):


    <tr>
<td class=""><?php echo vmText::_('COM_VIRTUEMART_LAST_UPDATED'?></td>
<td align="left"><?php //echo vmJsApi::date($this->orderdetails['details']['BT']->modified_on, 'LC4', true); ?>
<?php
foreach($this->orderdetails['history'] as $_hist)
?>

<?php echo vmJsApi::date($_hist->created_on,'LC1',true); ?>
</td>
    </tr>


post on french forum :
http://www.virtuemart.fr/forum/commandes-et-clients-vm3/1233-erreur-dans-la-liste-virtuemart-des-commandes-en-front-end

doc_denis

Hello,

in french forum, Studio42 sent this clean code:


$_hist = end ($this->orderdetails['history']);
echo vmJsApi::date($_hist->created_on,'LC4',true);


thank you @ Studio 42

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Studio 42

#3
Max,
it's a temp fix that can be applied in the template, i think that valerie already reported it to you?
I mean that the modified_on value is not parsed correctly from DB, so a patch using this is bad, it need to be solved in the view or perhaps in the model directly.

Milbo

? svn patch? you can also do it with git, I told you often.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/