Skip to content

Instantly share code, notes, and snippets.

View rahulv3a's full-sized avatar
🎯
Focusing

Rahul Verma rahulv3a

🎯
Focusing
View GitHub Profile
@rahulv3a
rahulv3a / app.js
Created May 22, 2020 05:41
WooCommerce: Add a product to cart without page refresh using AJAX
// WooCommerce Add to cart AJAX.
(function ($) {
$.fn.serializeArrayAll = function () {
var rCRLF = /\r?\n/g;
return this.map(function () {
return this.elements ? jQuery.makeArray(this.elements) : this;
})
.map(function (i, elem) {
var val = jQuery(this).val();
if (val == null) {