PluginProbe
Tiered Pricing Table for WooCommerce / 8.0.2
Tiered Pricing Table for WooCommerce v8.0.2
8.0.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 All 91 releases
tier-pricing-table / src / Addons / CustomColumns / Columns / RowTotalPriceColumn.php

RowTotalPriceColumn.php in Tiered Pricing Table for WooCommerce 8.0.2, at src/Addons/CustomColumns/Columns/RowTotalPriceColumn.php

37 lines 893 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php namespace TierPricingTable\Addons\CustomColumns\Columns;
2
3 use TierPricingTable\PricingRule;
4
5 class RowTotalPriceColumn extends AbstractCustomColumn {
6
7 const TYPE = 'total_price';
8
9 public function getType(): string {
10 return self::TYPE;
11 }
12
13 public function getDataType(): string {
14 return 'price';
15 }
16
17 protected function _getSingleRowValue( PricingRule $pricingRule, $currentTierQuantity = null ): string {
18 $product = wc_get_product( $pricingRule->getProductId() );
19
20 if ( $currentTierQuantity ) {
21 $price = $pricingRule->getTierPrice( $currentTierQuantity, false );
22
23 if ( $price && $product ) {
24 return wc_price( wc_get_price_to_display( $product, array(
25 'price' => $price,
26 'qty' => $currentTierQuantity,
27 ) ) );
28 }
29 }
30
31 return wc_price( wc_get_price_to_display( $product, array(
32 'qty' => $pricingRule->getMinimum(true),
33 ) ) );
34 }
35
36 }
37