Eren Labs JOURNAL TR
WooCommerce Errors

“Please choose product options by visiting …” in WooCommerce: why the variation is missing

WooCommerce shows this when a variable product reaches the cart without saying which variation the shopper wants. Here are the ways that happens, including the "is a required field" notice for variations set to Any.

In this article12 sections

This notice means someone tried to add a variable product, such as a hoodie that comes in sizes, without saying which size. A variable product can’t go in the cart itself. Only one of its variations can. WooCommerce sends the shopper back to the product page to choose.

Shoppers rarely cause it by hand. It usually comes from a link or button that points at the parent product, or from the product page’s option form not working.

The exact message#

Please choose product options by visiting Hoodie.

The same failure can also read:

  • Please choose product options for Hoodie.
  • Please choose product options…
  • Size is a required field
  • Size and Color are required fields
  • Missing attributes for variable product.
  • Missing variation data for variable product. Size is a required field

Who sees it: Shoppers, as an error notice after an add-to-cart request for a variable product. In the first wording the product name is a link to its page; the shorter “for Hoodie” wording is used when the request came from the product page itself. “Size is a required field” appears when a variation was named but one of its options wasn’t. The two “Missing …” wordings are the Store API’s, used by block-based buttons.

What WooCommerce checks#

A variable product page sends three things when the shopper presses Add to cart: the parent product ID, a variation_id, and one value per option (for example attribute_size=M). A small script fills in variation_id once every option is chosen. WooCommerce then checks:

  1. Is there a variation ID? If not, the shopper sees this message.
  2. Does every option of that variation have a value? A variation set to Any Size needs the size to come from the request. If it is missing, the shopper sees “Size is a required field”.

WooCommerce checks the options one by one. A value that doesn’t fit the variation stops the request right away with “Invalid value posted for …”, so a missing Any value is only reported when every sent value is valid. Whether the variation can be bought and is in stock is checked after that.

Causes and how to fix each one#

A hand-made link like ?add-to-cart=123, a page builder button, a menu item or a theme’s quick-add button that uses the variable product’s ID can’t name a variation. WooCommerce’s own shop pages show Select options for variable products, which goes to the product page instead.

Check: Find the link or button the shopper used and look at the ID in it. Open that ID in the admin: if the Product data type is Variable product, this is the cause.

Fix: Link to the product page instead, or add the variation and its options to the link, for example ?add-to-cart=123&variation_id=456&attribute_size=M.

2. The option form’s script didn’t run#

On the product page, the variation ID is filled in by WooCommerce’s variation script. If that script fails or never loads, the form still submits, but with a variation ID of 0, and the shopper gets the “for Hoodie” wording. Script optimization plugins that delay or combine JavaScript, a JavaScript error from another plugin, or a theme that rebuilds the product form can all stop it.

Check: Open the product page, choose options and look below the dropdowns. If the Clear link doesn’t appear and the Add to cart button stays greyed out after you choose every option, the script isn’t running. The browser’s developer console shows the JavaScript error. Your browser’s developer console will show any JavaScript error.

Fix: Exclude WooCommerce’s add-to-cart-variation script and jQuery from delay or combine settings, then clear caches. If an error names another plugin, deal with that plugin.

3. A variation is set to Any and the value didn’t arrive#

A variation whose option reads Any Size… matches every size, so the size must come from the shopper’s choice. Links that only name the variation leave it out, including a variation’s own add-to-cart URL and the [add_to_cart_url] shortcode given a variation ID. The result is “Size is a required field”, or “Size and Color are required fields” for two.

Check: Open the Variations tab and expand the variation. If any dropdown at the top shows Any …, this variation needs that value in every link.

Fix: Set the variation to a specific value, creating one variation per value, or add the value to the link, for example &attribute_size=M (attribute_pa_size for a global attribute, using the term slug).

4. A plugin adds variable products without a variation#

Wishlist, quick-order, bundle and reorder plugins can call the cart with the parent product ID alone. WooCommerce’s AJAX add-to-cart sends the shopper to the product page when that fails, so the notice appears there, after a jump the shopper didn’t expect.

Check: Note where the shopper pressed the button. If it was in a widget, popup or list added by a plugin, try the same with that plugin turned off for your session using Health Check & Troubleshooting.

Fix: Use the plugin’s setting for variable products, or contact its developer.

Quick reference#

CauseHow to checkFix
A link or button points at the parent productFind the link or button the shopper used and look at the ID in it. Open that ID in the admin: if the Product data type is Variable product, this is the cause.Link to the product page instead, or add the variation and its options to the link, for example ?add-to-cart=123&variation_id=456&attribute_size=M.
The option form's script didn't runOpen the product page, choose options and look below the dropdowns. If the Clear link doesn't appear and the Add to cart button stays greyed out after you choose every option, the script isn't running. The browser's developer console shows the JavaScript error. Your browser's developer console will show any JavaScript error.Exclude WooCommerce's add-to-cart-variation script and jQuery from delay or combine settings, then clear caches. If an error names another plugin, deal with that plugin.
A variation is set to Any and the value didn't arriveOpen the Variations tab and expand the variation. If any dropdown at the top shows Any …, this variation needs that value in every link.Set the variation to a specific value, creating one variation per value, or add the value to the link, for example &attribute_size=M (attribute_pa_size for a global attribute, using the term slug).
A plugin adds variable products without a variationNote where the shopper pressed the button. If it was in a widget, popup or list added by a plugin, try the same with that plugin turned off for your session using Health Check & Troubleshooting.Use the plugin's setting for variable products, or contact its developer.

Reproduced on a test store#

We set up each case below on a clean WooCommerce 11.2.1 store on 6 November 2026 and recorded exactly what it showed.

What we didWhat WooCommerce showed
Variable product Hoodie, custom attribute Size: S, M (Used for variations), both variations priced 10. Logged out. Request /shop/?add-to-cart=<parent id>.Please choose product options by visiting Hoodie.
Same product. POST to the product permalink with add-to-cart=<parent>, variation_id=0, attribute_size=S, quantity=1 (what the form sends when its script didn't run).Please choose product options for Hoodie.
Variable product with one variation set to Any Size, priced 10. Request ?add-to-cart=<parent>&variation_id=<variation>.Size is a required field
Same, adding &attribute_size=M to the link.No message. The product was added to the cart.
Hoodie as above. POST /wc/store/v1/cart/add-item with id=<parent> and no variation data.Missing attributes for variable product.
The Any Size variation. POST /wc/store/v1/cart/add-item with id=<variation> and no variation data.Missing variation data for variable product. Size is a required field

For developers#

The form handler is WC_Form_Handler::add_to_cart_handler_variable() and the check inside the cart is WC_Cart::add_to_cart(). The “Please choose product options…” wording sits on a branch for a variation that arrives without a variation ID. In 11.2.1, the cart converts a variation ID passed as the product ID before that point, so this text is unlikely from WooCommerce’s own paths. If you see it, look for code calling the cart in an unusual way. To see which options a variation leaves open, run this in wp shell:

print_r( wc_get_product_variation_attributes( 456 ) ); // empty value = Any

A custom handler can be routed with woocommerce_add_to_cart_handler. The Store API error codes are woocommerce_rest_missing_attributes and woocommerce_rest_missing_variation_data.

Where this lives in WooCommerce 11.2.1:

  • includes/class-wc-form-handler.php, WC_Form_Handler::add_to_cart_handler_variable: No variation_id for a variable product: “for <name>” when the request URL is the product’s own page, otherwise “by visiting <link>”.
  • includes/class-wc-cart.php, WC_Cart::add_to_cart: Throws the “by visiting” wording for a variable product with no variation ID, and “is a required field” when an Any attribute has no posted value.
  • includes/class-wc-ajax.php, WC_AJAX::add_to_cart: On failure returns an error and the product URL. The add-to-cart script then sends the shopper to that page, where the notice is shown.
  • includes/class-wc-product-variation.php, WC_Product_Variation::add_to_cart_url: A variation’s add-to-cart URL carries variation_id, add-to-cart and the variation’s fixed attribute values, but no value for an attribute set to Any.
  • src/StoreApi/Utilities/CartController.php, CartController::get_variation_id_from_variation_data: Block wording when the attributes sent don’t identify a variation.
  • src/StoreApi/Utilities/CartController.php, CartController::parse_variation_data: Block wording when a variation with an Any attribute arrives without a value for it.

Back to the WooCommerce error reference.

Frequently asked questions#


Can I add a variable product to the cart with a link?

Only by naming the variation. Use ?add-to-cart=PARENT_ID&variation_id=VARIATION_ID, plus attribute_ values for any option the variation leaves as Any.


Why does this happen even after choosing options on the product page?

The page’s variation script didn’t fill in the variation ID, usually because a script optimization setting or a JavaScript error stopped it. The form then submits without a variation.


What does "Size is a required field" mean when there is no Size box?

The variation is set to Any Size, and the request that reached the cart didn’t include a size. Give the variation a fixed size, or include the size in the link.


Why does the shopper end up on the product page?

WooCommerce’s AJAX add-to-cart sends the shopper to the product page when adding fails, so they can see the notice and choose options.


What do "Missing attributes for variable product" and "Missing variation data" mean?

They are the block-based wordings for the same problems: no variation could be identified, or a variation set to Any arrived without its value.


More in WooCommerce Errors

Keep exploring

All articles