form-checkout.php
9.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<?php
/**
* Checkout Form
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-checkout.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you (the theme developer).
* will need to copy the new files to your theme to maintain compatibility. We try to do this.
* as little as possible, but it does happen. When this occurs the version of the template file will.
* be bumped and the readme will list any important changes.
*
* @see http://docs.woothemes.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.3.0
*/
if (!defined('ABSPATH')) {
exit;
}
wc_print_notices();
do_action('woocommerce_before_checkout_form', $checkout);
// If checkout registration is disabled and not logged in, the user cannot checkout
if (!$checkout->enable_signup && !$checkout->enable_guest_checkout && !is_user_logged_in()) {
echo apply_filters('woocommerce_checkout_must_be_logged_in_message', __('You must be logged in to checkout.', 'woocommerce'));
return;
}
foreach (WC()->cart->get_cart() as $cart_item_key => $cart_item) {
$_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)) {
}
}
$_page_to = '';
if ($cart_item['data']->product_type == 'subscription_variation') {
$_drinks = get_post_meta($cart_item['variation_id'], 'attribute_drinks')[0];
} else {
$_post_title = $cart_item['data']->post->post_title;
if ($_post_title != '') {
$_drinks = str_replace(' drinks', '', $_post_title);
}
}
?>
<form name="checkout" method="post" class="checkout woocommerce-checkout" action="<?php echo esc_url(wc_get_checkout_url()); ?>" enctype="multipart/form-data">
<div class="row" id="order_review">
<?php if (sizeof($checkout->checkout_fields) > 0) : ?>
<?php do_action('woocommerce_checkout_before_customer_details'); ?>
<div class="col_2-set col-lg-6 col-md-6 col-sm-6 col-xs-300" id="customer_details">
<div class="tvpayment tvbox ">
<?php do_action('woocommerce_checkout_before_billing'); ?>
<div class="clearfix"></div>
</div>
<div class="col-1 tvbox">
<?php do_action('woocommerce_checkout_billing'); ?>
<div class="clearfix"></div>
</div>
<div class="col-2 tvbox">
<?php do_action('woocommerce_checkout_shipping'); ?>
<div class="clearfix"></div>
</div>
<div class="clearfix"></div>
<div class="tvdelivery tvbox">
<h2 class="roboto_condensedbold font26"><?php echo _e('Delivery Instructions', 'woocommerce'); ?></h2>
<?php if (apply_filters('woocommerce_enable_order_notes_field', get_option('woocommerce_enable_order_comments', 'yes') === 'yes')) : ?>
<?php if (!WC()->cart->needs_shipping() || wc_ship_to_billing_address_only()) : ?>
<h3><?php _e('Additional Information', 'woocommerce'); ?></h3>
<?php endif; ?>
<?php foreach ($checkout->checkout_fields['order'] as $key => $field) : ?>
<?php woocommerce_form_field($key, $field, $checkout->get_value($key)); ?>
<?php endforeach; ?>
<?php endif; ?>
<?php
$checked = $checkout->get_value('authorise') ? $checkout->get_value('authorise') : 1;
woocommerce_form_field('authorise', array(
'type' => 'checkbox',
'class' => array('authorise'),
'label' => __('Authorise to leave package'),
), $checked);
?>
<p id="text_for_delivery"></p>
<div class="clearfix form-group desktop"></div>
</div>
</div>
<?php do_action('woocommerce_checkout_after_customer_details'); ?>
<?php endif; ?>
<?php do_action('woocommerce_checkout_before_order_review'); ?>
<div id="order_reviews" class="woocommerce-checkout-review-order col-lg-6 col-md-6 col-sm-6 col-xs-300 ">
<div class="tvboxtitle">
<h2 id="order_review_heading" class="roboto_condensedbold font26"><?php _e('Your order', 'woocommerce'); ?></h2>
<a class="update_your_order font16 robotoregular pull-left" href="<?php echo get_site_url(); ?>/get-started<?php echo (isset($_drinks)) ? '?higher_subscription=' . $_drinks : ''; ?>">Make changes</a>
<!--<img class="inline_block" src="<?php // echo get_site_url() . '/wp-content/themes/reize/assets/images/Hero_Shot.jpg' ?>" title="Hero Shot, in that spot. Crop closer to the drink if necessary."/>-->
</div>
<div class="tvbox">
<?php do_action('woocommerce_checkout_order_review'); ?>
<div class="footerorder">
<span class="add_gift_card pull-left ">Gift Card? <a class=" font16 robotoregular" href="#">Click here to apply code.</a> </span>
<h2 class="hot_cold roboto_condensedbold font18">Hot, cold, fizzy or smooth <br/> Drink it your way</h2>
</div>
</div>
</div>
<?php do_action('woocommerce_checkout_after_order_review'); ?>
<div class="clearfix"></div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-300">
<?php
/*
* Remove it
*/
$order_button_text = 'Checkout';
echo apply_filters('woocommerce_order_button_html', '<input type="submit" class="button tvarrow" name="woocommerce_checkout_place_order" id="" value="' . esc_attr($order_button_text) . '" data-value="' . esc_attr($order_button_text) . '" />');
?>
<div id="checkout_loader_img" class="hide">Loading…</div>
</div>
<div class="clearfix"></div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-300 secure_payment">
<div class="title_stripe">
<h3 class="font12 inline_block">
SECURE PAYMENT BY STRIPE
</h3>
<img class="inline_block" src="<?php echo get_site_url() . '/wp-content/themes/reize/assets/images/comodo_secure_seal_113x59_transp.png' ?>" title="SECURE PAYMENT BY STRIPE"/>
</div>
<div class="font12">
By clicking Check Out, you confirm that you accept the <a href="/legal-terms" >Terms of Service</a> and that your membership will automatically renew on a monthly basis and your credit card will automatically be charged the applicable monthly subscription fee until you cancel your membership. Your order will be shipped immediately each month upon confirmation of your payment.
</div>
</div>
</div>
</form>
<?php
$_drinks_switch = '';
switch ($_drinks) {
case 12:
$_drinks_switch = '30 drinks';
break;
case 60:
$_drinks_switch = '90 or 120 drinks';
break;
case 90:
$_drinks_switch = '120 drinks';
break;
case 180:
$_drinks_switch = '210 or 240 drinks';
break;
case 210:
$_drinks_switch = '240 drinks';
break;
default:
$_drinks_switch = '';
}
if ($_drinks_switch != '') {
?>
<!-- Modal -->
<div class="modal fade foreign_country" id="foreign_country" tabindex="-1" role="dialog" aria-labelledby="foreign_country">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">Close x</button>
<h4 class="modal-title" id="myModalLabel">PRO TIP</h4>
</div>
<div class="modal-body">
<?php
echo 'Pro tip - You selected ' . $_drinks . ' drinks per month, but you could get ' . $_drinks_switch . ' for the same shipping amount. <a href="/get-started/?protip_subscription=' . $_drinks . '" class="update_your_order">Click here to update your order</a>';
?>
</div>
</div>
</div>
</div>
<?php } ?>
<?php do_action('woocommerce_after_checkout_form', $checkout); ?>
<div id="term_different_currency_popup">
<h3>Terms And Conditions - Foreign Currency Transactions</h3>
<h5>If you are paying using a currency which is different from the currency of your card issuer, your card issuer will convert your transaction to the currency of your card, plus a certain margin that they will generally add. Some financial institutions will also charge a small additional fee, so please check with your card issuer to properly understand all of the fees and charges that might be applicable.</h5>
<h5>For monthly subscribers, the exchange rate will fluctuate in the future, which will impact the amount that you are charged in your own currency. It is your responsibility to monitor exchange rate fluctuations and how they will impact on your monthly payment.</h5>
</div>