2011-12-09 20:29:43 +00:00
< ? php
/**
* Cart Totals
*/
global $woocommerce ;
$available_methods = $woocommerce -> shipping -> get_available_shipping_methods ();
?>
< div class = " cart_totals <?php if (isset( $_SESSION['calculated_shipping'] ) && $_SESSION['calculated_shipping'] ) echo 'calculated_shipping'; ?> " >
< ? php if ( ! $woocommerce -> shipping -> enabled || $available_methods || ! $woocommerce -> customer -> get_shipping_country () || ! isset ( $_SESSION [ 'calculated_shipping' ]) || ! $_SESSION [ 'calculated_shipping' ] ) : ?>
2012-01-05 11:31:22 +00:00
< h2 >< ? php _e ( 'Cart Totals' , 'woocommerce' ); ?> </h2>
2011-12-09 20:29:43 +00:00
< table cellspacing = " 0 " cellpadding = " 0 " >
< tbody >
2011-12-30 21:11:18 +00:00
< tr class = " cart-subtotal " >
2012-01-05 11:31:22 +00:00
< th >< strong >< ? php _e ( 'Cart Subtotal' , 'woocommerce' ); ?> </strong></th>
2011-12-30 21:11:18 +00:00
< td >< strong >< ? php echo $woocommerce -> cart -> get_cart_subtotal (); ?> </strong></td>
</ tr >
< ? php if ( $woocommerce -> cart -> get_discounts_before_tax ()) : ?>
< tr class = " discount " >
2012-01-05 11:31:22 +00:00
< th >< ? php _e ( 'Cart Discount' , 'woocommerce' ); ?> <a href="<?php echo add_query_arg('remove_discounts', '1') ?>"><?php _e('[Remove]', 'woocommerce'); ?></a></th>
2011-12-30 21:11:18 +00:00
< td >-< ? php echo $woocommerce -> cart -> get_discounts_before_tax (); ?> </td>
</ tr >
< ? php endif ; ?>
< ? php if ( $woocommerce -> cart -> needs_shipping ()) : ?>
< tr class = " shipping " >
2012-01-05 11:31:22 +00:00
< th >< ? php _e ( 'Shipping' , 'woocommerce' ); ?> </th>
2011-12-30 21:11:18 +00:00
< td >
< ? php
if ( sizeof ( $available_methods ) > 0 ) :
2011-12-30 19:36:44 +00:00
2011-12-30 21:11:18 +00:00
echo '<select name="shipping_method" id="shipping_method">' ;
foreach ( $available_methods as $method ) :
2012-02-09 09:44:43 +00:00
echo '<option value="' . esc_attr ( $method -> id ) . '" ' . selected ( $method -> id , $_SESSION [ '_chosen_shipping_method' ], false ) . '>' . $method -> label ;
2012-01-03 19:07:32 +00:00
if ( $method -> cost > 0 ) :
2012-02-09 09:44:43 +00:00
echo ' — ' ;
2012-01-02 00:49:00 +00:00
2011-12-30 21:11:18 +00:00
if ( $woocommerce -> cart -> display_totals_ex_tax || ! $woocommerce -> cart -> prices_include_tax ) :
2012-01-03 19:07:32 +00:00
echo woocommerce_price ( $method -> cost );
2012-01-04 16:24:26 +00:00
if ( $method -> get_shipping_tax () > 0 && $woocommerce -> cart -> prices_include_tax ) :
2011-12-30 21:11:18 +00:00
echo ' ' . $woocommerce -> countries -> ex_tax_or_vat ();
endif ;
else :
2012-01-04 16:24:26 +00:00
echo woocommerce_price ( $method -> cost + $method -> get_shipping_tax ());
if ( $method -> get_shipping_tax () > 0 && ! $woocommerce -> cart -> prices_include_tax ) :
2011-12-30 21:11:18 +00:00
echo ' ' . $woocommerce -> countries -> inc_tax_or_vat ();
endif ;
2011-12-09 20:29:43 +00:00
endif ;
2011-12-30 21:11:18 +00:00
2011-12-30 19:36:44 +00:00
endif ;
2011-12-30 21:11:18 +00:00
echo '</option>' ;
endforeach ;
echo '</select>' ;
else :
if ( ! $woocommerce -> customer -> get_shipping_country () || ! $woocommerce -> customer -> get_shipping_state () || ! $woocommerce -> customer -> get_shipping_postcode () ) :
2012-01-05 11:31:22 +00:00
echo '<p>' . __ ( 'Please fill in your details above to see available shipping methods.' , 'woocommerce' ) . '</p>' ;
2011-12-30 19:36:44 +00:00
else :
2012-01-05 11:31:22 +00:00
echo '<p>' . __ ( 'Sorry, it seems that there are no available shipping methods for your state. Please contact us if you require assistance or wish to make alternate arrangements.' , 'woocommerce' ) . '</p>' ;
2011-12-09 20:29:43 +00:00
endif ;
2011-12-30 21:11:18 +00:00
endif ;
?> </td>
2011-12-28 23:59:33 +00:00
2011-12-30 21:11:18 +00:00
</ tr >
< ? php endif ; ?>
< ? php
2012-01-09 18:00:52 +00:00
if ( get_option ( 'woocommerce_display_cart_taxes' ) == 'yes' && $woocommerce -> cart -> get_cart_tax ()) :
2012-01-04 16:24:26 +00:00
2012-01-27 15:00:03 +00:00
$taxes = $woocommerce -> cart -> get_taxes ();
if ( sizeof ( $taxes ) > 0 ) :
2011-12-30 19:36:44 +00:00
2011-12-30 21:11:18 +00:00
$has_compound_tax = false ;
2012-01-27 15:00:03 +00:00
foreach ( $taxes as $key => $tax ) :
2012-01-14 16:42:04 +00:00
if ( $woocommerce -> cart -> tax -> is_compound ( $key )) : $has_compound_tax = true ; continue ; endif ;
if ( $tax == 0 ) continue ;
2011-12-30 21:11:18 +00:00
?>
< tr class = " tax-rate tax-rate-<?php echo $key ; ?> " >
2012-01-23 11:12:34 +00:00
< th >< ? php if ( get_option ( 'woocommerce_prices_include_tax' ) == 'yes' ) : _e ( 'incl.' , 'woocommerce' ); endif ; ?> <?php echo $woocommerce->cart->tax->get_rate_label( $key ); ?></th>
2011-12-30 21:11:18 +00:00
< td >< ? php echo woocommerce_price ( $tax ); ?> </td>
</ tr >
< ? php
endforeach ;
2012-01-04 23:01:47 +00:00
if ( $has_compound_tax && ! $woocommerce -> cart -> prices_include_tax ) :
2011-12-30 21:11:18 +00:00
?>
< tr class = " order-subtotal " >
2012-01-05 11:31:22 +00:00
< th >< strong >< ? php _e ( 'Subtotal' , 'woocommerce' ); ?> </strong></th>
2011-12-30 21:11:18 +00:00
< td >< strong >< ? php echo $woocommerce -> cart -> get_cart_subtotal ( true ); ?> </strong></td>
</ tr >
< ? php
endif ;
2012-01-27 15:00:03 +00:00
foreach ( $taxes as $key => $tax ) :
2012-01-14 16:42:04 +00:00
if ( ! $woocommerce -> cart -> tax -> is_compound ( $key )) continue ;
if ( $tax == 0 ) continue ;
2011-12-30 21:11:18 +00:00
?>
< tr class = " tax-rate tax-rate-<?php echo $key ; ?> " >
2012-01-28 15:34:21 +00:00
< th >< ? php if ( get_option ( 'woocommerce_prices_include_tax' ) == 'yes' ) : _e ( 'incl.' , 'woocommerce' ); endif ; ?> <?php echo $woocommerce->cart->tax->get_rate_label( $key ); ?></th>
2011-12-30 21:11:18 +00:00
< td >< ? php echo woocommerce_price ( $tax ); ?> </td>
</ tr >
< ? php
endforeach ;
2011-12-30 19:36:44 +00:00
2011-12-30 21:11:18 +00:00
else :
?>
< tr class = " tax " >
2012-01-05 11:31:22 +00:00
< th >< ? php _e ( 'Tax' , 'woocommerce' ); ?> </th>
2011-12-30 21:11:18 +00:00
< td >< ? php echo $woocommerce -> cart -> get_cart_tax (); ?> </td>
</ tr >
< ? php
endif ;
2011-12-30 19:36:44 +00:00
endif ;
?>
2011-12-30 21:11:18 +00:00
< ? php if ( $woocommerce -> cart -> get_discounts_after_tax ()) : ?>
< tr class = " discount " >
2012-01-05 11:31:22 +00:00
< th >< ? php _e ( 'Order Discount' , 'woocommerce' ); ?> <a href="<?php echo add_query_arg('remove_discounts', '2') ?>"><?php _e('[Remove]', 'woocommerce'); ?></a></th>
2011-12-30 21:11:18 +00:00
< td >-< ? php echo $woocommerce -> cart -> get_discounts_after_tax (); ?> </td>
</ tr >
< ? php endif ; ?>
< tr class = " total " >
2012-01-05 11:31:22 +00:00
< th >< strong >< ? php _e ( 'Order Total' , 'woocommerce' ); ?> </strong></th>
2012-01-09 18:00:52 +00:00
< td >< strong >< ? php
if ( get_option ( 'woocommerce_display_cart_taxes' ) == 'no' && ! $woocommerce -> cart -> prices_include_tax ) :
echo $woocommerce -> cart -> get_total_ex_tax ();
else :
echo $woocommerce -> cart -> get_total ();
endif ;
?> </strong></td>
2011-12-30 21:11:18 +00:00
</ tr >
2011-12-09 20:29:43 +00:00
</ tbody >
</ table >
2011-12-30 14:00:41 +00:00
< p >< small >< ? php
if ( $woocommerce -> customer -> is_customer_outside_base ()) :
2012-01-25 15:23:32 +00:00
$estimated_text = ' ' . sprintf ( __ ( '(taxes estimated for %s)' , 'woocommerce' ), $woocommerce -> countries -> estimated_for_prefix () . __ ( $woocommerce -> countries -> countries [ $woocommerce -> countries -> get_base_country () ], 'woocommerce' ) );
2011-12-30 14:00:41 +00:00
else :
$estimated_text = '' ;
endif ;
2012-01-05 11:31:22 +00:00
echo sprintf ( __ ( 'Note: Shipping and taxes are estimated%s and will be updated during checkout based on your billing and shipping information.' , 'woocommerce' ), $estimated_text );
2011-12-30 14:00:41 +00:00
?> </small></p>
2011-12-09 20:29:43 +00:00
< ? php else : ?>
2012-01-13 12:11:48 +00:00
< ? php if ( ! $woocommerce -> customer -> get_shipping_state () || ! $woocommerce -> customer -> get_shipping_postcode ()) : ?>
< div class = " woocommerce_info " >
< p >< ? php _e ( 'No shipping methods were found; please recalculate your shipping and enter your state/county and zip/postcode to ensure their are no other available methods for your location.' , 'woocommerce' ); ?> </p>
</ div >
< ? php else : ?>
< div class = " woocommerce_error " >
< p >< ? php printf ( __ ( 'Sorry, it seems that there are no available shipping methods for your location (%s).' , 'woocommerce' ), $woocommerce -> countries -> countries [ $woocommerce -> customer -> get_shipping_country () ]); ?> </p>
< p >< ? php _e ( 'If you require assistance or wish to make alternate arrangements please contact us.' , 'woocommerce' ); ?> </p>
</ div >
< ? php endif ; ?>
2011-12-09 20:29:43 +00:00
< ? php endif ; ?>
</ div >