WordPress.org

Ready to get started?Download WordPress

Forums

WP e-Commerce Style Email
[resolved] How to show date and time of which purchases were made (9 posts)

  1. Oudin
    Member
    Posted 1 year ago #

    I would like to show the date and time of when individual purchases were made in the emails.

    So that customers can use it as a reference at a later date if they need too.

    http://wordpress.org/extend/plugins/wp-e-commerce-style-email/

  2. Jacob Schwartz
    Member
    Plugin Author

    Posted 1 year ago #

    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

  3. Oudin
    Member
    Posted 1 year ago #

    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

  4. Jacob Schwartz
    Member
    Plugin Author

    Posted 1 year ago #

    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:
    http://www.w3schools.com/php/func_date_date.asp
    You should be able to display the date in whatever format you want.

    Jacob

  5. Oudin
    Member
    Posted 1 year ago #

    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'));?>
  6. franku
    Member
    Posted 1 year ago #

    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

  7. Jacob Schwartz
    Member
    Plugin Author

    Posted 1 year ago #

    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?

  8. franku
    Member
    Posted 1 year ago #

    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.]

  9. Jacob Schwartz
    Member
    Plugin Author

    Posted 1 year ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic