Ask your WordPress questions! Pay money and get answers fast! (more info)

WooComerce variable product and invisible "add to cart" button WordPress

Hi All!

I have quite known bug with WooCommerce and this theme:
http://themeforest.net/item/fancytheme-multipurpose-wordpress-theme/3929323

So when you add product as "variable product" with some sizes the "add to cart" button is not shown - it has hard coded "style="dispaly:none;"

I've tried the following:
1) Adding the code to functions.php:
http://wordpress.org/support/topic/plugin-woocommerce-excelling-ecommerce-checkout-button-not-showing-on-woo-commerce-product/page/2#post-3600660

2) adding the same script (woocommerce/js/frontend/add-to-cart-variation.js) directly to header.php

3) CSS fixes

4) replacing theme jquery with new version

ALL this didn't help.

Please advise. Thanks.

PS: I can't show site - it's not mine.

Answers (3)

2013-07-05

Doug Montgomery answers:

Once a size or variable is chosen, the add to cart button should appear. It won't appear until the variable is chosen because the variable could have an effect on the price of the product.


Alex B. comments:

Yes sure I've made selection of the size but with no result. But when the default theme is activated the button is on the place.

2013-07-05

isp_charlie answers:

you need add this too:


<script type='text/javascript' src='<?php bloginfo("template_url")?>/assets/js/frontend/add-to-cart.min.js'></script>
<script type='text/javascript' src='<?php bloginfo("template_url")?>/assets/js/frontend/single-product.min.js'></script>
<script type='text/javascript' src='<?php bloginfo("template_url")?>/assets/js/frontend/add-to-cart-variation.min.js'></script>


Alex B. comments:

Unfortunately if didn't help.

BTW all this scripts are added to the page footer by theme itself.

2013-07-05

Eric P. answers:

That button is only disabled until a size (or other variable characteristic) is selected

You don't want to change that behavior. If you "fix" this, you'll get orders with no size specified. What size do you plan to ship when that happens? Will the customer be happy if you don't read their mind correctly?


Alex B. comments:

Yes sure I've made selection of the size but with no result. But when the default theme is activated the button is on the place.


Eric P. comments:

If it works in the default theme(s) like twentyeleven and twentytwelve, but it doesn't work with your "premium" theme, then the problem is most likely with the theme.

It's very likely there is no wp_footer() call in the theme with the issue. That function does a number of things at the end of the page, including all the wp_enqueue_script scripts that specify placement in the footer, or that are enqueued after wp_head has been completed. That's not all that wp_footer() does. I think WooCommerce attaches other things to hooks in the wp_footer() process.

Short answer is try another theme.

Long answer, fix the "premium" theme to work properly, or report the bug to the theme developer and hope for a quick fix.