Open the “Learn More” popup in the Subscription Widget using JavaScript
You may want to open the Recharge subscription widget’s Learn More popup from a separate button on your storefront, for example, to give customers more context about your subscription offering.
This guide explains how to open the “Learn More” pop-up in the Recharge subscription widget using JavaScript.
Instructions
Use the following JavaScript to open the “Learn More” pop-up from the widget:
const btn = document
.querySelector('recharge-subscription-widget')
.shadowRoot.querySelector('rc-learn-more')
.shadowRoot.querySelector('button');
btn.click();
Updated 1 day ago