Redeem – change link | WordPress.org

[ad_1]

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://projectdmc.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.

Thank you very much! It works!!

Regards

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer