getMinimalOrderAmountKey( $currencyCode ); } public function getMinimalOrderAmountValue( $amount, $shipping, $currency ) { if ( $this->isManualPricingEnabled( $shipping ) ) { $key = $this->getMinimalOrderAmountKey( $currency ); if ( ! empty( $shipping[ $key ] ) ) { $amount = $shipping[ $key ]; } else { $amount = $this->getValueFromDefaultCurrency( $amount, $shipping, $key, $currency ); } } return $amount; } /** * @see \WCML\Multicurrency\Shipping\ShippingMode::getShippingCostValue * * @param object $rate * @param string $currency * * @return int|mixed|string */ public function getShippingCostValue( $rate, $currency ) { if ( ! isset( $rate->cost ) ) { $rate->cost = 0; } return $rate->cost; } public function isManualPricingEnabled( $instance ) { return is_array( $instance ) && isset( $instance['wcml_shipping_costs'] ) && 'manual' === $instance['wcml_shipping_costs']; } }