PluginProbe
Tiered Pricing Table for WooCommerce / 2.2.2
Tiered Pricing Table for WooCommerce v2.2.2
7.1.7 7.1.5 7.1.4 7.1.1 6.5.0 6.4.0 6.1.0 trunk 1.0 1.1 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 All 90 releases
← All changes | src/PriceManager.php +4 -15 2.2.32.2.2 View file →
@@ -47,14 +47,9 @@
47 47 }
48 48
49 49 $rules = ( !empty($rules) ? $rules : [] );
50 50 ksort( $rules );
51 - return apply_filters(
52 - 'tier_pricing_table/price/product_price_rules',
53 - $rules,
54 - $product_id,
55 - $type
56 - );
51 + return $rules;
57 52 }
58 53
59 54 /**
60 55 * Get price by product quantity
@@ -70,9 +65,9 @@
70 65 $type = self::getPricingType( $product_id );
71 66 if ( $type === 'fixed' ) {
72 67 foreach ( array_reverse( $rules, true ) as $_amount => $price ) {
73 68 if ( $_amount <= $quantity ) {
74 - $product_price = wc_get_price_to_display( wc_get_product( $product_id ), [
69 + return wc_get_price_to_display( wc_get_product( $product_id ), [
75 70 'price' => $price,
76 71 'qty' => 1,
77 72 ] );
78 73 }
@@ -82,9 +77,9 @@
82 77 if ( $type === 'percentage' ) {
83 78 $product = wc_get_product( $product_id );
84 79 foreach ( array_reverse( $rules, true ) as $_amount => $percentDiscount ) {
85 80 if ( $_amount <= $quantity ) {
86 - $product_price = wc_get_price_to_display( $product, [
81 + return wc_get_price_to_display( $product, [
87 82 'price' => self::getPriceByPercentDiscount( $product->get_price(), $percentDiscount ),
88 83 'qty' => 1,
89 84 ] );
90 85 }
@@ -90,15 +85,9 @@
90 85 }
91 86 }
92 87 }
93 88
94 - $product_price = ( isset( $product_price ) ? $product_price : false );
95 - return apply_filters(
96 - 'tier_pricing_table/price/price_by_rules',
97 - $product_price,
98 - $quantity,
99 - $product_id
100 - );
89 + return false;
101 90 }
102 91
103 92 /**
104 93 * Calculate price using percentage discount