woocommerce/templates/checkout/review_order.php

156 lines
6.0 KiB
PHP
Raw Normal View History

<?php global $woocommerce; ?>
2011-08-09 15:16:18 +00:00
<div id="order_review">
<table class="shop_table">
<thead>
<tr>
2011-08-10 17:11:11 +00:00
<th><?php _e('Product', 'woothemes'); ?></th>
<th><?php _e('Qty', 'woothemes'); ?></th>
<th><?php _e('Totals', 'woothemes'); ?></th>
2011-08-09 15:16:18 +00:00
</tr>
</thead>
<tfoot>
<tr>
2011-08-10 17:11:11 +00:00
<td colspan="2"><?php _e('Subtotal', 'woothemes'); ?></td>
<td><?php echo $woocommerce->cart->get_cart_subtotal(); ?></td>
2011-08-09 15:16:18 +00:00
</tr>
<?php if ($woocommerce->cart->needs_shipping()) : ?>
2011-08-10 17:11:11 +00:00
<td colspan="2"><?php _e('Shipping', 'woothemes'); ?></td>
2011-08-09 15:16:18 +00:00
<td>
<?php
$available_methods = $woocommerce->shipping->get_available_shipping_methods();
2011-08-09 15:16:18 +00:00
if (sizeof($available_methods)>0) :
echo '<select name="shipping_method" id="shipping_method">';
foreach ($available_methods as $method ) :
echo '<option value="'.esc_attr($method->id).'" ';
2011-08-09 15:16:18 +00:00
if ($method->id==$_SESSION['_chosen_shipping_method']) echo 'selected="selected"';
2011-08-09 15:16:18 +00:00
echo '>'.esc_html($method->title).' &ndash; ';
2011-08-09 15:16:18 +00:00
if ($method->shipping_total>0) :
2011-08-10 17:11:11 +00:00
echo woocommerce_price($method->shipping_total);
2011-10-31 10:54:49 +00:00
if ($method->shipping_tax>0) : ' ' . $woocommerce->countries->ex_tax_or_vat(); endif;
2011-08-09 15:16:18 +00:00
else :
2011-08-10 17:11:11 +00:00
echo __('Free', 'woothemes');
2011-08-09 15:16:18 +00:00
endif;
echo '</option>';
endforeach;
echo '</select>';
else :
2011-10-26 09:40:26 +00:00
if ( !$woocommerce->customer->get_shipping_country() || !$woocommerce->customer->get_shipping_state() || !$woocommerce->customer->get_shipping_postcode() ) :
2011-08-10 17:11:11 +00:00
echo '<p>'.__('Please fill in your details above to see available shipping methods.', 'woothemes').'</p>';
2011-08-09 15:16:18 +00:00
else :
2011-08-10 17:11:11 +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.', 'woothemes').'</p>';
2011-08-09 15:16:18 +00:00
endif;
endif;
?></td>
<?php endif; ?>
<?php if ($woocommerce->cart->get_cart_tax()) : ?><tr>
2011-08-10 17:11:11 +00:00
<td colspan="2"><?php _e('Tax', 'woothemes'); ?></td>
<td><?php echo $woocommerce->cart->get_cart_tax(); ?></td>
2011-08-09 15:16:18 +00:00
</tr><?php endif; ?>
<?php if ($woocommerce->cart->get_total_discount()) : ?><tr class="discount">
2011-08-10 17:11:11 +00:00
<td colspan="2"><?php _e('Discount', 'woothemes'); ?></td>
<td>-<?php echo $woocommerce->cart->get_total_discount(); ?></td>
2011-08-09 15:16:18 +00:00
</tr><?php endif; ?>
<tr>
2011-08-10 17:11:11 +00:00
<td colspan="2"><strong><?php _e('Grand Total', 'woothemes'); ?></strong></td>
<td><strong><?php echo $woocommerce->cart->get_total(); ?></strong></td>
2011-08-09 15:16:18 +00:00
</tr>
</tfoot>
<tbody>
<?php
if (sizeof($woocommerce->cart->cart_contents)>0) :
foreach ($woocommerce->cart->cart_contents as $item_id => $values) :
2011-08-09 15:16:18 +00:00
$_product = $values['data'];
if ($_product->exists() && $values['quantity']>0) :
echo '
<tr>
2011-08-10 17:11:11 +00:00
<td class="product-name">'.$_product->get_title().woocommerce_get_formatted_variation( $values['variation'] ).'</td>
2011-08-09 15:16:18 +00:00
<td>'.$values['quantity'].'</td>
2011-08-10 17:11:11 +00:00
<td>'.woocommerce_price($_product->get_price_excluding_tax()*$values['quantity'], array('ex_tax_label' => 1)).'</td>
2011-08-09 15:16:18 +00:00
</tr>';
endif;
endforeach;
endif;
?>
</tbody>
</table>
<div id="payment">
<?php if ($woocommerce->cart->needs_payment()) : ?>
2011-08-09 15:16:18 +00:00
<ul class="payment_methods methods">
<?php
$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"'; ?> />
2011-09-21 16:58:05 +00:00
<label for="payment_method_<?php echo $gateway->id; ?>"><?php echo $gateway->title; ?> <?php echo apply_filters('woocommerce_gateway_icon', $gateway->icon(), $gateway->id); ?></label>
2011-08-09 15:16:18 +00:00
<?php
if ($gateway->has_fields || $gateway->description) :
echo '<div class="payment_box payment_method_'.$gateway->id.'" style="display:none;">';
$gateway->payment_fields();
echo '</div>';
endif;
?>
</li>
<?php
endforeach;
else :
if ( !$woocommerce->customer->get_country() ) :
2011-08-10 17:11:11 +00:00
echo '<p>'.__('Please fill in your details above to see available payment methods.', 'woothemes').'</p>';
2011-08-09 15:16:18 +00:00
else :
2011-08-10 17:11:11 +00:00
echo '<p>'.__('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.', 'woothemes').'</p>';
2011-08-09 15:16:18 +00:00
endif;
endif;
?>
</ul>
<?php endif; ?>
<div class="form-row">
2011-08-10 17:11:11 +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.', 'woothemes'); ?><br/><input type="submit" class="button-alt" name="update_totals" value="<?php _e('Update totals', 'woothemes'); ?>" /></noscript>
2011-08-09 15:16:18 +00:00
<?php $woocommerce->nonce_field('process_checkout')?>
2011-08-09 15:16:18 +00:00
2011-08-10 17:11:11 +00:00
<?php do_action( 'woocommerce_review_order_before_submit' ); ?>
2011-08-09 15:16:18 +00:00
2011-10-05 20:08:31 +00:00
<input type="submit" class="button alt" name="place_order" id="place_order" value="<?php _e('Place order', 'woothemes'); ?>" />
2011-08-10 17:11:11 +00:00
<?php if (get_option('woocommerce_terms_page_id')>0) : ?>
2011-08-09 15:16:18 +00:00
<p class="form-row terms">
2011-09-21 06:50:40 +00:00
<label for="terms" class="checkbox"><?php _e('I accept the', 'woothemes'); ?> <a href="<?php echo esc_url( get_permalink(get_option('woocommerce_terms_page_id')) ); ?>" target="_blank"><?php _e('terms &amp; conditions', 'woothemes'); ?></a></label>
2011-08-09 15:16:18 +00:00
<input type="checkbox" class="input-checkbox" name="terms" <?php if (isset($_POST['terms'])) echo 'checked="checked"'; ?> id="terms" />
</p>
<?php endif; ?>
2011-08-10 17:11:11 +00:00
<?php do_action( 'woocommerce_review_order_after_submit' ); ?>
2011-08-09 15:16:18 +00:00
</div>
</div>
</div>