• Resolved emanuel92

    (@emanuel92)


    how can I add in the customer’s email the date and time when he ordered the gift card?

    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author pimwick

    (@pimwick)

    You can fully customize the gift card email to suit your needs. We use the built in WooCommerce email template system. To override the email follow these steps:

    1. Log into your WordPress admin area.
    2. Click on WooCommerce -> Settings -> Emails -> PW Gift Card Email
    3. Under the “HTML Template” section, click “Copy file to theme”
    4. Once the file is in your theme folder, open it up in a text editor and make any changes. You can change colors, wording, etc.

    If you have trouble with Step 3, you can manually copy this file:
    /wp-content/plugins/pw-woocommerce-gift-cards/templates/woocommerce/emails/customer-pw-gift-card.php

    To here (you may need to create the subfolders if they do not exist in your theme folder):
    /wp-content/themes/<your-active-theme>/woocommerce/emails/customer-pw-gift-card.php

    Here is an example of how to access the order information:

    <?php
        if ( !empty( $item_data->order ) ) {
            ?>
            <div class="pwgc-section">
                <div class="pwgc-label"><?php _e( 'Order Number', 'pw-woocommerce-gift-cards' ); ?></div>
                <div class="pwgc-expiration-date"><?php echo $item_data->order->get_order_number(); ?></div>
            </div>
            <?php
        }
    ?>

    Let me know if you have any other questions!

    Thread Starter emanuel92

    (@emanuel92)

    I managed to attach in the email: order_id

    According to the code above

    Thank you for this.

    But I want to display the date when the order was placed.

    I tried to change your code but I couldn’t. can you please help me with the code to be able to display the date when the order was placed?

    Thank you for help

    Plugin Author pimwick

    (@pimwick)

    According to the WooCommerce source code for the Order object, I think you need to use the get_date_created() function. Try this:

    <?php
        if ( !empty( $item_data->order ) ) {
            ?>
            <div class="pwgc-section">
                <div class="pwgc-label"><?php _e( 'Order Created', 'pw-woocommerce-gift-cards' ); ?></div>
                <div class="pwgc-expiration-date"><?php echo $item_data->order->get_date_created(); ?></div>
            </div>
            <?php
        }
    ?>
    Thread Starter emanuel92

    (@emanuel92)

    Thank you for help,

    I have a question :),
    I can make this gift card expire.
    If you do not use it in 6 months, this gift card expires.

    thank you for help
    Emanuel

    Plugin Author pimwick

    (@pimwick)

    Hi Emanuel, using the PW Gift Cards Pro version you can set a 6 month expiration date on the gift cards.

    ww.wp.xz.cn doesn’t allow supporting Pro plugins using their forums so I am marking this thread as resolved. If you have further questions please contact us at our website: https://www.pimwick.com

    Thanks for understanding!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘[NSFW] Add date and time when he ordered’ is closed to new replies.