PluginProbe
Tiered Pricing Table for WooCommerce / 6.5.0
Tiered Pricing Table for WooCommerce v6.5.0
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 / PriceIncludingTaxesColumn.php

PriceIncludingTaxesColumn.php in Tiered Pricing Table for WooCommerce 6.5.0, at src/Addons/CustomColumns/Columns/PriceIncludingTaxesColumn.php

33 lines 814 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 PriceIncludingTaxesColumn extends AbstractCustomColumn {
6
7 const TYPE = 'price_incl_taxes';
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_including_tax( $product, array(
25 'price' => $price,
26 ) ) );
27 }
28 }
29
30 return wc_price( wc_get_price_including_tax( $product ) );
31 }
32 }
33