Do variable products work when js is disabled?
-
Hi there
Is it possible to make variable products work with js disabled?
I can’t make it work at the moment because I keep getting the error “Please choose product options…” when I hit “Add to basket” even though I have chosen an option in a dropdown.
I’ve tried disabling all plugins and using just the Storefront theme but that doesn’t seem to make a difference.
Looking at the code I think the error is generated the function add_to_cart_handler_variable in class-wc-form-handler.php because the posted value for variation_id is 0:
} elseif ( empty( $variation_id ) ) { wc_add_notice( __( 'Please choose product options…', 'woocommerce' ), 'error' );
And at the moment I can’t see how the variation_id is anything other than 0 if js is disabled – the default code is in variation-add-to-cart-button.php and is
<input type="hidden" name="variation_id" class="variation_id" value="0" />
so presumably the value is then set by js.
Have I missed something obvious? Doing something dumb?
Thanks for any help…
Cheers
Jon
- The topic ‘Do variable products work when js is disabled?’ is closed to new replies.