amountIndexes = array('feeValue'); } /** * @param float $feeValue */ public function setFeeValue($feeValue) { $this->feeValue = $feeValue; } /** * @param string $feeName */ public function setFeeName($feeName) { $this->feeName = $feeName; } /** * @param string $taxClass */ public function setFeeTaxClass($taxClass) { $this->feeTaxClass = $taxClass; } public function getFeeValue() { return $this->feeValue; } public function getFeeName() { return $this->feeName; } public function getFeeTaxClass() { return $this->feeTaxClass; } /** * @return bool */ public function isValid() { return isset($this->feeValue) or isset($this->feeName) or isset($this->feeTaxClass); } public function applyToCart($rule, $cart) { $context = $cart->getContext()->getGlobalContext(); $cart->addFee( new Fee( $context, Fee::TYPE_FIXED_VALUE, $this->feeName, $this->feeValue, $this->feeTaxClass, $rule->getId() ) ); } public function translate() { //phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText $this->feeName = _x($this->feeName, "Fee name from rule", 'advanced-dynamic-pricing-for-woocommerce'); } }