• Resolved psartorio

    (@psartorio)


    Hello, I need to edit the email template in order to print the purchase date on the voucher. Is it possible?
    Thanks a lot.

Viewing 4 replies - 1 through 4 (of 4 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

    Hope that helps, let me know if you have any questions!

    Thread Starter psartorio

    (@psartorio)

    Hi, thanks for your answer.
    I already knew this process. What I’m trying to do is adding the date on the email voucher.
    I already added the gift card title with this code:

    <?php
                $product_id = $item_data->product_id;
                if ( empty( $product_id ) ) {
                    $gift_card = new PW_Gift_Card( $item_data->gift_card_number );
                    $product_id = $gift_card->get_original_order_item_meta_data( '_product_id' );
                }
                $product = wc_get_product( $product_id );
                echo esc_html( $product->get_title() );
            ?>

    but I’m not able to add the date. How I can do that? Thanks.

    Plugin Author pimwick

    (@pimwick)

    You can retrieve the order information in the template, including the date ordered. For example:

    <?php
        if ( !empty( $item_data->order ) ) {
            ?>
            <div class="pwgc-section">
                <div class="pwgc-label">Order Number</div>
                <div class="pwgc-expiration-date"><?php echo $item_data->order->get_order_number(); ?></div>
            </div>
    
            <div class="pwgc-section">
                <div class="pwgc-label">Order Date</div>
                <div class="pwgc-expiration-date"><?php echo $item_data->order->get_date_created(); ?></div>
            </div>
            <?php
        }
    ?>
    Plugin Author pimwick

    (@pimwick)

    I’m closing this thread since we haven’t heard back, hopefully this did the trick. Let us know if you need further help, best of luck with your store!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add Card date on voucher’ is closed to new replies.