payment.php 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * Checkout Payment Section
  4. *
  5. * This template can be overridden by copying it to yourtheme/woocommerce/checkout/payment.php.
  6. *
  7. * HOWEVER, on occasion WooCommerce will need to update template files and you
  8. * (the theme developer) will need to copy the new files to your theme to
  9. * maintain compatibility. We try to do this as little as possible, but it does
  10. * happen. When this occurs the version of the template file will be bumped and
  11. * the readme will list any important changes.
  12. *
  13. * @see https://docs.woocommerce.com/document/template-structure/
  14. * @package WooCommerce/Templates
  15. * @version 3.4.0
  16. */
  17. defined( 'ABSPATH' ) || exit;
  18. if ( ! is_ajax() ) {
  19. do_action( 'woocommerce_review_order_before_payment' );
  20. }
  21. ?>
  22. <div id="payment" class="woocommerce-checkout-payment">
  23. <?php if ( WC()->cart->needs_payment() ) : ?>
  24. <ul class="wc_payment_methods payment_methods methods">
  25. <?php
  26. if ( ! empty( $available_gateways ) ) {
  27. foreach ( $available_gateways as $gateway ) {
  28. wc_get_template( 'checkout/payment-method.php', array( 'gateway' => $gateway ) );
  29. }
  30. } else {
  31. echo '<li class="woocommerce-notice woocommerce-notice--info woocommerce-info">' . apply_filters( 'woocommerce_no_available_payment_methods_message', WC()->customer->get_billing_country() ? esc_html__( 'Sorry, it seems that there are no available payment methods for your state. Please contact us if you require assistance or wish to make alternate arrangements.', 'woocommerce' ) : esc_html__( 'Please fill in your details above to see available payment methods.', 'woocommerce' ) ) . '</li>'; // @codingStandardsIgnoreLine
  32. }
  33. ?>
  34. </ul>
  35. <?php endif; ?>
  36. <div class="form-row place-order">
  37. <noscript>
  38. <?php esc_html_e( 'Since your browser does not support JavaScript, or it is disabled, please ensure you click the <em>Update Totals</em> button before placing your order. You may be charged more than the amount stated above if you fail to do so.', 'woocommerce' ); ?>
  39. <br/><button type="submit" class="button alt" name="woocommerce_checkout_update_totals" value="<?php esc_attr_e( 'Update totals', 'woocommerce' ); ?>"><?php esc_html_e( 'Update totals', 'woocommerce' ); ?></button>
  40. </noscript>
  41. <?php wc_get_template( 'checkout/terms.php' ); ?>
  42. <?php do_action( 'woocommerce_review_order_before_submit' ); ?>
  43. <?php echo apply_filters( 'woocommerce_order_button_html', '<button type="submit" class="button alt" name="woocommerce_checkout_place_order" id="place_order" value="' . esc_attr( $order_button_text ) . '" data-value="' . esc_attr( $order_button_text ) . '">' . esc_html( $order_button_text ) . '</button>' ); // @codingStandardsIgnoreLine ?>
  44. <?php do_action( 'woocommerce_review_order_after_submit' ); ?>
  45. <?php wp_nonce_field( 'woocommerce-process_checkout', 'woocommerce-process-checkout-nonce' ); ?>
  46. </div>
  47. </div>
  48. <?php
  49. if ( ! is_ajax() ) {
  50. do_action( 'woocommerce_review_order_after_payment' );
  51. }