Skip to content

Instantly share code, notes, and snippets.

Avatar

Santanu Patra santanup789

View GitHub Profile
@santanup789
santanup789 / ajaxsfilter.js
Last active Sep 18, 2020
Woocommerce product multiple term checkbox filtering by simple ajax [category + color + price]
View ajaxsfilter.js
jQuery(function($){
$('#filter').change(function(){
var filter = $('#filter');
$.ajax({
url:filter.attr('action'),
data:filter.serialize(), // form data
type:filter.attr('method'), // POST
beforeSend:function(xhr){
//filter.find('button').text('Processing...'); // changing the button label
$('#appendTable').html('<label class="alert">Processing...</label>');
@santanup789
santanup789 / functions.php
Last active Feb 14, 2020
Get total sale by product amount in woocommerce
View functions.php
<?php
function dw_product_totals() {
global $wpdb;
$post = get_post( $post_id );
$current_product = get_the_ID($post);
$order_items = apply_filters( 'woocommerce_reports_top_earners_order_items', $wpdb->get_results( "
View 2d_push_button.html
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
<meta charset="UTF-8" />
<style type="text/css">
.sec1{
height: 180px;
width: 180px;