dashboard.php
6 years ago
downloads.php
6 years ago
form-add-payment-method.php
8 years ago
form-edit-account.php
7 years ago
form-edit-address.php
6 years ago
form-login.php
6 years ago
form-lost-password.php
7 years ago
form-reset-password.php
7 years ago
lost-password-confirmation.php
6 years ago
my-account.php
7 years ago
my-address.php
6 years ago
my-downloads.php
6 years ago
my-orders.php
6 years ago
navigation.php
7 years ago
orders.php
6 years ago
payment-methods.php
6 years ago
view-order.php
6 years ago
form-add-payment-method.php
60 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Add payment method form form |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/woocommerce/myaccount/form-add-payment-method.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 | |
| 18 | defined( 'ABSPATH' ) || exit; |
| 19 | |
| 20 | $available_gateways = WC()->payment_gateways->get_available_payment_gateways(); |
| 21 | |
| 22 | if ( $available_gateways ) : ?> |
| 23 | <form id="add_payment_method" method="post"> |
| 24 | <div id="payment" class="woocommerce-Payment"> |
| 25 | <ul class="woocommerce-PaymentMethods payment_methods methods"> |
| 26 | <?php |
| 27 | // Chosen Method. |
| 28 | if ( count( $available_gateways ) ) { |
| 29 | current( $available_gateways )->set_current(); |
| 30 | } |
| 31 | |
| 32 | foreach ( $available_gateways as $gateway ) { |
| 33 | ?> |
| 34 | <li class="woocommerce-PaymentMethod woocommerce-PaymentMethod--<?php echo esc_attr( $gateway->id ); ?> payment_method_<?php echo esc_attr( $gateway->id ); ?>"> |
| 35 | <input id="payment_method_<?php echo esc_attr( $gateway->id ); ?>" type="radio" class="input-radio" name="payment_method" value="<?php echo esc_attr( $gateway->id ); ?>" <?php checked( $gateway->chosen, true ); ?> /> |
| 36 | <label for="payment_method_<?php echo esc_attr( $gateway->id ); ?>"><?php echo wp_kses_post( $gateway->get_title() ); ?> <?php echo wp_kses_post( $gateway->get_icon() ); ?></label> |
| 37 | <?php |
| 38 | if ( $gateway->has_fields() || $gateway->get_description() ) { |
| 39 | echo '<div class="woocommerce-PaymentBox woocommerce-PaymentBox--' . esc_attr( $gateway->id ) . ' payment_box payment_method_' . esc_attr( $gateway->id ) . '" style="display: none;">'; |
| 40 | $gateway->payment_fields(); |
| 41 | echo '</div>'; |
| 42 | } |
| 43 | ?> |
| 44 | </li> |
| 45 | <?php |
| 46 | } |
| 47 | ?> |
| 48 | </ul> |
| 49 | |
| 50 | <div class="form-row"> |
| 51 | <?php wp_nonce_field( 'woocommerce-add-payment-method', 'woocommerce-add-payment-method-nonce' ); ?> |
| 52 | <button type="submit" class="woocommerce-Button woocommerce-Button--alt button alt" id="place_order" value="<?php esc_attr_e( 'Add payment method', 'woocommerce' ); ?>"><?php esc_html_e( 'Add payment method', 'woocommerce' ); ?></button> |
| 53 | <input type="hidden" name="woocommerce_add_payment_method" id="woocommerce_add_payment_method" value="1" /> |
| 54 | </div> |
| 55 | </div> |
| 56 | </form> |
| 57 | <?php else : ?> |
| 58 | <p class="woocommerce-notice woocommerce-notice--info woocommerce-info"><?php esc_html_e( 'New payment methods can only be added during checkout. Please contact us if you require assistance.', 'woocommerce' ); ?></p> |
| 59 | <?php endif; ?> |
| 60 |