Edit gift card's URL

MACRORY
Excursionist
30 2 4

Hey Guys,

 

I have recently found a problem with my gift card. When I send a gift card to someone, they will be linked to a address start with "checkout.shopify.com". However, it should be "mystoredomain.com/gift_cards/...something". So I look up on shopify help center, there is an article says 

gift_card.url

Returns the unique URL that links to the gift card's page on the shop (rendered throughgift_card.liquid).

But I couldn't find any code that render the url for my gift card.

 

Can someone help me with that! 

 

Thanks

0 Likes
Qualitycheck
Shopify Expert
1403 114 225

Hi @MACRORY,

 

Could you please send Store URL in order to check the actual URL?

0 Likes
Hamzah-Bao
New Member
3 0 0

Hi,

I am having the same issue as well, in Settings > Notifications > Gift card created, the code for the gift page link in the email template is this: <a class="button__link" href="{{ gift_card.url }}">View your gift card</a>. The gift_card.url is: 'checkout.shopify.com' URL and not the shop domain. This means that when they click on the link, land on the 'checkout.shopify.com/gift_cards' page, all the links and search bar URL on the page are incorrect.

0 Likes
SamAM
New Member
3 0 0

I can see you resolved this issue, but have not stated how it was resolved.

as you might have guessed we have the same issue. Can you advise on the solution please?

0 Likes
Kate1c2
New Member
2 0 0

HI @SamAM Did you ever get a reply on how this issue was fixed?  We are experiencing the same thing and I am having a hard time troubleshooting.  

0 Likes
SamAM
New Member
3 0 0

Hey @

0 Likes
MACRORY
Excursionist
30 2 4

@SamAM @Kate1c2 

Hey Guys, sorry for the late reply. Basically, the gift card email sent from Shopify redirect customer to a checkout.shopify.com/gift_cards/xxx address. However, the gift card still works if you change checkout.shopify.com to yourdomain.com/gift_cards/xxx  There are few options you could do.

 

1. Change the URL your send to customer in your email notification template.

Change the following elment in your Email Notification 

{{ gift_card.url }}

to something like

{{ gift_card.url | replace: "checkout.shopify.com", "yourdomain.com"}}

 

2. Redirect your customers when they go to your checkout.shopify.com page

Add javascript to your gift_card.liquid that identify the current url, if it is checkout.shopify.com/gift_cards/xxx ... ,then redirect your customer to yourdoamin.com/gift_cards/xxx 

You could search on stackoverflow to achieve this option

 

Kate1c2
New Member
2 0 0

Much appreciated for this information @MACRORY ! 

 

@SamAM Additionally, after chatting with a Shopify Guru person as well, they determined that when we changed our theme within the last couple of months that our new theme we chose has some impact over this link not working too.  If you are using a third party theme, that could also be the issue.  We are using the prestige theme.  The theme developer has reached out so I will let you know if they are able to fix it.  They might also be using the same thing that @MACRORY mentioned above!  

 

Best of luck!

0 Likes
SamAM
New Member
3 0 0

Oh my word. Thank you for your swift reply. I just implement option 1 and it works completely. Thank you so much this is such a help to us.

0 Likes
TechSolver
Pathfinder
90 3 14

@MACRORY is correct but missed a little something. For most third-party themes, this is how the notification code will look for the gift card URL:

<a href="{{ gift_card.url }}"

 

Makes sure to keep those quotation marks at the end. This is how it will look once you change it to your URL:

<a href="{{ gift_card.url | replace: "checkout.shopify.com", "www.yoursite.com" }}"