Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hey,
I'm working on a theme with a transitions manager called Highway.JS. This means no page reloading, which also means no reloading of the product page which renders the dynamic checkout button. My question is if there's any way to load the dynamic checkout button through JS, so I can include that in my own javascript to render it manually instead of Shopify rendering it itself through a page load.
Thank you!
Yes. Use
Shopify.PaymentButton.init()
Thank you!
Haven't tried it out yet, but I'm wondering how you found out?
I was also looking for a solution (that’s how I found your thread) because I was using BarbaJS, and I finally found by checking the Shopify object in the console 🤓.
Almost a year later and now I finally had some time to check it out! Whenever I run Shopify.PaymentButton.init(), the button renders disabled and there are no event handlers to navigate to the payment screen. Any way to fix this?
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025