Hide the One-time purchase / Preorder selector on product pages
Three ways to remove the purchase option selector your theme shows on preorder products, and which one to use if you also sell subscriptions.
Last updated
Some product pages show a choice like One-time purchase / Preorder above the button. This selector isn’t part of STOQ. Your theme draws it, or a subscription app’s block in your theme does (for example the Shopify Subscriptions app block).
Here’s why it appears. STOQ adds the preorder to your products as a Shopify purchase option (a selling plan). Themes and subscription blocks list every purchase option a product has, so they show the preorder too. The option is labelled with your offer’s Offer name (Preorder by default).
You don’t need this selector for preorders to work. STOQ’s Preorder button adds the preorder purchase option to the cart by itself, so you can safely hide the selector.
Choose a way
Section titled “Choose a way”| Way | Best for | Hides subscriptions too? |
|---|---|---|
| 1. Turn off the selector in your theme | Stores that don’t sell subscriptions | Yes |
| 2. Hide it with CSS | Themes with no setting to turn it off, and no subscriptions | Yes |
| 3. Hide it only on preorder products with JavaScript | Stores that also sell subscriptions | No |
If you sell subscriptions, use way 3. Ways 1 and 2 remove the selector from every product, so customers can no longer choose a subscription.
1. Turn off the selector in your theme
Section titled “1. Turn off the selector in your theme”-
Open the product template
- In your Shopify admin’s left menu, click Online Store, then Themes.
- Click Edit theme on the theme you’re using.
- In the template dropdown at the top of the editor, choose Products to open the product page.
-
Turn off the selector
In the left sidebar, find the block that shows the selector:
- Your theme’s own selector: click the Subscriptions block, then on the right turn off Enable subscription selectors.
- A subscription app’s block (for example Shopify Subscriptions): click the block, then click the eye icon next to it to hide it, or Remove block at the bottom of its settings.
Click Save.
Block and setting names come from your theme or app, so they can differ slightly. If your product page uses more than one template, repeat this on each one.
2. Hide it with CSS
Section titled “2. Hide it with CSS”Use this when your theme has no setting to turn the selector off. Like way 1, it hides the selector on every product, so don’t use it if you sell subscriptions.
-
Find the selector’s class name
Open a preorder product on your storefront, right-click the selector, and choose Inspect. Note the class name on the element that wraps the whole selector. The Shopify Subscriptions app block uses
shopify_subscriptions_fieldset. See Find CSS selectors for help. -
Add the CSS to your theme
- In your Shopify admin’s left menu, click Online Store, then Themes.
- Click Edit theme on the theme you’re using.
- In the editor’s left sidebar, click the gear icon for Theme settings, then open Custom CSS.
- Paste this rule, swapping in your class name if it’s different:
.shopify_subscriptions_fieldset {display: none !important;}- Click Save, then reload a preorder product to check the selector is gone.
3. Hide it only on preorder products with JavaScript
Section titled “3. Hide it only on preorder products with JavaScript”If you sell subscriptions, this script hides the selector only on products that have the preorder option. Subscription products that aren’t on preorder keep their selector.
-
Add a Custom Liquid block to the product template
- In your Shopify admin’s left menu, click Online Store, then Themes.
- Click Edit theme on the theme you’re using.
- In the template dropdown at the top of the editor, choose Products.
- In the left sidebar, under the product information section, click Add block and choose Custom Liquid.
-
Paste the script
In the block’s Liquid field, paste this script:
<script>(function () {// Your offer's Offer name, exactly as customers see itvar OFFER_NAME = 'Preorder';// The class name of the element that wraps the whole selectorvar SELECTOR = '.shopify_subscriptions_fieldset';function optionLabel(input) {var label = input.getAttribute('aria-label');if (!label && input.labels && input.labels[0]) label = input.labels[0].textContent;return (label || '').trim();}function hidePreorderSelectors() {document.querySelectorAll(SELECTOR).forEach(function (box) {var hasPreorder = Array.prototype.some.call(box.querySelectorAll('input'), function (input) {return optionLabel(input).indexOf(OFFER_NAME) === 0;});if (hasPreorder) box.style.setProperty('display', 'none', 'important');});}hidePreorderSelectors();document.addEventListener('DOMContentLoaded', hidePreorderSelectors);new MutationObserver(hidePreorderSelectors).observe(document.documentElement, { childList: true, subtree: true });})();</script> -
Set your offer name and class name
Change the two values at the top of the script if yours are different:
OFFER_NAME: the Offer name of your preorder offer. To find it, in the STOQ app click Preorders, then the Offers tab, click the offer, click Customize, then Widget. It’s under Settings. If your offers use different offer names, use the words they all start with.SELECTOR: the class name of the selector, found the same way as in way 2.
Click Save, then check a preorder product (the selector is hidden) and a subscription product (the selector still shows).
If your theme shows the selector in quick-buy pop-ups or featured product sections too, add the same block to those sections, or ask your theme developer to add the script to the theme.
Troubleshooting
Section titled “Troubleshooting”The selector still shows after adding the CSS or script
- Check the class name. It must match the element that wraps the whole selector on your theme, including the leading dot in the script’s
SELECTORvalue. - For the script, check
OFFER_NAMEmatches the start of the preorder option’s label on the product page, including capital letters. - Clear your browser cache or open the product in a private window, then reload.
The script hides the selector on subscription products too
Those products are probably also in a preorder offer, so they carry the preorder option. Remove them from the offer if they shouldn’t be on preorder. See Add products to an offer.
The selector still shows after I turned on Use without purchase option
Use without purchase option stops STOQ from adding the preorder purchase option to orders, but the option stays attached to the products in the offer, so themes can still list it. Use one of the three ways above to hide it.
I can't find the setting or don't want to edit my theme
STOQ support can help. Open the purple chat icon in the bottom-right of the STOQ app and choose Talk to a human. They can request collaborator access to your store and make the change for you.
Is the selector a STOQ feature?
No. STOQ shows the Preorder button, the preorder badge and its other preorder elements, but the purchase option selector comes from your theme or a subscription app. STOQ has no setting to turn it on or off. See What STOQ shows on your storefront.
Do preorders still work if I hide the selector?
Yes. When a customer clicks STOQ’s Preorder button, STOQ adds the preorder purchase option to the cart itself, so the customer doesn’t need to pick it.
Can I rename the Preorder option instead of hiding it?
Yes. The option uses your offer’s Offer name. Change it in the offer’s Widget settings, under Settings. The new name also shows in the cart and at checkout. See Design the preorder widget. If you use the script, update OFFER_NAME to match.
Can a customer preorder and subscribe to the same product?
No. Shopify allows one purchase option per item in the cart, so a preorder item can’t also be a subscription. See Preorders and subscription apps.
Related guides
Section titled “Related guides”Thanks for letting us know.
Still stuck? Ask Quinn or chat with support