2012-02-11 13:46:54 +00:00
< ? php
/**
2012-08-14 18:05:45 +00:00
* Review order form
*
* @ author WooThemes
* @ package WooCommerce / Templates
2014-04-30 10:20:19 +00:00
* @ version 2.1 . 8
2012-02-11 13:46:54 +00:00
*/
2012-08-14 18:05:45 +00:00
2012-10-15 10:57:58 +00:00
if ( ! defined ( 'ABSPATH' ) ) exit ; // Exit if accessed directly
2012-02-11 13:46:54 +00:00
?>
2014-04-30 10:20:19 +00:00
< ? php if ( ! is_ajax () ) : ?> <div id="order_review"><?php endif; ?>
2012-08-14 18:05:45 +00:00
2012-12-16 16:28:54 +00:00
< table class = " shop_table " >
2011-08-09 15:16:18 +00:00
< thead >
< tr >
2012-10-16 09:45:33 +00:00
< th class = " product-name " >< ? php _e ( 'Product' , 'woocommerce' ); ?> </th>
2012-12-16 16:28:54 +00:00
< th class = " product-total " >< ? php _e ( 'Total' , 'woocommerce' ); ?> </th>
2011-08-09 15:16:18 +00:00
</ tr >
</ thead >
< tfoot >
2013-08-14 20:00:34 +00:00
2011-12-30 21:11:18 +00:00
< tr class = " cart-subtotal " >
2012-12-16 16:28:54 +00:00
< th >< ? php _e ( 'Cart Subtotal' , 'woocommerce' ); ?> </th>
2013-08-14 20:00:34 +00:00
< td >< ? php wc_cart_totals_subtotal_html (); ?> </td>
2011-12-30 21:11:18 +00:00
</ tr >
2012-08-14 18:05:45 +00:00
2013-10-18 17:10:55 +00:00
< ? php foreach ( WC () -> cart -> get_coupons ( 'cart' ) as $code => $coupon ) : ?>
2013-08-14 20:00:34 +00:00
< tr class = " cart-discount coupon-<?php echo esc_attr( $code ); ?> " >
2014-02-21 15:16:43 +00:00
< th >< ? php wc_cart_totals_coupon_label ( $coupon ); ?> </th>
2013-10-18 17:10:55 +00:00
< td >< ? php wc_cart_totals_coupon_html ( $coupon ); ?> </td>
2013-08-14 20:00:34 +00:00
</ tr >
< ? php endforeach ; ?>
2012-08-14 18:05:45 +00:00
2013-08-14 20:00:34 +00:00
< ? php if ( WC () -> cart -> needs_shipping () && WC () -> cart -> show_shipping () ) : ?>
2012-08-14 18:05:45 +00:00
2013-08-14 20:00:34 +00:00
< ? php do_action ( 'woocommerce_review_order_before_shipping' ); ?>
2012-11-27 16:22:47 +00:00
2013-08-14 20:00:34 +00:00
< ? php wc_cart_totals_shipping_html (); ?>
2012-11-27 16:22:47 +00:00
2013-08-14 20:00:34 +00:00
< ? php do_action ( 'woocommerce_review_order_after_shipping' ); ?>
2011-08-09 15:16:18 +00:00
< ? php endif ; ?>
2012-11-27 16:22:47 +00:00
2013-08-14 20:00:34 +00:00
< ? php foreach ( WC () -> cart -> get_fees () as $fee ) : ?>
< tr class = " fee " >
< th >< ? php echo esc_html ( $fee -> name ); ?> </th>
< td >< ? php wc_cart_totals_fee_html ( $fee ); ?> </td>
2012-11-12 17:15:54 +00:00
</ tr >
< ? php endforeach ; ?>
2012-08-14 18:05:45 +00:00
2014-01-23 04:36:24 +00:00
< ? php if ( WC () -> cart -> tax_display_cart === 'excl' ) : ?>
< ? php if ( get_option ( 'woocommerce_tax_total_display' ) === 'itemized' ) : ?>
2013-09-23 15:10:09 +00:00
< ? php foreach ( WC () -> cart -> get_tax_totals () as $code => $tax ) : ?>
< tr class = " tax-rate tax-rate-<?php echo sanitize_title( $code ); ?> " >
< th >< ? php echo esc_html ( $tax -> label ); ?> </th>
< td >< ? php echo wp_kses_post ( $tax -> formatted_amount ); ?> </td>
</ tr >
< ? php endforeach ; ?>
< ? php else : ?>
< tr class = " tax-total " >
< th >< ? php echo esc_html ( WC () -> countries -> tax_or_vat () ); ?> </th>
2013-11-25 13:34:21 +00:00
< td >< ? php echo wc_price ( WC () -> cart -> get_taxes_total () ); ?> </td>
2013-08-14 20:00:34 +00:00
</ tr >
2013-09-23 15:10:09 +00:00
< ? php endif ; ?>
2011-12-30 21:11:18 +00:00
< ? php endif ; ?>
2012-08-14 18:05:45 +00:00
2013-10-18 17:10:55 +00:00
< ? php foreach ( WC () -> cart -> get_coupons ( 'order' ) as $code => $coupon ) : ?>
2013-08-14 20:00:34 +00:00
< tr class = " order-discount coupon-<?php echo esc_attr( $code ); ?> " >
2014-02-21 15:16:43 +00:00
< th >< ? php wc_cart_totals_coupon_label ( $coupon ); ?> </th>
2013-10-18 17:10:55 +00:00
< td >< ? php wc_cart_totals_coupon_html ( $coupon ); ?> </td>
2013-08-14 20:00:34 +00:00
</ tr >
< ? php endforeach ; ?>
2012-12-29 19:04:18 +00:00
< ? php do_action ( 'woocommerce_review_order_before_order_total' ); ?>
2012-08-14 18:05:45 +00:00
2013-08-14 20:00:34 +00:00
< tr class = " order-total " >
< th >< ? php _e ( 'Order Total' , 'woocommerce' ); ?> </th>
< td >< ? php wc_cart_totals_order_total_html (); ?> </td>
2011-08-09 15:16:18 +00:00
</ tr >
2012-08-14 18:05:45 +00:00
2012-12-29 19:04:18 +00:00
< ? php do_action ( 'woocommerce_review_order_after_order_total' ); ?>
2011-08-09 15:16:18 +00:00
</ tfoot >
2012-12-16 16:28:54 +00:00
< tbody >
< ? php
2012-12-29 19:04:18 +00:00
do_action ( 'woocommerce_review_order_before_cart_contents' );
2013-08-14 20:00:34 +00:00
foreach ( WC () -> cart -> get_cart () as $cart_item_key => $cart_item ) {
2013-06-17 11:21:06 +00:00
$_product = apply_filters ( 'woocommerce_cart_item_product' , $cart_item [ 'data' ], $cart_item , $cart_item_key );
if ( $_product && $_product -> exists () && $cart_item [ 'quantity' ] > 0 && apply_filters ( 'woocommerce_checkout_cart_item_visible' , true , $cart_item , $cart_item_key ) ) {
?>
< tr class = " <?php echo esc_attr( apply_filters( 'woocommerce_cart_item_class', 'cart_item', $cart_item , $cart_item_key ) ); ?> " >
< td class = " product-name " >
< ? php echo apply_filters ( 'woocommerce_cart_item_name' , $_product -> get_title (), $cart_item , $cart_item_key ); ?>
< ? php echo apply_filters ( 'woocommerce_checkout_cart_item_quantity' , ' <strong class="product-quantity">' . sprintf ( '× %s' , $cart_item [ 'quantity' ] ) . '</strong>' , $cart_item , $cart_item_key ); ?>
2013-08-14 20:00:34 +00:00
< ? php echo WC () -> cart -> get_item_data ( $cart_item ); ?>
2013-06-17 11:21:06 +00:00
</ td >
< td class = " product-total " >
2013-08-14 20:00:34 +00:00
< ? php echo apply_filters ( 'woocommerce_cart_item_subtotal' , WC () -> cart -> get_product_subtotal ( $_product , $cart_item [ 'quantity' ] ), $cart_item , $cart_item_key ); ?>
2013-06-17 11:21:06 +00:00
</ td >
</ tr >
< ? php
}
}
2012-12-16 16:28:54 +00:00
2012-12-29 19:04:18 +00:00
do_action ( 'woocommerce_review_order_after_cart_contents' );
2012-12-16 16:28:54 +00:00
?>
</ tbody >
2011-08-09 15:16:18 +00:00
</ table >
2012-08-14 18:05:45 +00:00
2013-07-22 17:06:03 +00:00
< ? php do_action ( 'woocommerce_review_order_before_payment' ); ?>
2011-08-09 15:16:18 +00:00
< div id = " payment " >
2014-01-15 05:53:37 +00:00
< ? php if ( WC () -> cart -> 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-08-14 20:00:34 +00:00
$available_gateways = WC () -> payment_gateways -> get_available_payment_gateways ();
2013-01-02 12:59:36 +00:00
if ( ! empty ( $available_gateways ) ) {
2011-08-09 15:16:18 +00:00
// Chosen Method
2013-08-14 20:00:34 +00:00
if ( isset ( WC () -> session -> chosen_payment_method ) && isset ( $available_gateways [ WC () -> session -> chosen_payment_method ] ) ) {
$available_gateways [ WC () -> session -> chosen_payment_method ] -> set_current ();
2013-01-02 12:59:36 +00:00
} elseif ( isset ( $available_gateways [ get_option ( 'woocommerce_default_gateway' ) ] ) ) {
$available_gateways [ get_option ( 'woocommerce_default_gateway' ) ] -> set_current ();
} else {
current ( $available_gateways ) -> set_current ();
}
2012-11-27 16:22:47 +00:00
2013-01-02 12:59:36 +00:00
foreach ( $available_gateways as $gateway ) {
2011-08-09 15:16:18 +00:00
?>
2013-10-31 12:01:11 +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 ); ?>" />
2013-01-02 12:59:36 +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-08-14 18:05:45 +00:00
if ( $gateway -> has_fields () || $gateway -> get_description () ) :
2012-12-10 11:06:14 +00:00
echo '<div class="payment_box payment_method_' . $gateway -> id . '" ' . ( $gateway -> chosen ? '' : 'style="display:none;"' ) . '>' ;
2011-08-09 15:16:18 +00:00
$gateway -> payment_fields ();
echo '</div>' ;
endif ;
?>
</ li >
< ? php
2013-01-02 12:59:36 +00:00
}
} else {
2012-08-14 18:05:45 +00:00
2013-08-14 20:00:34 +00:00
if ( ! WC () -> customer -> get_country () )
2014-03-12 11:14:06 +00:00
$no_gateways_message = __ ( 'Please fill in your details above to see available payment methods.' , 'woocommerce' );
2013-01-02 12:59:36 +00:00
else
2014-03-12 11:14:06 +00:00
$no_gateways_message = __ ( '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' );
echo '<p>' . apply_filters ( 'woocommerce_no_available_payment_methods_message' , $no_gateways_message ) . '</p>' ;
2012-08-14 18:05:45 +00:00
2013-01-02 12:59:36 +00:00
}
2011-08-09 15:16:18 +00:00
?>
</ ul >
< ? php endif ; ?>
2012-06-06 15:48:35 +00:00
< div class = " form-row place-order " >
2012-08-14 18:05:45 +00:00
2012-10-16 09:45:33 +00:00
< noscript >< ? 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' ); ?> <br/><input type="submit" class="button alt" name="woocommerce_checkout_update_totals" value="<?php _e( 'Update totals', 'woocommerce' ); ?>" /></noscript>
2012-08-14 18:05:45 +00:00
2013-12-07 18:49:53 +00:00
< ? php wp_nonce_field ( 'woocommerce-process_checkout' ); ?>
2012-08-14 18:05:45 +00:00
2011-08-10 17:11:11 +00:00
< ? php do_action ( 'woocommerce_review_order_before_submit' ); ?>
2012-08-14 18:05:45 +00:00
2013-04-01 23:45:28 +00:00
< ? php
2014-01-15 05:53:37 +00:00
$order_button_text = apply_filters ( 'woocommerce_order_button_text' , __ ( 'Place order' , 'woocommerce' ) );
2013-04-29 14:51:17 +00:00
2014-01-28 11:25:52 +00:00
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 ) . '" />' );
2013-04-01 23:45:28 +00:00
?>
2012-08-14 18:05:45 +00:00
2013-12-04 16:56:31 +00:00
< ? php if ( wc_get_page_id ( 'terms' ) > 0 && apply_filters ( 'woocommerce_checkout_show_terms' , true ) ) {
2013-12-05 08:43:57 +00:00
$terms_is_checked = apply_filters ( 'woocommerce_terms_is_checked_default' , isset ( $_POST [ 'terms' ] ) );
2013-12-04 16:56:31 +00:00
?>
2013-05-13 11:41:52 +00:00
< p class = " form-row terms " >
2014-03-24 11:15:45 +00:00
< label for = " terms " class = " checkbox " >< ? php printf ( __ ( 'I’ve read and accept the <a href="%s" target="_blank">terms & conditions</a>' , 'woocommerce' ), esc_url ( get_permalink ( wc_get_page_id ( 'terms' ) ) ) ); ?> </label>
2013-12-04 16:56:31 +00:00
< input type = " checkbox " class = " input-checkbox " name = " terms " < ? php checked ( $terms_is_checked , true ); ?> id="terms" />
2013-05-13 11:41:52 +00:00
</ p >
< ? php } ?>
2012-08-14 18:05:45 +00:00
2011-08-10 17:11:11 +00:00
< ? php do_action ( 'woocommerce_review_order_after_submit' ); ?>
2012-08-14 18:05:45 +00:00
2011-08-09 15:16:18 +00:00
</ div >
2012-08-14 18:05:45 +00:00
2011-11-16 09:38:04 +00:00
< div class = " clear " ></ div >
2011-08-09 15:16:18 +00:00
</ div >
2012-08-14 18:05:45 +00:00
2013-07-22 17:06:03 +00:00
< ? php do_action ( 'woocommerce_review_order_after_payment' ); ?>
2014-04-30 10:20:19 +00:00
< ? php if ( ! is_ajax () ) : ?> </div><?php endif; ?>