2012-01-29 13:36:33 +00:00
< ? php
/**
* Pay for order form
2012-08-14 18:05:45 +00:00
*
2015-09-03 12:56:26 +00:00
* @ author WooThemes
* @ package WooCommerce / Templates
* @ version 2.4 . 7
2012-01-29 13:36:33 +00:00
*/
2012-08-14 18:05:45 +00:00
2014-09-22 16:31:03 +00:00
if ( ! defined ( 'ABSPATH' ) ) {
2015-09-03 12:56:26 +00:00
exit ;
2014-09-22 16:31:03 +00:00
}
2012-01-29 13:36:33 +00:00
?>
2011-08-09 15:16:18 +00:00
< form id = " order_review " method = " post " >
2012-08-14 18:05:45 +00:00
2011-08-09 15:16:18 +00:00
< table class = " shop_table " >
< thead >
< tr >
2012-11-24 19:36:16 +00:00
< th class = " product-name " >< ? php _e ( 'Product' , 'woocommerce' ); ?> </th>
< th class = " product-quantity " >< ? php _e ( 'Qty' , 'woocommerce' ); ?> </th>
< th class = " product-total " >< ? php _e ( 'Totals' , 'woocommerce' ); ?> </th>
2011-08-09 15:16:18 +00:00
</ tr >
</ thead >
< tbody >
< ? php
2014-04-08 02:29:39 +00:00
if ( sizeof ( $order -> get_items () ) > 0 ) :
2014-01-15 05:53:37 +00:00
foreach ( $order -> get_items () as $item ) :
2011-08-09 15:16:18 +00:00
echo '
< tr >
2014-01-15 05:53:37 +00:00
< td class = " product-name " > ' . $item[' name '].' </ td >
< td class = " product-quantity " > ' . $item[' qty '].' </ td >
< td class = " product-subtotal " > ' . $order->get_formatted_line_subtotal( $item ) . ' </ td >
2011-08-09 15:16:18 +00:00
</ tr > ' ;
2012-08-14 18:05:45 +00:00
endforeach ;
2011-08-09 15:16:18 +00:00
endif ;
?>
</ tbody >
2014-07-11 01:50:51 +00:00
< tfoot >
< ? php
if ( $totals = $order -> get_order_item_totals () ) foreach ( $totals as $total ) :
?>
< tr >
< th scope = " row " colspan = " 2 " >< ? php echo $total [ 'label' ]; ?> </th>
< td class = " product-total " >< ? php echo $total [ 'value' ]; ?> </td>
</ tr >
< ? php
endforeach ;
?>
</ tfoot >
2011-08-09 15:16:18 +00:00
</ table >
2012-08-14 18:05:45 +00:00
2011-08-09 15:16:18 +00:00
< div id = " payment " >
2013-10-16 13:14:15 +00:00
< ? php if ( $order -> needs_payment () ) : ?>
2011-08-09 15:16:18 +00:00
< ul class = " payment_methods methods " >
2012-08-14 18:05:45 +00:00
< ? php
2013-11-25 14:01:32 +00:00
if ( $available_gateways = WC () -> payment_gateways -> get_available_payment_gateways () ) {
2011-08-09 15:16:18 +00:00
// Chosen Method
2015-09-03 12:56:26 +00:00
if ( sizeof ( $available_gateways ) ) {
2013-01-07 17:23:09 +00:00
current ( $available_gateways ) -> set_current ();
2015-09-03 12:56:26 +00:00
}
2013-01-07 17:23:09 +00:00
foreach ( $available_gateways as $gateway ) {
2011-08-09 15:16:18 +00:00
?>
2013-11-01 18:54:29 +00:00
< li class = " payment_method_<?php echo $gateway->id ; ?> " >
2014-01-28 11:25:52 +00:00
< input id = " payment_method_<?php echo $gateway->id ; ?> " type = " radio " class = " input-radio " name = " payment_method " value = " <?php echo esc_attr( $gateway->id ); ?> " < ? php checked ( $gateway -> chosen , true ); ?> data-order_button_text="<?php echo esc_attr( $gateway->order_button_text ); ?>" />
2012-08-14 18:05:45 +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
2013-01-07 17:23:09 +00:00
if ( $gateway -> has_fields () || $gateway -> get_description () ) {
2012-11-07 21:23:45 +00:00
echo '<div class="payment_box payment_method_' . $gateway -> id . '" style="display:none;">' ;
2011-08-09 15:16:18 +00:00
$gateway -> payment_fields ();
echo '</div>' ;
2013-01-07 17:23:09 +00:00
}
2011-08-09 15:16:18 +00:00
?>
</ li >
< ? php
2013-01-07 17:23:09 +00:00
}
} else {
2012-08-14 18:05:45 +00:00
2014-01-15 05:53:37 +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>' ;
2012-08-14 18:05:45 +00:00
2013-01-07 17:23:09 +00:00
}
2011-08-09 15:16:18 +00:00
?>
</ ul >
< ? php endif ; ?>
< div class = " form-row " >
2013-12-07 18:49:53 +00:00
< ? php wp_nonce_field ( 'woocommerce-pay' ); ?>
2013-11-28 16:10:50 +00:00
< ? php
2014-01-15 05:53:37 +00:00
$pay_order_button_text = apply_filters ( 'woocommerce_pay_order_button_text' , __ ( 'Pay for order' , 'woocommerce' ) );
2014-09-22 16:31:03 +00:00
2014-01-28 11:25:52 +00:00
echo apply_filters ( 'woocommerce_pay_order_button_html' , '<input type="submit" class="button alt" id="place_order" value="' . esc_attr ( $pay_order_button_text ) . '" data-value="' . esc_attr ( $pay_order_button_text ) . '" />' );
2014-09-22 16:31:03 +00:00
?>
2012-06-19 18:09:51 +00:00
< input type = " hidden " name = " woocommerce_pay " value = " 1 " />
2011-08-09 15:16:18 +00:00
</ div >
</ div >
2012-08-14 18:05:45 +00:00
2013-10-21 21:46:00 +00:00
</ form >