getMainSettings() ); $sectionTitle = array( 'title' => __( 'Calculation logic', 'tier-pricing-table' ), 'desc' => __( 'This section controls how tiered pricing does calculations.', 'tier-pricing-table' ), 'id' => Settings::SETTINGS_PREFIX . 'calculation_logic', 'type' => 'title', ); $sectionEnd = array( 'type' => 'sectionend', ); $settings[] = $sectionTitle; $settings = array_merge( $settings, $advanced ); $settings[] = $sectionEnd; return array_merge( $settings, $this->getGlobalPricingRulesOptions() ); } public function getMainSettings(): array { return array( array( 'title' => __( 'Consider product variations as one product', 'tier-pricing-table' ), 'id' => Settings::SETTINGS_PREFIX . 'summarize_variations', 'type' => TPTSwitchOption::FIELD_TYPE, 'default' => 'no', 'extended_description' => __( 'For the same variable product, the plugin will consider all its variations as the same product when calculating tiered pricing.', 'tier-pricing-table' ), 'desc_tip' => true, ), array( 'title' => __( 'Always use regular price to calculate percentage discounts', 'tier-pricing-table' ), 'id' => Settings::SETTINGS_PREFIX . 'calculate_discount_based_on_regular_price', 'type' => TPTSwitchOption::FIELD_TYPE, 'extended_description' => $this->getCalculateDiscountDescription(), 'default' => 'no', ), array( 'title' => __( 'Round price', 'tier-pricing-table' ), 'id' => Settings::SETTINGS_PREFIX . 'round_price', 'type' => TPTSwitchOption::FIELD_TYPE, 'default' => 'yes', 'extended_description' => __( 'WooCommerce rounds prices when showing them to users. To avoid possible rounding errors with displaying and calculation, the plugin rounds prices when calculating percentage discounts.', 'tier-pricing-table' ), 'desc_tip' => true, ), ); } public function getCalculateDiscountDescription() { ob_start(); ?>
:
$90.00 - 20% = $72.00.
$100.00 - 20% = $80.00.