Skip to content

Instantly share code, notes, and snippets.

View rajeshsingh520's full-sized avatar

Rajesh rajeshsingh520

View GitHub Profile
@rajeshsingh520
rajeshsingh520 / gist:edd70ba2bc06698f078b21df7b7efb01
Created August 19, 2025 01:31
green circle around active daet
.ui-datepicker-calendar td a.ui-state-default {
background: green !important;
width:40px;
height:40px;
display:flex !important;
text-align:center !important;
justify-content:center;
align-items:center;
margin:auto;
@rajeshsingh520
rajeshsingh520 / gist:4e9dbdf6a9770af4e848f3ce9085947a
Last active August 12, 2025 10:59
add product link in the exported enquiry
add_filter('pisol_eqw_product_export', function($data, $product_data) {
$link = $product_data['link'] ?? '';
$img = $product_data['img'] ?? '';
return $link.' '.$img.' ' . $data;
}, 10, 2);
@rajeshsingh520
rajeshsingh520 / gist:7a24637e7c741cd82ebf9462dc2f4de7
Created August 7, 2025 09:31
replaces all Enquiry to Inquiry
add_filter( 'gettext', function ( $translated_text, $text, $domain ) {
if ( 'pisol-enquiry-quotation-woocommerce' === $domain ) {
$translated_text = str_replace(['Enquiry', 'Enquiries'], ['Inquiry', 'Inquiries'], $translated_text);
}
return $translated_text;
}, 10, 3 );
@rajeshsingh520
rajeshsingh520 / gist:fe646ed09e0e7b29710a432ff35ca960
Last active August 9, 2025 01:29
order access restricted for the store manager
class PISOL_Store_Manager_Custom_Field {
private static $instance = null;
private $meta_key = 'pickup_location_control';
public static function get_instance() {
if ( self::$instance === null ) {
self::$instance = new self();
}
return self::$instance;
@rajeshsingh520
rajeshsingh520 / gist:5464c8b74ba1060140d31629bfcfc77a
Created August 6, 2025 01:42
using options for tracking present delivery type
class pisol_dtt_use_options{
static $instance = null;
static $name = 'pi_delivery_type';
static function get_instance(){
if(is_null(self::$instance)){
self::$instance = new self();
}
@rajeshsingh520
rajeshsingh520 / gist:3923326dc845fb77ca17433e31e80036
Created August 5, 2025 06:04
weglot to force translation of the dynamic content
add_filter( 'weglot_translate_dynamics', '__return_true' );
add_filter( 'weglot_whitelist_selectors', function ( $default_dynamics ) {
return [
['value' => '.pi-edd']
];
} );
add_filter( 'weglot_dynamics_selectors', function ( $default_dynamics ) {
return [
['value' => '.pi-edd']
];
@rajeshsingh520
rajeshsingh520 / gist:d3883355c42a37d27432f89c98d0db62
Created August 2, 2025 01:14
showing local pickup method as per pickup location selected
add_filter('woocommerce_package_rates', function($rates, $package) {
if( !class_exists('pi_dtt_delivery_type') ) return $rates;
$type = pi_dtt_delivery_type::getType();
if($type == 'delivery' ) return $rates;
$pickup_location = WC()->session->get('pickup_location');
if(empty($pickup_location)) return $rates;
$local_pickup_location_relation = [
'4283' => 'local_pickup:2166',
if(!class_exists('Pi_cefw_selection_rule_custom_20250731') && defined('PI_CEFW_SELECTION_RULE_SLUG')){
class Pi_cefw_selection_rule_custom_20250731{
public $slug;
public $condition;
function __construct($slug){
$this->slug = $slug;
$this->condition = 'custom_company_non_company';
/* this adds the condition in set of rules dropdown */
add_filter("pi_".$this->slug."_condition", array($this, 'addRule'));
@rajeshsingh520
rajeshsingh520 / gist:ceaf7d9ddbb592f2abcb69a5ef3b33bd
Created July 31, 2025 01:18
only change the display value to the time slot from 7:00 AM - 8:00 AM to 7:00 AM
add_filter('pisol_dtt_time_slot_filter', function($time_slots) {
foreach ($time_slots as &$slot) {
if (isset($slot['text'])) {
$parts = explode(' - ', $slot['text']);
$slot['text'] = trim($parts[0]);
}
}
return $time_slots;
}, 10);
@rajeshsingh520
rajeshsingh520 / gist:962a5d48ac1a436a3a7de4a87f292faf
Created July 26, 2025 09:07
disable estimate date for category id
add_filter('pisol_edd_get_product_data', function($data, $object){
$disable_for_category = [17, 18];
if($object->product->is_type('variation')){
$parent_id = $object->product->get_parent_id();
$parent_product = wc_get_product($parent_id);
$category_ids = $parent_product->get_category_ids();
}else{
$category_ids = $object->product->get_category_ids();
}