• Resolved wilfriedsdv

    (@wilfriedsdv)


    Hi,

    Everything works fine, but when my clients receive the gift card, they are redirected to the “Shop” page of my website.

    As the website is a reservation website there is nothing to see on the SHOP page for them so they will be confused…

    Do you have a way for me to redirect people only on the HOMEPAGE of my website when they click on the Gift Card button ?

    I browsed the support request on the forum and i found this code

    function custom_pwgc_redeem_url( $redeem_url, $item_data ) {
        // This is the current URL. Change it to suit your needs:
        $shop_url = get_permalink( wc_get_page_id( 'shop' ) );
        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 );

    But :
    1. I don’t know where to change the URL
    2. When i tried to do that :

    function custom_pwgc_redeem_url( $redeem_url, $item_data ) {
        // This is the current URL. Change it to suit your needs:
        <strong><em>$shop_url = site_url();</em></strong>
        $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 );

    It didn’t worked.

    Can you help me with this plz ?

    • This topic was modified 5 years, 2 months ago by wilfriedsdv. Reason: Put the code i changed in bold so it's easier to spot the problem
Viewing 1 replies (of 1 total)
  • Plugin Author pimwick

    (@pimwick)

    The Pro version of the plugin allows you to specify the Redeem URL for the gift card directly from the Settings page without having to add custom code to your site. You can find out more about the Pro version here: https://www.pimwick.com/gift-cards/

    www.ads-software.com prefers that we don’t use their forums to support Pro features so if you have any further questions about this just contact us directly from our website. Thanks for your understanding!

Viewing 1 replies (of 1 total)
  • The topic ‘Gift Card Wrong redirect’ is closed to new replies.