0

Running my own designed custom theme "mdbootstrap" designed by myself. Integrating WooCommerce 2.4.12. and upon testing there is an issue adding variable products to the cart. Basically the add to cart button is hidden and doesn't appear once a variant is selected .

If I switch to the TwentyEleven theme, the issue resolves itself.

I can force button to show by adding to css

.single_variation_wrap{display:block !important;}

but even then when I submit "Add to card" page is reloading and when I move to cart page I am getting error: Please choose product options…

Variable product: http://mdb.nomadflow.com/product/ecommerce-homepage-template/

Normal products works like a charm: http://mdb.nomadflow.com/product/blog-homepage-template/

You have to be logged in: username: test password: test

closed as off-topic by kaiser May 25 '16 at 19:22

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    you have a javascript error on the page... fixed that and everything should work. – Reigel Jan 5 '16 at 9:26
  • Nope, I fixed other JS but didn't help... – Dawid Adach Jan 5 '16 at 9:35
  • I can see at the console, you have Uncaught TypeError: jQuery(...).validate is not a function – Reigel Jan 5 '16 at 9:36
  • Oh, sorry! My bad, that is because you are not logged in. I forgot to mention that - you have to be logged in username: test passowrd: test – Dawid Adach Jan 5 '16 at 9:39
  • I'm not sure why but you have form tag inside a form tag.. and chrome is making it as one... view source and look for <form class="cart" method="post" enctype='multipart/form-data'> and <form class="variations_form cart" method="post" – Reigel Jan 5 '16 at 9:53
0

I'm not sure why but you have form tag inside a form tag.. and chrome is making it as one... view source and look for <form class="cart" method="post" enctype='multipart/form-data'> and <form class="variations_form cart" method="post"

<form class="variations_form cart" method="post" was removed by the browser which is the one needed by woocommerce.

0

Btw, as for all custom themes designed from scratch: do not forget to include wp_head() and wp_footer() functions as they are needed to let WooCommerce automatically link the necessary JS files. Those JS files are needed to make the WooCommerce do it's thing.

I just ran into this issue coding a theme from scratch and accidently deleting wp_footer().

0

I know this thread is older, but I had the same issue and I contacted WooThemes support and they said that…"We limit the amount of variations we show on the front end for speed. But sometimes you need more than 36 variations, so we offer that filter to override that limitation."

So you need to add this code below to your functions.php file and you're good to go. Worked for me. Hope that helps others that have this same issue:

function custom_wc_ajax_variation_threshold( $qty, $product ) {
    return 100;
}
add_filter( 'woocommerce_ajax_variation_threshold', 'custom_wc_ajax_variation_threshold', 100, 2 );

Not the answer you're looking for? Browse other questions tagged or ask your own question.