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('pisol_edd_product_estimate', 'custom_estimate_filter',10,3); | |
| function custom_estimate_filter($estimates, $product, $shipping_method){ | |
| foreach($estimates as $product_id => $estimate){ | |
| $wc_product = wc_get_product($product_id); | |
| if($wc_product->is_on_backorder()){ | |
| $estimates[$product_id] = null; | |
| } | |
| } |
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('pisol_dtt_forced_time_slots', 'filter_time_slots',10, 4); | |
| function filter_time_slots($time_slots, $day_if_week, $date, $delviery_type){ | |
| /** | |
| you can make your custom logic to here to add new time slots, or remove existing, based on the day or specific date | |
| $time_slots = array( | |
| array('from' =>"12:00 AM", 'to' => "12:15 AM", 'order_limit' => ""), |
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 | |
| class pisol_axd659_next_day_cutoff{ | |
| function __construct($cutoff_time, $next_day_time){ | |
| $this->cutoff_time = $cutoff_time; | |
| $this->next_day_time = $next_day_time; | |
| add_filter('pisol_dtt_time_slot_filter', array($this, 'next_day_filter'),10, 2); | |
| } | |
| function next_day_filter($times, $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('pisol_dtt_setting_filter_pi_type', 'allowDeliveryWhenProduct'); | |
| function allowDeliveryWhenProduct($type){ | |
| $both_for_this_products = array(636, 637); // put the id's of the product for which you want both delivery and pickup to be available | |
| if(isset(WC()->cart)){ | |
| foreach( WC()->cart->get_cart() as $cart_item ) { | |
| if(in_array($cart_item['product_id'], $both_for_this_products)){ |
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 | |
| /** | |
| if a slot has already reached the max quanity allowed | |
| for the product and user has this product in his cart then the slot will be removed | |
| */ | |
| class pisol_quanity_limit_for_product{ | |
| private $product_id = 637; // this is the product for order restriction | |
| private $limit = 2; // this is the slot limit of product quantity, | |
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 | |
| /** | |
| when this products will be in the cart then no order limit will be applied, | |
| when the user will have another product along with this products then the order limit will be applied | |
| */ | |
| add_filter("pisol_disable_order_limit_check", 'pisol_disable_order_limit_for_products'); | |
| function pisol_disable_order_limit_for_products(){ | |
| $disable_limit_for_products = array(636, 637); // disable order limit for this products |
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 | |
| /** | |
| 18:00 when the time goes past 18:00 for today user will only see the time slot that are 9:15 or after 9:15 | |
| if the time is below 18:00 today user will see all the slot for tomorrow | |
| you need to copy the below code in your theme functions.php file | |
| */ | |
| new pisol_axd659_next_day_cutoff('18:00', '09:15'); | |
| class pisol_axd659_next_day_cutoff{ |
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
| /** | |
| this code will foce a certain group of product to be ordered individually in this example product 636 and 637 can be orderd | |
| togather but they can be ordered along with some another product | |
| */ | |
| add_filter( 'woocommerce_check_cart_items', 'bbloomer_only_one_in_cart'); | |
| function bbloomer_only_one_in_cart( ) { | |
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 | |
| function woocommerce_dining_fees() { | |
| if(class_exists('pi_dtt_delivery_type')){ | |
| $delivery_type = pi_dtt_delivery_type::getType(); | |
| if($delivery_type === 'dining'){ | |
| $total = WC()->cart->get_subtotal( ); | |
| $fee = $total * 10 /100; | |
| WC()->cart->add_fee('Dining tax (10%):', $fee); | |
| } |
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 | |
| /* | |
| $order_id will be the order number whose detail you want to access | |
| */ | |
| $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 | |
| $time = get_post_meta( $order_id, 'pi_delivery_time', true ); // delivery time |