“Please select some product options before adding this product to your cart” in WooCommerce: what the popup means
This is a browser popup from WooCommerce's variation script, shown when Add to cart is pressed before a variation has been identified. Usually an option is still unchosen, but missing combinations and broken scripts cause it too.
In this article11 sections
This popup comes from the shopper’s browser, not from the server. WooCommerce greys out the Add to cart button on a variable product until it knows exactly which variation the shopper wants. Pressing the grey button shows this message instead of adding anything.
The button turns grey for more reasons than an empty dropdown. If shoppers insist they chose everything, one of the later causes is the answer.
The exact message#
Please select some product options before adding this product to your cart.
The same failure can also read:
- Your selection has been reset. Please select some product options before adding this product to your cart.
- Please select product attributes before adding to cart.
Who sees it: Shoppers on a variable product page with the classic option dropdowns, as a browser alert box when they press the greyed-out Add to cart button. Nothing is sent to the store. The first variant is announced to screen readers after the Clear link is pressed and is normally invisible. The second is the Add to Cart with Options block’s wording.
What WooCommerce checks#
Each time an option changes, WooCommerce’s variation script runs these steps:
- If any dropdown still shows Choose an option, the button stays grey.
- When every dropdown has a value, it looks for a variation that matches. For products with up to 30 variations the list is already in the page. Above 30, it asks the store.
- If no enabled variation matches, the button stays grey and a “Sorry, no products matched your selection” box appears.
- If one matches, the script shows its price and stock, then enables the button about 300 milliseconds later.
A grey button that is pressed shows one of two popups. This one means step 1, 3 or 4 hasn’t finished. If a variation was found but can’t be bought, the popup is “Sorry, this product is unavailable” instead.
Causes and how to fix each one#
1. An option is still unchosen#
The common case. One dropdown, often the second, still says Choose an option. Themes that style dropdowns as buttons or swatches can make an unchosen option easy to miss on a phone.
Check: Open the product page, choose every option, and confirm a price appears under the dropdowns before pressing Add to cart.
Fix: Nothing is broken. Default form values on the Variations tab can preselect the most popular choice for shoppers.
2. The combination doesn’t exist (products with more than 30 variations)#
For products with up to 30 variations, WooCommerce removes impossible choices from the dropdowns as the shopper picks. Above 30, counting disabled variations, it shows every value and checks each combination with the store. A combination that was never created, was deleted or is disabled leads to “Sorry, no products matched your selection”, and the button stays grey.
Check: Count the variations on the Variations tab. If there are more than 30, look for the combination the shopper chose.
Fix: Create the missing variation, or enable it. Shops with gaps on purpose can raise the threshold with the woocommerce_ajax_variation_threshold filter so the dropdowns filter themselves again.
3. The shopper pressed before the form finished#
After the last option is chosen, the button only turns active once the variation’s details are shown, which takes about 300 milliseconds. On large products the script also waits for an answer from the store first. A quick tap in that gap gets this popup even though the choice is complete.
Check: Choose all options, wait until the price for the variation appears, then press the button. If that works, timing was the cause.
Fix: Usually nothing. If the store is slow to answer on big products, a faster host or fewer variations per product shortens the wait.
4. The variation template or script is broken#
The script fills in the variation details from a small template that WooCommerce prints in the page. If a theme overrides single-product/add-to-cart/variation.php without that template, or a JavaScript error from another plugin stops the script, a match is found but the button is never enabled. A swatches plugin that hides the dropdowns but doesn’t update them has the same effect.
Check: Open the browser’s developer console on the product page, choose all options and look for a red error. Then switch to a default theme for your session only, with the Health Check & Troubleshooting plugin.
Fix: Update or remove the theme’s variation.php override, or fix the plugin named in the error.
Quick reference#
| Cause | How to check | Fix |
|---|---|---|
| An option is still unchosen | Open the product page, choose every option, and confirm a price appears under the dropdowns before pressing Add to cart. | Nothing is broken. Default form values on the Variations tab can preselect the most popular choice for shoppers. |
| The combination doesn't exist (products with more than 30 variations) | Count the variations on the Variations tab. If there are more than 30, look for the combination the shopper chose. | Create the missing variation, or enable it. Shops with gaps on purpose can raise the threshold with the woocommerce_ajax_variation_threshold filter so the dropdowns filter themselves again. |
| The shopper pressed before the form finished | Choose all options, wait until the price for the variation appears, then press the button. If that works, timing was the cause. | Usually nothing. If the store is slow to answer on big products, a faster host or fewer variations per product shortens the wait. |
| The variation template or script is broken | Open the browser's developer console on the product page, choose all options and look for a red error. Then switch to a default theme for your session only, with the Health Check & Troubleshooting plugin. | Update or remove the theme's variation.php override, or fix the plugin named in the error. |
For developers#
The popup is wc_add_to_cart_variation_params.i18n_make_a_selection_text, shown by onAddToCart when the button has the wc-variation-selection-needed class. The script fires found_variation, show_variation and hide_variation on the form, which helps when debugging a theme:
jQuery( '.variations_form' ).on( 'found_variation show_variation hide_variation', function ( e ) {
console.log( e.type );
} );If you see found_variation without show_variation, something failed in between, often a missing tmpl-variation-template script tag. To change when the page switches to asking the store, filter woocommerce_ajax_variation_threshold (default 30).
Where this lives in WooCommerce 11.2.1:
assets/js/frontend/add-to-cart-variation.js,VariationForm.prototype.onAddToCart: If the button has the disabled and wc-variation-selection-needed classes, cancels the click and shows the message with window.alert.assets/js/frontend/add-to-cart-variation.js,VariationForm.prototype.onFindVariation: Hides the variation (which disables the button) when not every option is chosen, or when no variation matches the full choice.assets/js/frontend/add-to-cart-variation.js,VariationForm.prototype.onFoundVariation: Enables the button 300 ms after a matching variation is found, by triggering show_variation.includes/class-wc-frontend-scripts.php,WC_Frontend_Scripts::get_script_data: Defines the text as i18n_make_a_selection_text, and the reset text as i18n_reset_alert_text.includes/wc-template-functions.php,woocommerce_variable_add_to_cart: Embeds variation data in the page when the product has 30 or fewer variations (woocommerce_ajax_variation_threshold). Above that, the script asks the server for each combination.src/Blocks/BlockTypes/AddToCartWithOptions/AddToCartWithOptions.php,AddToCartWithOptions::render: Block wording, used when the chosen attributes don’t identify a variation.
Related WooCommerce errors#
- Sorry, this product is unavailable. Please choose a different combination.
- Please choose product options by visiting Hoodie.
- Invalid value posted for Size
Back to the WooCommerce error reference.
Frequently asked questions#
Why does the popup appear when every option is chosen?
Either that combination has no enabled variation, the button was pressed before the variation’s details loaded, or a script error stopped the button from turning on.
Why do some products filter the dropdowns and others don't?
Products with 30 or fewer variations, counting disabled ones, put their enabled, priced variations in the page and filter the dropdowns as you choose. Larger products check each combination with the store instead.
What does "Your selection has been reset" mean?
It is a message for screen reader users, announced after the Clear link is pressed. If it shows on screen, the theme or a CSS optimization plugin has removed the styles that hide screen-reader text.
Is this the same as "Please choose product options"?
No. That one is a server notice after a request without a variation reached the cart. This popup stops the request in the browser before it is sent.
Can I change the text of the popup?
It is a translatable WooCommerce string, so a translation plugin can change it. In code, the woocommerce_get_script_data filter receives it as i18n_make_a_selection_text for the wc-add-to-cart-variation handle.