/templates/checkout/payment.php

  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. * @author WooThemes 
  15. * @package WooCommerce/Templates 
  16. * @version 2.5.0 
  17. */ 
  18. if ( ! defined( 'ABSPATH' ) ) { 
  19. exit; 
  20.  
  21. if ( ! is_ajax() ) { 
  22. do_action( 'woocommerce_review_order_before_payment' ); 
  23. ?> 
  24. <div id="payment" class="woocommerce-checkout-payment"> 
  25. <?php if ( WC()->cart->needs_payment() ) : ?> 
  26. <ul class="wc_payment_methods payment_methods methods"> 
  27. <?php 
  28. if ( ! empty( $available_gateways ) ) { 
  29. foreach ( $available_gateways as $gateway ) { 
  30. wc_get_template( 'checkout/payment-method.php', array( 'gateway' => $gateway ) ); 
  31. } else { 
  32. echo '<li class="woocommerce-notice woocommerce-notice--info woocommerce-info">' . apply_filters( 'woocommerce_no_available_payment_methods_message', WC()->customer->get_billing_country() ? __( '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' ) : __( 'Please fill in your details above to see available payment methods.', 'woocommerce' ) ) . '</li>'; 
  33. ?> 
  34. </ul> 
  35. <?php endif; ?> 
  36. <div class="form-row place-order"> 
  37. <noscript> 
  38. <?php _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/><input type="submit" class="button alt" name="woocommerce_checkout_update_totals" value="<?php esc_attr_e( 'Update totals', 'woocommerce' ); ?>" /> 
  40. </noscript> 
  41.  
  42. <?php wc_get_template( 'checkout/terms.php' ); ?> 
  43.  
  44. <?php do_action( 'woocommerce_review_order_before_submit' ); ?> 
  45.  
  46. <?php echo apply_filters( 'woocommerce_order_button_html', '<input 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 ) . '" />' ); ?> 
  47.  
  48. <?php do_action( 'woocommerce_review_order_after_submit' ); ?> 
  49.  
  50. <?php wp_nonce_field( 'woocommerce-process_checkout' ); ?> 
  51. </div> 
  52. </div> 
  53. <?php 
  54. if ( ! is_ajax() ) { 
  55. do_action( 'woocommerce_review_order_after_payment' ); 
.