Skip to main content
Supercycle automatically integrates with your theme’s product form. If your theme uses custom markup for product forms or variant inputs, follow this guide to help Supercycle correctly detect and control these elements.

How the methods app block works

The Methods app block takes over your theme’s add to cart button using a component called ProductContextSync. This component automatically detects, monitors, and controls your theme’s product form.
1

Syncs the variant ID

Watches your theme’s variant input field and keeps it in sync with the active variant.
2

Injects hidden inputs

Adds rental-specific data such as selling plans and properties to your form.
3

Controls the button state

Enables or disables the button based on rental validation.
The button stays disabled when:
  • No method is selected
  • The product is out of stock
  • The customer has insufficient credits
The takeover is non-destructive, it only adds hidden inputs and toggles button states without modifying your theme’s existing structure.

Storefront calendar blocked dates

Merchants manage storefront calendar rules from SettingsChannelsOnline store in the Supercycle admin. See Date picker blocked dates for block types, start vs end targeting, and examples. Those admin rules feed the Methods app block calendar on the online store. When a customer picks dates, rentals whose start or end matches a blocked rule are rejected — duration options that would land on a blocked boundary are disabled too.
Date picker blocks affect selectable dates on the storefront calendar only. To remove availability for a product, variant, or item across the whole store, use Blocked dates instead. Opening hours can also block pick-up and drop-off dates when time selection is on.

Legacy theme JSON matchers

The Methods app block still exposes Unavailable start dates and Unavailable end dates theme settings. Both accept DayPicker matcher JSON and apply independently of admin rules (existing JSON continues to work and stacks additively). These fields are deprecated — use Date picker blocked dates for new rules.
  • Unavailable start dates — blocks dates from being chosen as a rental start date.
  • Unavailable end dates — blocks dates from being chosen as a rental end date, independently of start dates.
Both fields accept the same JSON object/array matcher format shown below.

Block All Mondays

Note: Day of week values are 0 = Sunday, 1 = Monday, 2 = Tuesday, …, 6 = Saturday

Block Saturdays and Sundays (Weekends)

Block a Specific Date (January 1, 2026)

Block a Date Range (December 22-27, 2025)

Combine Multiple Rules

You can combine multiple matchers in an array to block multiple conditions:

Format Reference

  • Day of week: {"dayOfWeek": [0, 1, 2, ...]} - Blocks specific days of the week (0=Sunday, 6=Saturday)
  • Single date: {"from": "YYYY-MM-DD", "to": "YYYY-MM-DD"} - Blocks a specific date (use same date for both from and to)
  • Date range: {"from": "YYYY-MM-DD", "to": "YYYY-MM-DD"} - Blocks a range of dates
  • After date: {"after": Date} - Blocks all dates after a specific date
  • Multiple matchers: Use an array [...] to combine multiple rules

Block Dates Dynamically

To block dates dynamically (e.g. limit bookings to a maximum of 6 weeks in advance), add this script to your product template or a custom liquid block:
This sets a rolling window that blocks all dates beyond 6 weeks from today. Adjust weeksToBlock to change the booking window. window.supercycleDisabledMatchers applies to both start and end dates.
By placing this code in a custom liquid block instead of the main product template, you can apply different blockout rules to specific products or product templates. This allows you to have different booking windows for different product types.

Troubleshooting

Supercycle uses a MutationObserver to maintain button state even if other scripts modify it.
It also supports AJAX carts by injecting rental data before submission.
By default, Supercycle finds the variant ID input using [name='id'].
If your theme doesn’t follow this pattern, Supercycle may not detect it automatically.
To resolve this, add the supercycle-variant-id-input attribute to the input element whose value updates when variants change.
To find all potential variant ID inputs, run this in your browser console:
Supercycle looks for your theme’s add to cart form using multiple selectors.
If none match, the app block won’t be able to sync or control your button.
Supercycle uses the following detection priority order:
1

Forms with `supercycle-add-to-cart-form` attribute

This is the most reliable option.
2

Forms with `data-type='add-to-cart-form'`

Alternative detection used in many themes.
3

Forms with `data-product-form`

Common fallback for Online Store 2.0 themes.
4

Last eligible form with `/cart/add` action

Used only when none of the above are found.
If Supercycle cannot find your form automatically, add this attribute to your product form:
Alternatively, if the theme doesn’t use a liquid form:
Make sure your form’s action ends with /cart/add and includes a <button type="submit"> element.The add to cart form is usually located in one of these files:
Ensure the Supercycle app embed is enabled, then hard refresh the page. If the problem persists, the theme you are using might not be compatible with the app blocks out of the box. Contact support at [email protected] so we can fix it for you.
Confirm the product is imported into Supercycle and methods are enabled for it.
Ensure your theme updates product.selected_or_first_available_variant
If your theme doesn’t support app blocks, you can still show the methods UI by adding this snippet directly to your product template code.
1

Open your product template

Go to Online Store → Themes → … → Edit code.
Open one of these files depending on your theme:
  • sections/main-product.liquid
  • sections/product-template.liquid
  • templates/product.liquid (very old themes)
2

Find the add to cart form and the title

Locate where your product title and add to cart button are in the template.
The methods component should go between these two elements.
3

Paste the methods component

Add the snippet below at the chosen spot.
4

Save and test

Save, then preview a product with Supercycle methods enabled. Change variants to confirm the price and options update.

FAQ

Yes. Use the custom_css setting inside data-settings for minor overrides. For larger design changes, use your theme’s stylesheet and target the methods block CSS classes.
Yes. Each option element exposes its backend name as data-supercycle-option-name, so you can hide or restyle specific options from CSS or JavaScript. See Target method options by name for examples.