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-ui-datepicker'); | |
| $custom_js = " | |
| jQuery(function($){ | |
| if ($.datepicker && typeof $.datepicker.setDefaults === 'function') { | |
| $.datepicker.setDefaults({ | |
| dayNamesMin: ['S','M','T','W','T','F','S'] | |
| }); |
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_order_table_delivery_method', function($order_delivery_type, $delivery_method){ | |
| $mark = '<mark class="order-status status-%s"><span>%s</span></mark>'; | |
| if($delivery_method === 'pickup'){ | |
| $label = 'Pickup'; | |
| return sprintf($mark, 'processing', $label); | |
| }elseif($delivery_method === 'delivery'){ | |
| $label = 'Delivery'; | |
| return sprintf($mark, 'completed', $label); | |
| }else{ | |
| return ''; |
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 WCAbilitiesDemo { | |
| /** | |
| * Plugin version. | |
| */ | |
| public const VERSION = '1.0.0'; | |
| /** | |
| * Initialize the plugin. | |
| */ |
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
| import json | |
| import httpx | |
| URL = "https://landing.local/wp-json/woocommerce/mcp" | |
| CK = "ck_a9bf627784b1d8d51c21ce6f52a0fd60f20b579e" | |
| CS = "cs_0367a201dcea028c090dde0b88e619cf7df86329" | |
| base_headers = { | |
| "Content-Type": "application/json", |
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
| if(defined('PI_CEFW_SELECTION_RULE_SLUG')){ | |
| class Pi_cefw_selection_rule_selected_time_between_time{ | |
| public $slug; | |
| public $condition; | |
| function __construct($slug){ | |
| $this->slug = $slug; | |
| $this->condition = 'selected_time_between_time'; | |
| /* this adds the condition in set of rules dropdown */ |
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('before_send_order_to_iconnect', function ($baseOrder) { | |
| $order = wc_get_order($baseOrder->order_id); | |
| if (!$order) return $baseOrder; | |
| $piDate = $order->get_meta('pi_system_delivery_date', true); | |
| $piTime = $order->get_meta('pi_delivery_time', true); | |
| if(empty($piTime)){ | |
| $piTime = '21:00'; | |
| } |
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('before_send_order_to_iconnect', function ($baseOrder) { | |
| $order = wc_get_order($baseOrder->order_id); | |
| if (!$order) return $baseOrder; | |
| $piDate = $order->get_meta('pi_delivery_date', true); | |
| $piTime = $order->get_meta('pi_delivery_time', true); | |
| $ts = ''; | |
| if (!empty($piDate) && !empty($piTime)) { | |
| $timePart = trim(explode('-', (string) $piTime)[0]); // "10:00 - 10:30" -> "10:00" |
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_ics_default_start_time', function($time){ | |
| return '09:00'; | |
| }, PHP_INT_MAX); | |
| add_filter('pisol_dtt_ics_default_end_time', function($time){ | |
| return '21:00'; | |
| }, PHP_INT_MAX); |
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 TwentyTwenty_Custom_Scripts { | |
| private static $instance = null; | |
| public $hide_field_name = 'delivery-address'; | |
| public 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_dtt_setting_filter_pi_type', function($type){ | |
| $todays_date = current_time('Y/m/d'); | |
| $disable_delivery_date = '2026/02/16'; | |
| $cutoff_time = '13:00'; | |
| $current_time = current_time('H:i'); | |
| if($todays_date === $disable_delivery_date && strtotime($current_time) < strtotime($cutoff_time)){ | |
| return 'Pickup'; | |
| } | |
| return $type; | |
| }, PHP_INT_MAX); |
NewerOlder