Top

Remove a Specific Number from the Interval Drop-down

If you would like to make a subscription a specific recurring interval, like every 6 months, for example, you can do so by following these steps:

  1. From "Shopify Admin", select Online Store.

    Online Store 

  2. Select Actions.

    Actions 

  3. Select Edit code.

    Edit code 

  4. Under "Templates", select product.liquid.

    Note: If your theme contains sections, this change may need to be made in product-template.liquid instead.

    select product.liquid

  5. Copy and paste this code to the bottom of the file to remove the number 1 to 5:
    <script>
    jQuery(window).bind("load", function () {
    jQuery('.frequency_num option:lt(5)').remove();
    });
    </script>

    If you want to remove specific numbers instead of an entire range, use this code for each number you wish to remove:

    jQuery(".frequency_num option[value='2']").remove();

    So, for example, to remove the numbers 2 and 3, the code would look like this:

    <script>
    jQuery(window).bind("load", function () { 
    jQuery(".frequency_num option[value='2']").remove();
    jQuery(".frequency_num option[value='3']").remove();
    });</script>

    Copy and paste code 

  6. Select Save.

    Select Save 

That's it!

Note: This will remove the numbers from the interval drop-down on all instances of the recurring widget.  If you just wanted this for a particular product then you could create an alternative product page template with the script and then assign it to the specific products in Shopify admin.

Next Steps