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; | |
| }); |
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", |