"Please Choose Product Options by Visiting…": An Add to Cart Without a Variation
WooCommerce received an add to cart request for a variable product with no variation in it. The wording tells you where the request came from, and the fix is in whatever built the button or link.
"Please choose product options by visiting [product name]" means WooCommerce was asked to add a variable product to the cart without being told which variation. A variable product is only a container. What goes in the cart is one of its variations, and the request that triggered the notice carried the parent product's ID and no variation_id. WooCommerce refuses to guess. It adds the notice and a link to the product page, where the shopper can choose the options themselves.
The fix is never in WooCommerce settings. It is in whatever produced the request: a link, a button, a script or a form.
Read the exact wording
Recent WooCommerce versions use two forms of the message, and the difference tells you where to look:
| Notice | Raised by | Request came from |
|---|---|---|
| Please choose product options by visiting Product. | WC_Cart::add_to_cart() or the form handler |
A link, AJAX button or code outside the product page |
| Please choose product options for Product. | The form handler | The product page's own form, posted with no variation ID |
| The selected product isn't a variation of Product, please choose product options by visiting Product. | WC_Cart::add_to_cart() |
A variation ID that belongs to another product |
| Size is a required field | WC_Cart::add_to_cart() |
A variation with an "Any" attribute and no value sent for it |
In the classic add to cart handler, WooCommerce compares the request path with the product's permalink. When they match, you get the shorter "for Product" text. Any other origin gets the "by visiting" text with the link.
The trap: the notice shows up on the product page itself
The most confusing report goes like this: "I click Add to cart on the shop page and land on the product page with a message telling me to visit the product page." Here is what happened:
- A theme, page builder widget or plugin gave the variable product an AJAX add to cart button. WooCommerce itself does not. A variable product's loop button reads "Select options" and is a plain link.
- The button posted the parent ID to
?wc-ajax=add_to_cart. WC_Cart::add_to_cart()threw the "by visiting" exception, which WooCommerce turns into a stored notice.- The AJAX response returned
error: trueand the product URL, and the add to cart script redirected the browser there. - The product page printed the stored notice, with its link to the page the shopper was already on.
So when the notice appears on the product page, the culprit is on the page before it. Find the button that started it. In the browser's Network tab, the wc-ajax=add_to_cart request will show a product_id that is the parent's ID.
Cause 1: an add to cart link with the parent ID
Hand-built links such as /?add-to-cart=123 work for simple products and fail for variable ones. Typical sources:
- "Buy now" buttons in page builders or a theme's product shortcode output customised to use
add_to_cart_url()on every product type. - Links in marketing emails or landing pages copied from a simple product's pattern.
- Product feeds that build add to cart URLs from the parent ID. See Google Shopping for how variable products should be submitted, which is one item per variation.
Link to a specific variation by its own ID. WooCommerce detects that the ID is a variation and finds the parent itself:
/?add-to-cart=456&quantity=1
/?add-to-cart=456&attribute_pa_size=xl
The second form is needed when the variation has an attribute set to "Any". Each variation's ID is shown in its panel on the product's Variations tab.
Cause 2: the product page form lost its variation ID
The variation form contains a hidden variation_id input that the variation script fills when the shopper's choice matches a variation. If the script never runs, the form posts variation_id=0, and the shopper gets "Please choose product options for Product" even though they picked every option. Check for:
- A JavaScript error on the page. A missing jQuery dependency (jQuery is not defined) or a script delay feature that holds back
add-to-cart-variation.jsstops the form from working. - A theme override of
single-product/add-to-cart/variation-add-to-cart-button.phpthat dropped the hidden inputs. Compare it with the current template; WooCommerce System Status lists outdated overrides. - Swatch or quick-view plugins that replace the dropdowns but never update the hidden field.
The general symptoms of a broken variation form are covered under product variations.
Cause 3: your own code adds the parent
WC()->cart->add_to_cart( $parent_id ) throws the same exception and records the notice. That means a snippet that adds a free gift or a bundle item can put the message in front of a shopper who never touched the product. Pass the variation:
WC()->cart->add_to_cart( $parent_id, 1, $variation_id, wc_get_product_variation_attributes( $variation_id ) );
If the code decides whether an item may be added, that check belongs in woocommerce_add_to_cart_validation, which runs before the variable product check in the classic handler.
Common mistakes
- Making the variable product's loop button an AJAX button. It cannot work without a selection. Leave "Select options" as a link, or use a plugin that shows variation selectors in the loop and posts the variation ID.
- Fixing the wording instead of the request. Translating or filtering the notice leaves the cart empty and the shopper still unable to buy.
- Testing only while logged in as admin. A cached shop page can keep serving an old button after you fix it; purge the cache, as in excluding pages from cache, and test in a private window.
Verify
- Open the page where the shopper started and click the button with the Network tab open.
- Confirm the request sends a variation ID, or a parent ID plus
variation_idand the attribute fields. - On the product page, choose options and check that the hidden
variation_idinput changes from 0 to the variation's ID before you submit. - Repeat for one variation with an "Any" attribute.
Frequently asked
- Because an AJAX add to cart button elsewhere sent the variable product's parent ID. WooCommerce stored the error as a notice and told the script to send the shopper to the product page, where the notice is printed. The link looks pointless because it was written for the page the shopper came from.
- Yes. Use the variation's own ID, not the parent's. WooCommerce works out the parent itself. If the variation has an attribute set to Any, also pass that attribute in the URL, for example &attribute_pa_size=xl, or the request fails with a required field error.
- The Product Button block shows a variable product as a "Select options" link to the product page, so it does not trigger it. The notice comes from the classic add to cart handler and from WC_Cart::add_to_cart(), so it appears with classic templates, custom links and code that calls add_to_cart() directly.