PluginProbe
Tiered Pricing Table for WooCommerce / 2.0
Tiered Pricing Table for WooCommerce v2.0
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 -21 2.2.32.0 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,12 +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 ), [
75 - 'price' => $price,
76 - 'qty' => 1,
77 - ] );
69 + return $price;
78 70 }
79 71 }
80 72 }
81 73
@@ -82,23 +74,14 @@
82 74 if ( $type === 'percentage' ) {
83 75 $product = wc_get_product( $product_id );
84 76 foreach ( array_reverse( $rules, true ) as $_amount => $percentDiscount ) {
85 77 if ( $_amount <= $quantity ) {
86 - $product_price = wc_get_price_to_display( $product, [
87 - 'price' => self::getPriceByPercentDiscount( $product->get_price(), $percentDiscount ),
88 - 'qty' => 1,
89 - ] );
78 + return self::getPriceByPercentDiscount( $product->get_price(), $percentDiscount );
90 79 }
91 80 }
92 81 }
93 82
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 - );
83 + return false;
101 84 }
102 85
103 86 /**
104 87 * Calculate price using percentage discount