Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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.urlReturns 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
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.
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?
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.
Hey @Kate1c2 thanks for your reply. No we heard absolutely nothing. In the end we just disabled the feature. Its very frustrating as we would love to use them. Let me know how you go, if you are able to make progress?
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
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!
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.
@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" }}"
I tried to follow this but I cannot find <a href="{{ gift_card.url }}" in the code in the edit code gift card page. Is the code correct or am I doing something wrong?
Hi @jenni2
I was a bit unclear. You don't edit the code of the theme. You edit the code of the notification email for Gift card created. This link will take you straight to where you're supposed to make changes.
Thank you so much! It worked! 🙂
Hey techsolver, the url change works fine for the e-mail but not working for the SMS. Can you please help me out with this as it is redirecting to the checkout.shopify.com.
@Salmank4 I got it! Since Shopify makes you include the gift care url as is, you have to trick it. Copy and paste the below code:
Here's your {{ gift_card.balance | money_without_trailing_zeros }} {{shop.name}} gift card:{{ {{ gift_card.url }} {{ gift_card.url | replace: "checkout.shopify.com", "www.yoursite.com" }} . {% if gift_card.expires_on %} This gift card expires on {{ gift_card.expires_on }} {% endif%}
@TechSolver thanks for the reply! I tried the code you suggested and once i clicked on the link it says page not found. 😞
@Salmank4 The code I posted above is correct. You just need to replace your domain name in there, and the rest will happen magically.
@TechSolver i just found out the reason why it says page not found that's because when i received the url it had https://www.mywebsite.com/giftcards/ but it is supposed to have gift_card in the url path and i made the change and i see it worked!
No, you are doing it wrong. It won't work for other people if you do that.
i have removed the dot from the code which was after the flower braces and still it's the same! Not working and it said page not found
@Salmank4 Please send the code you posted, including your domain name. If your domain name does not have www at the beginning, then remove that from the code below.
And just double-check, are you sure you pasted the exact same code as below?
Here's your {{ gift_card.balance | money_without_trailing_zeros }} {{shop.name}} gift card:{{ {{ gift_card.url }} {{ gift_card.url | replace: "checkout.shopify.com", "www.yoursite.com" }} . {% if gift_card.expires_on %} This gift card expires on {{ gift_card.expires_on }} {% endif%}
here's the code that i have pasted
Here's your {{ gift_card.balance | money_without_trailing_zeros }} {{shop.name}} gift card:{{ {{ gift_card.url }} {{ gift_card.url | replace: "checkout.shopify.com", "www.pashionera.com" }} {% if gift_card.expires_on %} This gift card expires on {{ gift_card.expires_on }} {% endif%}
here's the code that i have pasted
Here's your {{ gift_card.balance | money_without_trailing_zeros }} {{shop.name}} gift card:{{ {{ gift_card.url }} {{ gift_card.url | replace: "checkout.shopify.com", "www.pashionera.com" }} {% if gift_card.expires_on %} This gift card expires on {{ gift_card.expires_on }} {% endif%}
Is this what I replace??
@Calikim wrote:
Is this what I replace??
No.
You need to find:
<a href="{{ gift_card.url }}"
and replace that with:
<a href="{{ gift_card.url | replace: "checkout.shopify.com", "www.YOURSITEHERE.com" }}"
Hi we have a huge problems with the gift cards.
We translate our site with a translation app and German Users are redirected to
domain.com/DE/
Now Gift Card Visitors are also redirected to checkout.shopify.com/de/ and this page does not exist so the users end up on an error page from shopify.
Any idea how to solve this?
Perfect @TechSolver
Thanks a lot for a clear explanation of this. Do you use paypal or Revolut? I would like to tip you a small amount for solving this for me and everyone else. I hope others will follow, too. Thanks again, great support fixing Shopify's problems that I believe should be fixed by them not us.
Hi there. I've been trying to use steps on this forum but have hit a brick wall. I edited the code, did a test purchase and was met with a 'Page not found'.
Initially, I was looking to change the 'START SHOPPING' button on the gift card page as I use Shopify on our WordPress site and the button directs to the Shopify store (which we don't use). Am I following the correct forum for this? Any help would be greatly appreciated. Thanks!
Any luck with this? Having the same issue. Any help would be greatly appreciated.
It's really worked !!! I have changed it for my store! thanks so much!
No problem! Glad I helped.
My CashApp is $techeroo if you'd like to leave a tip.
Hi everyone! I tried doing this but it's not working for me it seems... now the "explore our products" button on the gift card page is just redirecting to that same page. Any ideas?
See here: https://checkout.shopify.com/gift_cards/31846727817/feccb715e37667fa56cf3c5a5bd960f3
Thank you!
Hey macrory, the url change works fine for the e-mail but not working for the SMS. Can you please help me out with this as it is redirecting to the checkout.shopify.com.
I ran into this issue on my shop (we had a larger issue where styles weren't loading - our issue was due to Gift Card specific CSS files not being present).
Unless maintaining branding on the Gift Card landing page is extremely important, I'd caution against doing this because:
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025