Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Is there any way to define a return url when creating a checkout through the custom storefront API? When we redirect our customers to the Shopify checkout we want the users to have an easy way to return to the site, but when creating a checkout through this API the checkout is stripped of the "Return to cart"-link and the logo up top in the checkout is only a "#"-href.
I mean, it's pretty much standard in these kind of situations, when you direct a user away from your site (like oauth-authentication), to be able to define a return URL. Is there no way to do this here? If no: Shopify devs, will this be a feature in a near future? It should be a simple, and key-, feature to add..
I don't belive there is a way of adding that sort of attribute.
If you are working on a Shopify plus store, I would recommend using JS to change the # attribute to a link back to your site, which is what I have done on our stores.
Thanks, yeah I believe it to be impossible to I'm afraid.. I already do inject some javascript in the order confirmation page to do just that, but does plus-members also have the ability to inject javascript into the checkoutflow?
Correct, being on shopify plus alows you to have access to a checkout.liquid file
Should you be successfull, this is the snippet that I use:
try { var changeLogoURL = function() { // Add proper link to cart logo var logoNodes = document.querySelectorAll('.logo'); logoNodes.forEach(function(node){ node.href = 'https://www.example.com/'; }); } document.addEventListener('DOMContentLoaded', changeLogoURL); } catch (e) { console.error(e); }
Perfect, thanks a bunch! I will recommend my client to upgrade to plus immediately!
However I still do hope Shopify adds this quite basic functionality 🙂