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's admin, select Online Store.

    Online Store

  2. Select 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:
    jQuery(window).bind("load", function () {
    jQuery('.frequency_num option:lt(5)').remove();

    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:

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

    Copy and paste code

  6. Select Save.

    Select Save

That's it! This will remove the numbers from the interval drop-down on all instances of the subscriptions 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's admin.

Next Steps:

Blog Posts:

0 out of 0 found this helpful



Please sign in to leave a comment.