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
| <?php | |
| /* | |
| Add the below code in your active theme functions.php file | |
| This integrate Order date time plugin details in the woocommerce pdf invoice plugin | |
| https://woocommerce.com/products/shipstation-integration/ | |
| based on documentation proviced https://docs.woocommerce.com/document/pdf-invoice-developer-tools/#section-10 | |
| Do this in PDF invoice tempalte: | |
| To show the detail you need to add '[[DELIVERY_DETAIL]]' in there pdf invocie template file |
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
| <?php | |
| /* | |
| say $order_id has the order or then you can get the detail using the below code | |
| if you have WC_order object in say $order varaible you can get order id like this | |
| $order_id = $order->get_id() | |
| */ | |
| $type = get_post_meta( $order_id, 'pi_delivery_type', true ); // delivery type 'delivery' or 'pickup' | |
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
| <?php | |
| add_filter('pi_fsnw_control_filter', 'disableFreeShippingBarForPages'); | |
| function disableFreeShippingBarForPages($json){ | |
| $disable_for_page = array(124,125); // put in the page id for which you want to disable it | |
| if(is_page($disable_for_page)){ | |
| return false; | |
| } | |
| return $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
| add_filter('pisol_dtt_time_slot_filter', 'addingAsap',10,2); | |
| add_filter('pisol_dtt_time_range_filter', 'addingAsap',10,2); | |
| function addingAsap($slot, $date){ | |
| $today = current_time('Y/m/d'); | |
| if($today === $date && !empty($slot)){ | |
| $type = pi_dtt_delivery_type::getType(); | |
| if($type === 'delivery'){ | |
| $msg = 'Deliver now'; | |
| }else{ |
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_checkout_update_order_meta', 'pisol_kbaab_add_note_for_delivery', 100, 1 ); | |
| function pisol_kbaab_add_note_for_delivery( $order_id ) { | |
| $order = wc_get_order($order_id); | |
| $type = get_post_meta( $order_id, 'pi_delivery_type', true ); // delivery type 'delivery' or 'pickup' | |
| $date = get_post_meta( $order_id, 'pi_system_delivery_date', true ); // date in yyyy/mm/dd format | |
| if(class_exists('pi_dtt_date')){ |
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
| <?php | |
| add_filter( 'woocommerce_email_styles', 'piweb_add_css_to_emails', 9999, 2 ); | |
| function piweb_add_css_to_emails( $css, $email ) { | |
| $css .= ' | |
| .pi-order-meta-date { font-weight:bold; color:#f00; } | |
| .pi-order-meta-time { font-weight:bold; color:#f00; } | |
| '; | |
| return $css; |
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
| <?php | |
| add_action('wp_enqueue_scripts','restrictPhoneNumber'); | |
| function restrictPhoneNumber(){ | |
| $js = ' | |
| jQuery(document).ready(function($){ | |
| jQuery("input[name=\'pi_phone\']").attr("data-rule-minlength","10"); | |
| jQuery("input[name=\'pi_phone\']").attr("data-rule-maxlength","10"); | |
| jQuery("input[name=\'pi_phone\']").attr("data-msg-minlength","Phone number should be of 10 digits"); |
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
| /** | |
| https://stackoverflow.com/questions/22277563/jquery-ui-datepicker-conflict-with-bootstrap-datepicker | |
| load this just after the bootstrap datepicker without jquery(document).ready(); | |
| */ | |
| jQuery.fn.datepicker.noConflict(); |
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
| <?php | |
| /** | |
| this will clear woocommerce shipping method cache on cart and checkout page | |
| */ | |
| add_filter('wp_loaded', 'clear_wc_shipping_rates_cache'); | |
| function clear_wc_shipping_rates_cache(){ | |
| if(!isset(WC()->cart)) return; | |