PluginProbe ʕ •ᴥ•ʔ
PiWeb Delivery & Pickup Date Time for WooCommerce / 3.0.49.23
PiWeb Delivery & Pickup Date Time for WooCommerce v3.0.49.23
3.0.63 3.0.62 3.0.61 3.0.60 3.0.49.49 3.0.49.6 3.0.49.60 3.0.49.61 3.0.49.62 3.0.49.63 3.0.49.64 3.0.49.66 3.0.49.67 3.0.49.69 3.0.49.7 3.0.49.70 3.0.49.72 3.0.49.73 3.0.49.74 3.0.49.76 3.0.49.77 3.0.49.79 3.0.49.9 3.0.49.90 3.0.49.91 3.0.49.92 3.0.49.93 3.0.49.94 3.0.49.96 3.0.49.97 3.0.49.99 trunk 1.0 1.1 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 2.9.17 3.0.47 3.0.49 3.0.49.1 3.0.49.10 3.0.49.11 3.0.49.12 3.0.49.13 3.0.49.16 3.0.49.17 3.0.49.19 3.0.49.2 3.0.49.20 3.0.49.21 3.0.49.22 3.0.49.23 3.0.49.24 3.0.49.26 3.0.49.27 3.0.49.29 3.0.49.3 3.0.49.30 3.0.49.31 3.0.49.32 3.0.49.33 3.0.49.34 3.0.49.36 3.0.49.37 3.0.49.39 3.0.49.4 3.0.49.40 3.0.49.41 3.0.49.42 3.0.49.43 3.0.49.44 3.0.49.46 3.0.49.47
pi-woocommerce-order-date-time-and-type / public / class-shipping-method.php
pi-woocommerce-order-date-time-and-type / public Last commit date
css 1 year ago js 1 year ago class-css.php 1 year ago class-date.php 1 year ago class-delivery-type.php 1 year ago class-display-field.php 1 year ago class-js.php 1 year ago class-main.php 1 year ago class-myaccount.php 1 year ago class-order.php 1 year ago class-pickup-location.php 1 year ago class-shipping-method.php 1 year ago class-time-range.php 1 year ago class-time-slot.php 1 year ago class-time.php 1 year ago class-validate.php 1 year ago class-woo-app.php 1 year ago
class-shipping-method.php
46 lines
1 <?php
2 class pisol_dtt_shipping_method{
3
4 function __construct(){
5
6 add_filter( 'woocommerce_product_needs_shipping',array(__CLASS__, 'productNeedsShipping'), PHP_INT_MAX);
7 add_filter( 'woocommerce_cart_needs_shipping_address', array(__CLASS__, 'productNeedsShipping'), PHP_INT_MAX);
8 add_filter( 'woocommerce_customer_taxable_address', array($this, 'shopBasedTaxableAddress'));
9 }
10
11 /**
12 * When pickup is selected we do the Tax calculation based on the shop
13 * base address
14 */
15 function shopBasedTaxableAddress($location){
16 if(self::disabled()) return $location;
17
18 $type = pi_dtt_delivery_type::getType();
19
20 if($type != 'pickup') return $location;
21
22 $country = WC()->countries->get_base_country();
23 $state = WC()->countries->get_base_state();
24 $postcode = WC()->countries->get_base_postcode();
25 $city = WC()->countries->get_base_city();
26 return array( $country, $state, $postcode, $city );
27 }
28
29 static function productNeedsShipping($val){
30
31 if(self::disabled()) return $val;
32
33 $type = pi_dtt_delivery_type::getType();
34 if($type == 'pickup'){
35 return false;
36 }
37
38 return $val;
39 }
40
41 static function disabled(){
42 return apply_filters('pisol_disable_dtt_completely',false);
43 }
44 }
45
46 new pisol_dtt_shipping_method();