2013-11-01 17:10:24 +00:00
< ? php
/**
* Add payment method form form
*
* @ author WooThemes
* @ package WooCommerce / Templates
* @ version 2.1
*/
if ( ! defined ( 'ABSPATH' ) ) exit ; // Exit if accessed directly
global $woocommerce ;
?>
2013-11-05 22:41:21 +00:00
< form id = " add_payment_method " method = " post " >
2013-11-01 17:10:24 +00:00
< div id = " payment " >
< ul class = " payment_methods methods " >
< ? php
2013-11-25 14:01:32 +00:00
if ( $available_gateways = WC () -> payment_gateways -> get_available_payment_gateways () ) {
2013-11-01 17:10:24 +00:00
// Chosen Method
if ( sizeof ( $available_gateways ) )
current ( $available_gateways ) -> set_current ();
foreach ( $available_gateways as $gateway ) {
?>
2013-11-01 19:01:10 +00:00
< li class = " payment_method_<?php echo $gateway->id ; ?> " >
< input id = " payment_method_<?php echo $gateway->id ; ?> " type = " radio " class = " input-radio " name = " payment_method " value = " <?php echo esc_attr( $gateway->id ); ?> " < ? php if ( $gateway -> chosen ) echo 'checked="checked"' ; ?> />
2013-11-01 17:10:24 +00:00
< label for = " payment_method_<?php echo $gateway->id ; ?> " >< ? php echo $gateway -> get_title (); ?> <?php echo $gateway->get_icon(); ?></label>
< ? php
if ( $gateway -> has_fields () || $gateway -> get_description () ) {
echo '<div class="payment_box payment_method_' . $gateway -> id . '" style="display:none;">' ;
$gateway -> payment_fields ();
echo '</div>' ;
}
?>
</ li >
< ? php
}
} else {
2013-11-01 21:12:08 +00:00
echo '<p>' . __ ( 'Sorry, it seems that there are no payment methods which support adding a new payment method. Please contact us if you require assistance or wish to make alternate arrangements.' , 'woocommerce' ) . '</p>' ;
2013-11-01 17:10:24 +00:00
}
?>
</ ul >
< div class = " form-row " >
< ? php wp_nonce_field ( 'woocommerce-add-payment-method' ); ?>
2013-11-01 21:12:08 +00:00
< input type = " submit " class = " button alt " id = " place_order " value = " <?php _e( 'Add Payment Method', 'woocommerce' ); ?> " />
2013-11-01 17:10:24 +00:00
< input type = " hidden " name = " woocommerce_add_payment_method " value = " 1 " />
</ div >
</ div >
</ form >