All things Shopify and commerce
Hello
I hope you are doing well.
I have a question regarding the use of the Shopify checkout extension. If I log out from the Shopify Plus checkout page and then also log out on my headless site, will it still be possible to use the Shopify checkout extension? Additionally, I've installed a checkout extension app for custom validation in the shipping address fields for both the published live checkout and the one-page checkout. I have also included a screenshot of the checkout extension app.
Here is the URL to my Shopify Plus store with headless preview: https://checkoutdev.inpixelinc.com/?_ab=0&_fd=0&_sc=1&preview_theme_id=126589403184,
and here is the URL to the screenshot: https://prnt.sc/5K1En0Ci_ZvQ.
Could you please suggest an alternative way to modify the logout URL on the Shopify checkout page? Or, is there any other option available that allows us to redirect the customer to the logout page of the headless site when they log out from the checkout page?
I have tried to add the following JavaScript code using the checkout extension, but unfortunately, it's not working in the checkout extension and I am facing some errors. However, I have added the same code in the checkout.liquid, and it's working. But after upgrading the Shopify checkout extension, the code is not working with the checkout extension. So, I need a solution to fix this issue. Can you please suggest some solutions?
Here is code:
$(document).ready(function() {
$('.logged-in-customer-information__paragraph a').on("click", function() {
$.ajax('https://checkoutdev.inpixelinc.com/account/logout/')
.done(function() {
window.location.href = "https://targus.inpixelinc.com/account/logout";
});
return false;
});
});
Any updates regrading my questions. I am waiting your response.
Hi Monika! Have you figured this out yet? I am trying to figure out this issue as well
Hi Monika, unfortunately with the new Checkout Extensibility, we don't have access to the window or document objects anymore as the new Checkout exists inside of a web worker, so your code won't work. I don't have any solutions for you because I'm having similar issues on my site; I got here hoping that Shopify might have figured something out for these kinds of edge cases.
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025