Skip to main content

Invoice question (date, PDF)

More
7 years 4 months ago #306766 by c-line
-- HikaShop version -- : 4.1
-- Joomla version -- : 3.2

hello i am finishing to cutomize invoice display
1 i bought pdf invoice plugin, how to override ouput ? (backend and front-end)
2 i override show.php to display more information. How i can display payement date ? that the order_modify ? regards

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

More
7 years 4 months ago #306767 by nicolas
Hi,

1. With the PDF invoice, you want to edit the file plugins/hikashop/attachinvoice/attachinvoice/invoice.php

2. it's the order_invoice_created variable you want to use. That variable contains the date of the creation of the invoice number (which is created when the order changes to one of the statuses enabled under the "invoice" column of the System>Order statuses menu, which is normally when the order is confirmed, after the payment is done).
There is actually already that code in order/show.php :
Code:
echo JText::_('DATE').': '.hikashop_getDate($this->element->order_invoice_created, '%d %B %Y');

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

More
7 years 4 months ago - 7 years 4 months ago #306793 by c-line
Replied by c-line on topic Invoice question (date, PDF)
1 pas besoins d'override on est safe niveua update ?
2 je pourrais aussi avoir la date d'envoi (changement de statut)?
3 je calcul des frais de pénalité sur la facture en prenant la date de paiement et en y ajoutant 1 mois
Code:
<?php $date1 = hikashop_getDate($this->element->order_modified, '%d %B %Y'); echo date('j F Y',strtotime('+1 month',strtotime($date1))); ?>
le soucis c'est que la date qui sort est en anglais .. une idée ?
Merci
Last edit: 7 years 4 months ago by c-line.

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

More
7 years 4 months ago #306801 by nicolas
Bonjour,

1. Si vous installez à nouveau le plugin, vous perdrez les modifications. Mais si vous mettez à jour HikaShop vous ne les perdrez pas vu que le plugin n'est pas inclu dans HikaShop.
Vous pouvez aussi copier le fichier dans media/com_hikashop/plugins/ pour avoir un override.

2. Dans order_modified, vous avez la date de la dernière modification de la commande. Ce n'est pas vraiment la date d'envoi. Ca peut l'être dans certains cas.
Le mieux, ce serait de charger l'historique de la commande dans hikashop_history et de récupérer la date de la première entrée de l'historique avec le statut "envoyé". Ainsi, vous aurez la bonne date à coup sûr, mais cela demande un peu de développement PHP/MySQL dans la vue.

3. Au lieu de :
echo date('j F Y',strtotime('+1 month',strtotime($date1)));
essayez plutôt:
echo hikashop_getDate(strtotime('+1 month',strtotime($date1)), '%d %B %Y');

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

Time to create page: 0.178 seconds
Powered by Kunena Forum