Sjobidoo
Forum Replies Created
-
Same problem here…
There’s a JS error if you look in console:
“Uncaught TypeError: Cannot read property ‘153’ of undefined. ( add-to-cart-variation.min.js:3 )”
@billionairebum : You’ve added prices for your variable products I assume? Do you have a link to your site perhaps so I could take a look?
could you try to turn off the ajax in WooCommerce settings first to see if there’s a conflict here?
@addesigns : WooCommerce works well on mobile units aswell..some small modifications in your CSS might be needed though. But you’ll need a theme that’s responsive to start with.
@addesigns: I’d check with the developer of your mobile pack plugin as the problem seems to be related with it.
There is no need to copy anything to your warp folder…there was a typo on the original code I posted..that’s why you probably didnt get it to work ??
Simply putting this in your functions.php will make it work:
function mv_my_theme_scripts() { wp_enqueue_script('add-to-cart-variation', plugins_url() . '/woocommerce/assets/js/frontend/add-to-cart-variation.js',array('jquery'),'1.0',true); } add_action('wp_enqueue_scripts','mv_my_theme_scripts');
Had the wrong url in my former code..sorry.. This is the correct script to add to your functions.php and it should solve your problem:
function mv_my_theme_scripts() { wp_enqueue_script('add-to-cart-variation', plugins_url() . '/woocommerce/assets/js/frontend/add-to-cart-variation.js',array('jquery'),'1.0',true); } add_action('wp_enqueue_scripts','mv_my_theme_scripts'); ?>
I’m dying here… I am using a YooTheme template with the WooCommerce plugin and have tried everything to get the “Add to Card” button to show with Variables… but luck. Then I thought, let’s try one of the WP default templates and WHA-LA! it works as it should. Then I go back and activate the YooTheme Template again and “Crap” it doesn’t work again. Does anyone know how to make the button work using a YooTheme template (Theme-Catalist)?
The simple button works with the YooTheme template, showing the “Add to Cart” button – Just not when the variables option is selected.
Many Thanks!
Which theme are you using? I’m using a Yootheme template aswell and the above sollution works fine here.
I’ve been suffering from the same “variables – missing add to cart button affliction. I’ve added the code to the functions.php file (though you programmer geeks do realize there are multiple functions.php files on any wordpress server. It really didn’t like it at the wp-content folder’s function file and did nothing at all in the Enfinity folder’s function.php file. So I’m thinking it’s the same thing that several have asked about (and not received an answer at least not in the posts) about how to “upload the add-to-cart-variation.js ” and what are the contents of that file?????? Or where does one get it or how does one (non php programmer) make one? ANd WHERE does that file go in the wp/theme/woocommerce file hierarchy?
You paste the code inside your theme’s functions.php file. The javascript file you’re asking about should already be present inside the Woocommerce folder at the location shown in the code:
plugins_url() . '/woocommerce/js/frontend/add-to-cart-variation.js
This basically means: https://www.yourdomain.com/wp-content/plugins/woocommerce/js/frontend/add-to-cart-variation.jsAdd this code to your functions.php file and you should be all set:
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); } add_action('wp_enqueue_scripts','mv_my_theme_scripts'); ?>
Forum: Plugins
In reply to: [qTranslate] [Plugin: qTranslate] WP-Admin menu language mixed upBump….having the same exact issue…would rock if the plugin didn’t affect the admin area at all :/
The issue is temporerarely fixed by reinstalling the current WordPress version…but is messed up again as soon as qtranslate is in use ??
Solved it by using the sollution mentioned in this thread. Seems the variable products JS wasn’t being loaded for some reason…
Ive got him.
I was able to resolve this on my site.
For whatever reason wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart-variation.js was not included.
I manually added it by uploading it to /js/add-to-cart-variation.js in my template and adding the below to my functions.php in the template.function mv_my_theme_scripts()
{
wp_enqueue_script(‘add-to-cart-variation’, get_template_directory_uri() . ‘/js/add-to-cart-variation.js’,array(‘jquery’),’1.0′,true);
}
add_action(‘wp_enqueue_scripts’,’mv_my_theme_scripts’);
?>Awesome…solved the problem. Thanks alot.
Btw: might wanna correct the source of the js to Woocommerce javascript folder. You’ve set it to the theme folder which is wrong ??
Thanks again!
According to this thread on Github, the issue is due to the variations JS not being loaded for some reason.