Skip to content

Instantly share code, notes, and snippets.

View codersaiful's full-sized avatar

Saiful Islam codersaiful

View GitHub Profile
<?php
//Athis this code inside your theme's functions.php file.
add_action('wp_footer',function(){
?>
<script>
jQuery(function($){
'use strict';
$(document).ready(function($){
$('button.button.wpt-search-products').attr('id','saiful');
});
<?php
add_filter('wpt_table_row_attr', function($attr, $row_object){
$product_id = $row_object->product_id;
// var_dump($attr, $row_object);
$color_code = '#aabbcc';
return "style=background-color:$color_code;";
return $attr;
},10, 2);
<?php
add_filter('wpt_table_row_attr', function($attr, $row_object){
$product_id = $row_object->product_id;
$color = get_post_meta($product_id, '_wpt_bg_color', true);
// if( empty( $color ) ) return;
// $color = '#aabbcc';
// return "data-color='$color_code'";
return "style='background-color:$color;'";
},10, 2);
<?php
add_filter( 'woocommerce_loop_add_to_cart_args', 'wcmmq_custom_min_max_arg_regen', 999999, 2 );
add_filter( 'woocommerce_quantity_input_args', 'wcmmq_custom_min_max_arg_regen', 999999, 2 );
add_filter( 'woocommerce_available_variation', 'wcmmq_custom_min_max_arg_regen', 999999, 2 );
function wcmmq_custom_min_max_arg_regen($args, $product)
{
$product_id = $product->get_id();
$stock_status = get_post_meta($product_id,'_stock_status',true);
<?php
add_filter('wpt_query_args',function($args){
//Change your text here
$target_Text = 'Your Text';
$args['s'] = $args['wpt-s'] = $target_Text;
$args['wpt_query_type'] = 'search';
return $args;
});
<?php
/**
* If you want, that your table will display with default search
* suppose: you want to show product based on search keyword,
* use following code snippet
*
* you can add your code to your
* theme's functions.php file
*
/**
* Add following Code at your functions.php file of your child theme
* OR
* Add following code using code snippet
* OR
* Add code in your custom plugin.
*
* This is specially for Woo Product Table Mini Filter
* Search option. Actually here
<?php
add_filter('wcmmq_ajax_cart_single_page', '__return_true');
<?php
if( !function_exists( 'wpt_show_variation_table' ) ){
/**
* Show variation table on each and every variable product page
* which will replaced the default variation dropdown select options.
*
*
* @since 7.0.8.1
<?php
if( !function_exists( 'wpt_variation_table_args' ) ){
/**
* Args manipulation for variable product
*
* @param array $args WPT default args array
* @return array
*/
function wpt_variation_table_args( $args ){