$pm_found = false; if ( is_array( $this -> payment_methods ) ): foreach ( $this -> payment_methods as $payment_method ): if ( $payment_method['id'] == \Shared\Helpers\Helpers::get_session( 'basket-payment-method-id' ) ) $pm_found = true; endforeach; endif; $basket = \Shared\Helpers\Helpers::get_session( 'basket' ); $coupon = \Shared\Helpers\Helpers::get_session( 'coupon' ); $transport_cost = ( new \Domain\Transport\TransportRepository( $GLOBALS['mdb'] ) )->transportCostCached( (int)\Shared\Helpers\Helpers::get_session( 'basket-transport-method-id' ) ) ?? 0.0; $basket_summary = \Domain\Basket\BasketCalculator::summaryPrice( $basket, $coupon ) + $transport_cost; ?> if ( is_array( $this -> payment_methods ) ): foreach ( $this -> payment_methods as $payment_method ):?> $min = isset($payment_method['min_order_amount']) ? (float)$payment_method['min_order_amount'] : null; $max = isset($payment_method['max_order_amount']) ? (float)$payment_method['max_order_amount'] : null; $show = true; if ($min !== null && $min > 0 && $basket_summary < $min) $show = false; if ($max !== null && $max > 0 && $basket_summary > $max) $show = false; ?> if ( $show ):?>
endif;?> endforeach; endif;?>