Latest News: (loading..)


This topic is now archived and is closed to further replies.


insert date order in invoice.php

2 posts in this topic

I was in my invoice indicating the date of the order


I added this code in (invoice.php) file


<td class="main"><strong><?php echo TEXT_DATE_ORDER_CREATED; ?></strong></td>
        <td class="main"><?php echo $order->info['date_purchased']; ?></td>


Gregorian date to be inserted

But do not know how I turned to the jalali date


using 2.3.4 ver


please help me

Share this post

Link to post
Share on other sites

If $order->info['date_purchased'] is a string with a Western (Gregorian) format date, and you want to display it as Jalali format, you would have to find a conversion routine and add it to your code (both the function and wrapping a call to this function around that string). might be useful to you. I don't think there's anything built in to PHP to directly do such formatting or conversion, but it wouldn't hurt to do a quick search.


Keep in mind that if you have customers outside Iran/Afghanistan who might be using your page and would prefer Gregorian dates, to make the conversion conditional on some sort of switch.

Share this post

Link to post
Share on other sites