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('pi_eqw_admin_email_id', function($email_id, $items, $email_obj){ | |
| if(isset($_POST['melyi-bemutatotermunk-van-kozelebb-onhoz']) && | |
| strpos($_POST['melyi-bemutatotermunk-van-kozelebb-onhoz'], 'Tatabánya') !== false ){ | |
| $email_id = '[email protected]'; | |
| } | |
| return $email_id; | |
| },10,3); |
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 () { | |
| $js = " | |
| jQuery(document).on('pi_add_to_enquiry_data', function(e, data){ | |
| if(jQuery('.wc-pao-addon-container').length == 0) return; | |
| jQuery('.wc-pao-addon-container').each(function(){ | |
| var label = jQuery('.wc-pao-addon-name', this).text().trim(); | |
| var price = jQuery('input', this).val().trim(); | |
| if(price != ''){ | |
| data['variation_detail'][label] = 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('pi_live_sales_notification_control_filter', function($show){ | |
| if( ! is_user_logged_in() ) { | |
| return false; | |
| } | |
| return $show; | |
| }); |
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(){ | |
| if(function_exists('is_checkout') && is_checkout()){ | |
| wp_dequeue_script( 'wc-opayopi-dropin' ); | |
| wp_deregister_script( 'wc-opayopi-dropin' ); | |
| } | |
| }, 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
| add_filter('pisol_dtt_setting_filter_pi_order_preparation_days', function($preparation_days) { | |
| $day = (int) wp_date('w'); // 0 => sunday, 1 => monday | |
| if($day == 0) return 2; | |
| if($day == 6) return 3; | |
| return $preparation_days; | |
| }); |
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_disable_20221118 { | |
| private $disable_for_cats = []; | |
| function __construct($cats) { | |
| $this->disable_for_cats = is_array($cats) ? $cats : [$cats]; | |
| add_filter('pisol_disable_dtt_completely', [$this, 'disable']); | |
| } | |
| function disable($return) { | |
| $only_special_cat_present = true; |
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 Pi_DTT_Delivery_Packaging_Option { | |
| private static $instance = null; | |
| private function __construct() { | |
| // Checkout dropdown | |
| add_action( 'woocommerce_after_order_notes', [ $this, 'add_dropdown_field' ] ); | |
| // Save value | |
| add_action( 'woocommerce_checkout_create_order', [ $this, 'save_order_meta' ], 10, 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
| add_filter('pi_dpmw_get_ip_country', function( $country ) { | |
| if ( isset( $_SERVER['HTTP_CF_IPCOUNTRY'] ) && ! empty( $_SERVER['HTTP_CF_IPCOUNTRY'] ) ) { | |
| return sanitize_text_field( $_SERVER['HTTP_CF_IPCOUNTRY'] ); // e.g. "US", "IN" | |
| } | |
| return $country; // fallback to original if Cloudflare header missing | |
| }); |
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_after_shop_loop_item', function(){ | |
| global $product; | |
| $product_id = $product->get_id(); | |
| $redirect_url = $product->get_permalink(); | |
| if(!empty($redirect_url)){ | |
| echo sprintf('<a href="%s" class="button readmore">Read more</a>', esc_url($redirect_url)); | |
| } | |
| }); |
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 zone_data_custom{ | |
| public $zone_value = array(); | |
| public $zone_id = 0; | |
| public $date = ''; | |
| function __construct($date, $zone_id){ | |
| $zone_id = intval($zone_id); |
NewerOlder