Selling plan custom widget

Selling plan custom widget

scrummitowels
Shopify Partner
8 0 1

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 

Replies 2 (2)

Travishead
Visitor
3 0 0

@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.

 

namphan
Shopify Partner
1330 164 199

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 -%}
Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? [email protected]