This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class pisol_custom_clone_checkbox{ | |
| static $instance = null; | |
| static $run = 0; | |
| static function get_instance(){ | |
| if(is_null(self::$instance)){ | |
| self::$instance = new self(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('pisol_edd_product_estimate', function($estimate){ | |
| $min = (int) ($estimate['min_preparation_days'] ?? 0) + (int) ($estimate['min_shipping_days'] ?? 0); | |
| $max = (int) ($estimate['max_preparation_days'] ?? 0) + (int) ($estimate['max_shipping_days'] ?? 0); | |
| $estimate['min_days'] = $min; | |
| $estimate['max_days'] = $max; | |
| return $estimate; | |
| }); | |
| add_filter('pisol_edd_get_order_estimate', function($estimate){ | |
| $min = (int) ($estimate['min_preparation_days'] ?? 0) + (int) ($estimate['min_shipping_days'] ?? 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'wcs_renewal_order_created', 'pi_modify_renewal_shipping', 10, 2 ); | |
| function pi_modify_renewal_shipping( $renewal_order, $subscription ) { | |
| foreach ( $renewal_order->get_items( 'shipping' ) as $item_id => $shipping_item ) { | |
| $total = (float) $shipping_item->get_total(); | |
| $new_total = $total / 2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class PIE_Disable_Archive_Enquiry { | |
| private static $instance = null; | |
| public $loop_product_enquiry_position; | |
| public $add_to_enquiry_text_loop_variable; | |
| public static function instance() { | |
| return self::$instance ?: self::$instance = new self(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action('wp_enqueue_scripts', function () { | |
| wp_enqueue_script('jquery'); | |
| $inline_js = <<<'JS' | |
| jQuery(document).on('pi_add_to_enquiry_data', function(e, data){ | |
| var id = data.id; | |
| var form_id = '#nt_variation_form_' + id; | |
| var qty = '#nt_product_qty_' + id; | |
| if (jQuery(qty).length > 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('pisol_edd_option_filter_pi_general_date_format', function($format){ | |
| return 'l'; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action('woocommerce_cart_calculate_fees', function($cart) { | |
| if(class_exists('PISOL\DPMW\Session')){ | |
| $fees_selected = PISOL\DPMW\Session::partialPaymentSelectedInSession(); | |
| if(!$fees_selected){ | |
| $cart->add_fee( 'Custom Fee', -100 ); | |
| } | |
| } | |
| }, 20); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'woocommerce_shipping_package_name', function($name){ | |
| if(class_exists('pi_dtt_delivery_type')){ | |
| $type = pi_dtt_delivery_type::getType(); | |
| if($type == 'delivery'){ | |
| return 'Delivery'; | |
| } | |
| } | |
| return $name; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('pisol_eqw_product_price_filter', function($price, $product, $product_in_cart){ | |
| if(isset($product_in_cart['variation_detail']['price']) ){ | |
| $raw_price = $product_in_cart['variation_detail']['price']; | |
| $clean_price = str_replace(',', '', $raw_price); | |
| if(is_numeric($clean_price)){ | |
| return (float) $clean_price; | |
| } | |
| } | |
| return $price; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('pisol_dtt_get_location', function($arg){ | |
| $arg['orderby'] = 'title'; | |
| $arg['order'] = 'ASC'; // ASC or DESC | |
| return $arg; | |
| }); |
NewerOlder