Shopify themes, liquid, logos, and UX
Hi there,
Does anyone know a way to amend our code to default our custom widget to opening on subscribe and save instead of one time purchase?
Web page example - https://scrummi.com/products/original-waffle-towels
@scrummitowelsdollartree wrote:Hi there,
Does anyone know a way to amend our code to default our custom widget to opening on subscribe and save instead of one time purchase?
Web page example - https://scrummi.com/products/original-waffle-towels
You can adjust your code by setting the default option for your custom widget to "subscribe and save" instead of "one time purchase" in the widget's initialization parameters. Look for a property related to default selection and change it accordingly. If you need specific code examples, please share more details about the widget's implementation.
Hi @scrummitowels,
Please go to Actions > Edit code > Layout > theme.liquid file and paste the below code before </head>
{%- if request.page_type == 'product' -%}
<script>
const subscribeAndSave = document.querySelector('#subscribe-and-save');
if (subscribeAndSave) subscribeAndSave.click();
</script>
{%- endif -%}
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