2012-01-29 13:36:33 +00:00
< ? php
/**
* Pay for order form
*/
2012-02-03 16:17:35 +00:00
global $woocommerce ;
2012-01-29 13:36:33 +00:00
?>
2011-08-09 15:16:18 +00:00
< form id = " order_review " method = " post " >
< table class = " shop_table " >
< thead >
< tr >
2012-01-05 11:31:22 +00:00
< th >< ? php _e ( 'Product' , 'woocommerce' ); ?> </th>
< th >< ? php _e ( 'Qty' , 'woocommerce' ); ?> </th>
< th >< ? php _e ( 'Totals' , 'woocommerce' ); ?> </th>
2011-08-09 15:16:18 +00:00
</ tr >
</ thead >
< tfoot >
2012-01-04 23:01:47 +00:00
< ? php
if ( $totals = $order -> get_order_item_totals ()) foreach ( $totals as $label => $value ) :
?>
< tr >
< th scope = " row " colspan = " 2 " >< ? php echo $label ; ?> </th>
< td >< ? php echo $value ; ?> </td>
</ tr >
< ? php
endforeach ;
?>
2011-08-09 15:16:18 +00:00
</ tfoot >
< tbody >
< ? php
2012-01-13 00:46:56 +00:00
if ( sizeof ( $order -> get_items ()) > 0 ) :
foreach ( $order -> get_items () as $item ) :
2011-08-09 15:16:18 +00:00
echo '
< tr >
< td > '.$item[' name '].' </ td >
< td > '.$item[' qty '].' </ td >
2012-01-22 02:35:26 +00:00
< td > ' . $order->get_formatted_line_subtotal($item) . ' </ td >
2011-08-09 15:16:18 +00:00
</ tr > ' ;
endforeach ;
endif ;
?>
</ tbody >
</ table >
< div id = " payment " >
< ? php if ( $order -> order_total > 0 ) : ?>
< ul class = " payment_methods methods " >
< ? php
2011-09-06 11:11:22 +00:00
$available_gateways = $woocommerce -> payment_gateways -> get_available_payment_gateways ();
2011-08-09 15:16:18 +00:00
if ( $available_gateways ) :
// Chosen Method
if ( sizeof ( $available_gateways )) current ( $available_gateways ) -> set_current ();
foreach ( $available_gateways as $gateway ) :
?>
< li >
2011-09-19 06:01:26 +00:00
< input type = " radio " id = " payment_method_<?php echo $gateway->id ; ?> " class = " input-radio " name = " payment_method " value = " <?php echo esc_attr( $gateway->id ); ?> " < ? php if ( $gateway -> chosen ) echo 'checked="checked"' ; ?> />
2012-06-29 18:44:33 +00:00
< label for = " payment_method_<?php echo $gateway->id ; ?> " >< ? php echo $gateway -> get_title (); ?> <?php echo $gateway->get_icon(); ?></label>
2011-08-09 15:16:18 +00:00
< ? php
2012-06-29 18:44:33 +00:00
if ( $gateway -> has_fields () || $gateway -> get_description () ) :
2011-08-09 15:16:18 +00:00
echo '<div class="payment_box payment_method_' . $gateway -> id . '" style="display:none;">' ;
$gateway -> payment_fields ();
echo '</div>' ;
endif ;
?>
</ li >
< ? php
endforeach ;
else :
2012-01-05 11:31:22 +00:00
echo '<p>' . __ ( 'Sorry, it seems that there are no available payment methods for your location. Please contact us if you require assistance or wish to make alternate arrangements.' , 'woocommerce' ) . '</p>' ;
2011-08-09 15:16:18 +00:00
endif ;
?>
</ ul >
< ? php endif ; ?>
< div class = " form-row " >
2011-09-06 11:11:22 +00:00
< ? php $woocommerce -> nonce_field ( 'pay' ) ?>
2012-06-19 18:09:51 +00:00
< input type = " submit " class = " button alt " id = " place_order " value = " <?php _e('Pay for order', 'woocommerce'); ?> " />
< input type = " hidden " name = " woocommerce_pay " value = " 1 " />
2011-08-09 15:16:18 +00:00
</ div >
</ div >
</ form >