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/Frontend/CatalogPriceManager.php +6 -2 2.2.02.2.2 View file →
@@ -38,9 +38,13 @@
38 38 *
39 39 * @return string
40 40 */
41 41 public function formatPrice( $priceHtml, $product ) {
42 - if ( ! is_product() ) {
42 +
43 + $formatCondition = $this->settings->get( 'tiered_price_at_product_page',
44 + 'no' ) === 'yes' || get_queried_object_id() != $product->get_id();
45 +
46 + if ( $formatCondition ) {
43 47 $displayPriceType = $this->getDisplayType();
44 48
45 49 if ( in_array( $product->get_type(), [ 'simple', 'variation' ] ) ) {
46 50 $rules = PriceManager::getPriceRules( $product->get_id() );
@@ -147,9 +151,9 @@
147 151 */
148 152 protected function getLowestPrice( $rules, $product, $html = true ) {
149 153 if ( PriceManager::getPricingType( $product->get_id() ) === 'percentage' ) {
150 154 $lowest = PriceManager::getPriceByPercentDiscount( $product->get_price(),
151 - array_shift( $rules ) );
155 + array_pop( $rules ) );
152 156 } else {
153 157 $lowest = array_pop( $rules );
154 158 }
155 159