• Resolved lena_k198

    (@lena_k198)


    Hello,
    In the gift card email we have a Redeem button that goes to the shop page. This question was already asked and code provided was changing link so customer goes to the shop page of the site. What if we want to link to a /reservation page.
    Thank you in advance.

Viewing 1 replies (of 1 total)
  • Plugin Author pimwick

    (@pimwick)

    There is a hook available to change the URL for the “Redeem” button. Follow these steps and make the changes that you need:

    1. Download the functions.php from your FTP server at /wp-content/themes/<your theme>/functions.php
    2. Keep a backup of functions.php in case there are problems.
    3. Edit functions.php and scroll to the very end and add this code.

    Note: if the last line is “?>” then put this code *above* that line. Otherwise, this code goes at the very end of the file:

    function custom_pwgc_redeem_url( $redeem_url, $item_data ) {
        // Change this to suit your needs:
        $shop_url = 'https://www.thesite.com';
        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 );

    4. Save the functions.php file and re-upload it to your server.

    Replace functions.php with your backup file if you have any problems.

    Let me know if you have any questions!

Viewing 1 replies (of 1 total)
  • The topic ‘Re linking Redeem button’ is closed to new replies.