Create New Item
×
Item Type
File
Folder
Item Name
×
Search file in folder and subfolders...
File Manager
/
wp-content
/
plugins
/
woocommerce
/
includes
/
traits
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php use Automattic\WooCommerce\Utilities\NumberUtil; if (!defined('ABSPATH')) { exit; } trait WC_Item_Totals { protected abstract function get_values_for_total($field); public static function get_rounded_items_total($values) { return array_sum(array_map(array(self::class, 'round_item_subtotal'), $values)); } public static function round_item_subtotal($value) { if (!self::round_at_subtotal()) { $value = NumberUtil::round($value); } return $value; } protected static function round_at_subtotal() { return 'yes' === get_option('woocommerce_tax_round_at_subtotal'); } protected static function round_line_tax($value, $in_cents = true) { if (!self::round_at_subtotal()) { $value = wc_round_tax_total($value, $in_cents ? 0 : null); } return $value; } }