Change the Redeem button link (URL) in the email

The Redeem URL defaults to the page specified under WooCommerce -> Settings -> Products -> Shop Page.

If you have the PW WooCommerce Gift Cards Pro version, you can easily change the Redeem URL by clicking on Pimwick Plugins -> PW Gift Cards -> Settings -> Redeem URL. This will change the default value for all Designs, however if you have a different URL for each Design you can also change it on the individual Designs (Pimwick Plugins -> PW Gift Cards -> Designer -> Redeem URL).

If you have the free version, there is a hook available to change the URL for the “Redeem” button:

1. Download the free Code Snippets plugin: https://wordpress.org/plugins/code-snippets/
2. Create a Snippet with the following code:

function custom_pwgc_redeem_url( $redeem_url, $item_data ) {
    //
    // Change this URL in the quotes. Leave the quotes intact.
    //
    $shop_url = 'https://www.thesite.com';

    // Leave the remainder of the code unchanged.
    if ( empty( $shop_url ) ) {
        $shop_url = site_url();
    }
    $redeem_url = add_query_arg( 'pw_gift_card_number', urlencode( $item_data->gift_card_number ), $shop_url );

    return $redeem_url;
}
add_filter( 'pwgc_redeem_url', 'custom_pwgc_redeem_url', 10, 2 );

3. Change the $shop_url to whatever you need

Note: If you prefer to put the code in your functions.php you can do that instead of using Code Snippets.

Skip to content