Woocommerce Ajax add to cart for variable products


This plugin activate add to cart through ajax on varible product. By default woocommerce is not having this feature. Plugin is adding own jquery which is differ from woocommerce default add to cart jquery for simple product.

This plugin also supports sending additional field and other data added by other plugins. It will work with most of product addon and extra field data.

Let me know if you stumble upon any plugin conflict in support forum.


  1. Upload woocommerce-ajax-add-to-cart-variable-products to the /wp-content/plugins/ directory
  2. Aktiver innstikket gjennom Innstikk-menyen i WordPress

Vanlege spm.

How this plugin work?

This plugin add new javascript file in your theme footer, which gets required data from the page when you click on add to cart button on varible product page and sent it to php ajax function of plugin.

Is this plugin work with my theme?

Yes this plugin will work with most themes. Just make sure you didn’t removed any css classes from add to cart button from variable product template.

Is this plugin only add functionality on single page or archive page or category page

This plugin activate ajax functionality everywhere. So like is it a single page, category page, archive page or even sidebar with shortcode, where ever it gets varible product, it will work with ajax functionality.


10. september 2020 1 reply
This plugin does what it promises and does it flawlessly – you get ajax-compatible variation dropdowns with add to cart buttons on shop and category archive pages too. I have tested this with WordPress version 5.5.1 and WooCommerce version 4.5.1. Just hope the author regularly updates the supported version on the repo, answers a few support queries every now and then, so it appears to be current, and more people can be confident to try it out. Thanks much Rishi Mehta – Rcreators Websolutions Kind regards _/\_
28. august 2020
Hi author, can you check your plugin php file, I just install it but error in line 150 in your php file, you using $this in function.
14. februar 2020
this way I can put an add to cart button on my shop/taxonomy archive page without redirect user to variable product page. thank you so much!!
Les alle 38 omtalar

Bidragsytarar og utviklarar

“Woocommerce Ajax add to cart for variable products” is open source software. The following people have contributed to this plugin.


“Woocommerce Ajax add to cart for variable products” er omsett til 2 språk. Takk til omsetjarane for bidraga deira.

Omset “Woocommerce Ajax add to cart for variable products” til ditt eige språk.

Interested in development?

Les kjeldekoden, sjekk SVN-lageret eller abonner på utviklingsloggen med RSS.



  • Fixed – Textdomain Fixed as per WP Standard
  • Added – Language Folder added to plugin for future translation


  • Fixed – PHP Error at line no 157 for $this. Removed code, it was not required for new version of WP
  • Fixed – Now it will work with any variation from attributes


  • Fixed – Different Qty for same variation was treated as separate line item in cart. Fixed now.


  • Added – Now plugin will work with other plugin like name your price, product bundle, product add-on. Thanks to @Tofandel for jQuery hint. Was able to work around and made PHP adjustment accordingly.


  • Fixed – Update Code for fetching id error, $product->id to $product->Get_ID()


  • Fixed – Issue with sometheme ajax not working for single product when plugin activated


  • Fixed – Updated code for getting product_type as per new woocommerce methods
  • Fixed – Added stripslash to data. so now variation with slash work. : SpabRice
  • Fixed – Set Cookies for current cart and old cart items. : unicco


  • Fixed – Simple product ajax works with plugin now.


  • Added support for woocommerce lightbox plugin
  • Js updated to work with most of the theme now


  • Network Activation Added – Suggested by User lucastello
  • Redirect to cart page if option selected in woocommerce setting


  • Jquery Refined with latest woocommerce version.
  • Backward compability for swatches and hidden input variations


  • Updated Jquery to work with Radio button plugins. : mantish – WC Variations Radio Buttons – 8manos


  • Updated Jquery issue reported by user. : david127, nonverbla
  • Js Improvement suggested by user, now it will work with multiple tye of variations. : Igor Jerosimic
  • Removed AddtocartAjax localize script which was not in use.
  • Supports Latest Woocommerce and wordpress.


  • Updated Jquery, so it works properly with IE10 / IE11


  • jquery updated. so if no variation selected, user will get error to select variable.


  • Minor fix for setting tab issue


  • Added Selection in woocommerce product tab wc ajax variable product setting for variation selection need on category / shop page or not.
  • Added Strip Html security fix. / Thanks – Michal for pointing out this security bug
  • Added support for other variable swatches and color box selection plugin / Thanks – Mycreativeway for updated jquery code


  • Added Ob_start() starting of hooks so it works perfect on chrome and Firefox. / Thanks – Michal for mail on it.


  • Functions updated to work with minicart widget.
  • Now Default cart widget of woocommerce will also update same time with adding to cart.


  • Updated the Function in which Cart Fragments was not updating in Chrome. Will work on all browser now without issue.


  • Updated function as ajax was not working for guest users. / – Thanks – sharpe89 to pointing issue.


  • Bug Fix to not load js file after activation
  • Remove files which not required from plugin


  • Dirctly works after activation.
  • No any setting page.