Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Jacob Schwartz

    (@mightyturtle)

    Hi there,

    The date of purchase is a purchase property – you can access it the same as any other purchase property, like purchase ID.

    Cheers,

    Jacob

    Thread Starter Neziah

    (@neziah)

    Hi,

    I’m using the following to show the order/purchase date

    <?php echo ECSE_purchase::get_the_purchase_prop('date') ?>

    However when testing via the back-end I’m seeing the following being generated

    Order Date : 1355937181

    The above looks like random numbers and not dates is there a way to fix this

    Plugin Author Jacob Schwartz

    (@mightyturtle)

    Hi,

    That number looks like a Unix timestamp. If you’re not familiar with the timestamp standard for storing date information, have a look here:
    https://www.w3schools.com/php/func_date_date.asp
    You should be able to display the date in whatever format you want.

    Jacob

    Thread Starter Neziah

    (@neziah)

    Thanks I got it done

    For those who will be looking to include the order/purchase date use the following:

    <?php echo $formated_datetime = DATE('d-M-Y, g:i:a',ECSE_purchase::get_the_purchase_prop('date'));?>

    franku

    (@franku)

    hm I get a fatel error when I use that code above…

    Fatal Error: Class ‘ECSE_purchase’ not found in /home/directory/directory/wpsc-email_style.php on line 3

    What am I doing wrong?

    The code is exactly as above

    Plugin Author Jacob Schwartz

    (@mightyturtle)

    It sounds like the plugin’s classes haven’t loaded by the time you’re making the call. What file are you putting the code in?

    franku

    (@franku)

    The code in my wpsc-email_style.php is:

    <html><body>
    <h2 style="color:#016E0F"><?php echo ecse_get_email_subject(); ?></h2>
    <?php echo $formated_datetime = DATE('d-M-Y, g:i:a',ECSE_purchase::get_the_purchase_prop('date'));?>
    <?php echo ecse_get_email_content(); ?>
    </body></html>

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Plugin Author Jacob Schwartz

    (@mightyturtle)

    Ah, that clarifies things.

    wpsc-email_style.php is your all-purpose email wrapper, where you can put a branding container, social links, etc, that apply not only to purchase receipts but also to blog subscriptions, password resets… So you can’t use purchase-specific code in that file.

    Instead, if you’re templating content you should be using the content template for purchase receipts.

    Does that make sense?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to show date and time of which purchases were made’ is closed to new replies.