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 rental intent tokens, 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:
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.
Advanced calendar settings
You can use JSON object/array matchers for additional control over date selection, from the app block settings, for example:-
{"dayOfWeek": 0}to block of Sundays -
"2025-01-10"to block the 10th of Jan -
{"from": "2025-01-10", "to": "2025-02-10"}to block 10th - 15th Jan -
[{"dayOfWeek": 0}, "2025-01-05", {"from": "2025-01-10", "to": "2025-02-10"}]to do a combination of all of the above
Troubleshooting
Supercycle uses a
It also supports AJAX carts by injecting rental data before submission.
MutationObserver to maintain button state even if other scripts modify it.It also supports AJAX carts by injecting rental data before submission.
Variant ID input not detected
Variant ID input not detected
By default, Supercycle finds the variant ID input using
If your theme doesn’t follow this pattern, Supercycle may not detect it automatically.To resolve this, add theTo find all potential variant ID inputs, run this in your browser console:
[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.Add to cart form not detected
Add to cart form not detected
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: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
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.
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:| Theme type | Typical file locations |
|---|---|
| Online Store 2.0 | sections/product-template.liquid, sections/main-product.liquid |
| Legacy themes | templates/product.liquid, snippets/product-form.liquid |
Methods block not showing
Methods block not showing
Ensure the Supercycle app embed is enabled, then hard refresh the page.
Empty methods app block
Empty methods app block
Confirm the product is imported into Supercycle and methods are enabled for it.
Price not updating on variant change
Price not updating on variant change
Ensure your theme updates
product.selected_or_first_available_variantAdding the methods app block to custom or legacy themes
Adding the methods app block to custom or legacy themes
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:
Open one of these files depending on your theme:
sections/main-product.liquidsections/product-template.liquidtemplates/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.
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
Can I style the methods app block?
Can I style the methods app block?
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.