Gift Card Wrong redirect
-
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 ?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Gift Card Wrong redirect’ is closed to new replies.