Woocommerce Add to Cart Button not displaying on Variable Products


I am having a problem with my clients wordpress site not working correctly with Variable Products.  The Add to Cart button does not display.  I have compared the code with old site (which is showing it correctly) and I see the .single_variation_wrap class is set to display none on the new site, the old site automatically displays it.

I found a forum online that had a solution.  It said to add the following code to the functions.php.

function mv_my_theme_scripts()
wp_enqueue_script('add-to-cart-variation', plugins_url() . '/woocommerce/js/frontend/add-to-cart-variation.js',array('jquery'),'1.0',true);

Open in new window

Which was perfect.  It  displayed all the correct info (add to cart button, price and quantity counter) added the product to the cart and so on.

Then I reloaded the page and it all went away. Now its back to the way it was before and the code is still in the functions.php, but now nothing is triggering.

I have tried the following:

1.  Setting the .single_variation_wrap to display:block. (This will only show the add to cart button and quantity, it will not show the price or add it to the cart as that gives separate error message that says please choose product options.

2.  Cleared the cache of both wordpress and my browser

3.  Disabled all plugins

4.  Switched themes.  The problem still happens even with the default wordpress themes.

5. Filling in all of the variable fields like SKU/Price/Dimensions...

I made no changes after I entered the code into the functions.php.  It just stopped functioning no matter what browser I use.

This is the link to the new site that I am working on:


This is the link to the old site for the exact same page to use as a reference for what is working correctly.


This is an image of where the button should be

This is an image of the functions.php

Any help would be greatly appreciated.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tiabradford1984Author Commented:
I was able to resolve my issue by following the advice from this woothemes article.  The plugin worked perfectly.


Variable Product Add to Cart Not Working

If you have a variable product that doesn’t work such as adding to the cart or simply can’t even see the add to cart button, it may be due to an indirect cause of not being able to read in the jQuery Cookie js script. This happens because your host is using an out dated mod_security ruleset.

The way you can tell is use your browser console such as Firebug or Chrome Developer's tool.  And you should see a JS error stating jQuery.cookie.min.js is not found.

So you have two choices. Either you contact them to have this fixed. Or you can use a simple plugin attached here.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tiabradford1984Author Commented:
This resolution was provided by Roy Ho of Woothemes.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.