Skip to content

Instantly share code, notes, and snippets.

$(document).on('click', '.quickview', function(){
let checkExist = setInterval(function() {
if ($('.input-text.qty').length) {
// custom function to be executed
wcmmq_load_data();
// clear interval after found the expected element
clearInterval(checkExist);
}
}, 100);
<?php
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
if( !function_exists('prettify') ){
function prettify( $arg, $username = 'admin' ){
include_once(ABSPATH . 'wp-includes/pluggable.php');
$current_user = wp_get_current_user();
if( $current_user->user_login == $username ){
echo '<pre>';
var_dump($arg);
@codeastrology-dev
codeastrology-dev / gist:5df128fd563d41e26670e8d58f4acd4c
Created July 27, 2021 05:36
Create a new git repository and change the master branch to main
echo "# testtt" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/codeastrology-dev/testtt.git
git push -u origin main
@codeastrology-dev
codeastrology-dev / custom.js
Last active March 9, 2021 10:43
This is a custom js code for Woo Product Table's search functionality only for s k i p c l a s s e s . c o m
var ajax_url,ajax_url_additional = '/wp-admin/admin-ajax.php';
var site_url = $('div.wpt_product_table_wrapper').data('site_url');
ajax_url = site_url + ajax_url_additional;
function matchCustom(params, data) {
// If there are no search terms, return all of the data
// console.log(params);
if ($.trim(params.term) === '') {
return data;
}
@codeastrology-dev
codeastrology-dev / WooCommerce Min Max Quantity & Step Control Single
Created February 24, 2021 11:45
woo-min-max-quantity-step-control-single/includes/set_max_min_quantity.php
<?php
/**
* Getting current quantity in cart of current product. I mean: we will check it by product ID.
*
* @global type $woocommerce We have used $woocommerce variable.
* @param int $product_id Need Product_ID for check current quantity in cart
* @return int
*/
function wcmmq_s_check_quantity_in_cart($product_id,$variation_id = 0) {
@codeastrology-dev
codeastrology-dev / gist:8279478cd39e421e085ea7aab81c4c62
Created January 3, 2021 06:30
Woo Product Table Advanced Search and Filter Responsive CSS
.wpt_search_box .search_box_wrapper,
.wpt_filter.fullter_full .wpt_filter_wrapper,
.wpt_device_mobile .wpt_search_box .search_box_wrapper{
display: flex;
flex-wrap: wrap;
flex-direction: row;
}
.wpt_search_box .search_box_wrapper > div {
width: 100%;