• Resolved FireFlyWebs

    (@fireflywebs)


    Is it possible to create more than one gift card with the free version of this plug in?
    Or with the paid version?
    Is it possible to have a different image on each?
    Thanks

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

    (@pimwick)

    Yes, you can simply make a copy of the product and set a new Product Image. This works the same way for both the free and Pro versions.

    Let me know if you have any other questions!

    Thread Starter FireFlyWebs

    (@fireflywebs)

    Thanks. Successfully duplicated and changed the product, but is there a way to change the look of the card that is received in the email? I did change the original one to show a product image… is there a way to create a second one?

    Plugin Author pimwick

    (@pimwick)

    The most straight-forward solution would be to include the Product Image in the emailed gift card.

    To do this, override the email template by copying 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

    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.

    To set the background image to the gift card product image, find the code below and uncomment the three lines as shown:

    .pwgc-gift-card-container {
        border-style: solid;
        border-width: 1px;
        border-color: #333;
        border-radius: 16px;
        background-color: #FFFEE0;
        padding: 0px 24px;
    
        <?php
            // If you want to show the gift card product image you can do something like this (uncomment the next few lines by removing the two slashes):
            $image = wp_get_attachment_image_src( get_post_thumbnail_id( $item_data->parent_product->get_id() ), 'single-post-thumbnail' );
            echo "background-image: url('$image[0]');";
            echo "background-position: center;";
        ?>
    }
    Thread Starter FireFlyWebs

    (@fireflywebs)

    Yes, but I already have set the background image at a previous time, using those instructions, for the email for card #1. If I have a 2nd card option in my shopping cart then I assume the gift email is going to contain that same image.
    Is there a way to have an email image for card 1 and a second email image for card 2?

    Plugin Author pimwick

    (@pimwick)

    Since you have already customized the email and do not want to include the product image of the gift card sold, you can check the product ID in the template file.

    For example:

    switch ($item_data->get_id()) {
        case 123:
            // Display image for gift card with product ID 123
        break;
    
        case 345:
            // Display image for gift card with product ID 345
        break;
    
        default:
            // Display an image for all other gift cards
        break;
    }
    
    Thread Starter FireFlyWebs

    (@fireflywebs)

    OK. Trying to understand the above.

    I do want to include the image of the gift card sold, but that it should be different for those being given card 1 than those being given card 2.

    If the original gift card is id 332 and the new one is id 618 then
    do I insert the code you provided as below? Sorry, I don’t know php.
    _______________

    switch ($item_data->get_id()) {
    case 332:
    // Display image for gift card with product ID 332
    break;

    case 618:
    // Display image for gift card with product ID 618
    break;

    default:
    // Display an image for all other gift cards
    break;
    }

    Thanks for your patience.

    Thread Starter FireFlyWebs

    (@fireflywebs)

    And is there a way to view the email without sending myself a purchase?

    Thread Starter FireFlyWebs

    (@fireflywebs)

    Thank you I have sent the email with images and the php file.

    Plugin Author pimwick

    (@pimwick)

    And is there a way to view the email without sending myself a purchase?

    Yes, with the Pro version you can click the “Email Gift Card” button from the admin area to re-send a gift card email (you can also specify a different email address for testing purposes).

    With the free version you can create a WooCommerce coupon for 100% off the cart total. That way when you purchase a gift card from the front end for testing, you can apply this coupon and not have to enter payment information.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘More than one card’ is closed to new replies.