• Resolved ellounta

    (@ellounta)


    Hello!

    I would like to change the shop page link, when the user select “Redeem”.

    I have the free version. Need to get the pro?

    Thanks,

    Regards

    The page I need help with: [log in to see the link]

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

    (@pimwick)

    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://www.ads-software.com/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.

    Thread Starter ellounta

    (@ellounta)

    Thank you very much! It works!!

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.