caboose-cms 0.5.69 → 0.5.70
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/assets/javascripts/caboose/admin.js +2 -1
- data/app/assets/javascripts/caboose/admin_edit_order.js +0 -13
- data/app/assets/javascripts/caboose/admin_main.js +13 -0
- data/app/assets/javascripts/caboose/cart.js +145 -161
- data/app/assets/javascripts/caboose/cart_old.js +176 -0
- data/app/assets/javascripts/caboose/checkout.js +1 -1
- data/app/assets/javascripts/caboose/{checkout_step2.js → checkout_addresses.js} +3 -3
- data/app/assets/javascripts/caboose/checkout_gift_cards.js +47 -0
- data/app/assets/javascripts/caboose/{checkout_step1.js → checkout_login_register.js} +5 -53
- data/app/assets/javascripts/caboose/checkout_module.js +3 -4
- data/app/assets/javascripts/caboose/{checkout_step4.js → checkout_payment.js} +8 -8
- data/app/assets/javascripts/caboose/{checkout_step3.js → checkout_shipping.js} +5 -5
- data/app/assets/javascripts/caboose/imageZoom.js +66 -0
- data/app/assets/javascripts/caboose/model/attribute.js +2 -1
- data/app/assets/javascripts/caboose/model/bound_select.js +15 -6
- data/app/assets/javascripts/caboose/product.js +12 -2
- data/app/assets/stylesheets/caboose/checkout.css.scss +1 -0
- data/app/assets/templates/caboose/checkout/address.jst.ejs +1 -1
- data/app/controllers/caboose/cart_controller.rb +60 -8
- data/app/controllers/caboose/checkout_controller.rb +42 -71
- data/app/controllers/caboose/gift_cards_controller.rb +216 -0
- data/app/controllers/caboose/users_controller.rb +2 -2
- data/app/helpers/caboose/checkout_helper.rb +6 -5
- data/app/models/caboose/core_plugin.rb +2 -1
- data/app/models/caboose/discount.rb +8 -13
- data/app/models/caboose/gift_card.rb +49 -0
- data/app/models/caboose/order.rb +66 -46
- data/app/models/caboose/order_package.rb +11 -4
- data/app/models/caboose/order_package_calculator.rb +102 -0
- data/app/models/caboose/product_image.rb +10 -0
- data/app/models/caboose/schema.rb +38 -29
- data/app/models/caboose/shipping_calculator.rb +4 -2
- data/app/models/caboose/shipping_package.rb +7 -0
- data/app/views/caboose/cart/index.html.erb +12 -2
- data/app/views/caboose/checkout/#Untitled-1# +2 -0
- data/app/views/caboose/checkout/_cart.html.erb +45 -48
- data/app/views/caboose/checkout/_cart_old.html.erb +49 -0
- data/app/views/caboose/checkout/_confirm.html.erb +6 -4
- data/app/views/caboose/checkout/_confirm_table.html.erb +0 -0
- data/app/views/caboose/checkout/{step_two.html.erb → addresses.html.erb} +2 -2
- data/app/views/caboose/checkout/gift_cards.html.erb +35 -0
- data/app/views/caboose/checkout/index.html.erb +53 -42
- data/app/views/caboose/checkout/payment.html.erb +108 -75
- data/app/views/caboose/checkout/shipping.html.erb +62 -13
- data/app/views/caboose/gift_cards/admin_edit.html.erb +89 -0
- data/app/views/caboose/gift_cards/admin_index.html.erb +52 -0
- data/config/routes.rb +39 -19
- data/lib/caboose/engine.rb +1 -0
- data/lib/caboose/version.rb +1 -1
- metadata +20 -14
- data/app/assets/javascripts/caboose/cart2.js +0 -98
- data/app/views/caboose/checkout/step_four.html.erb +0 -67
- data/app/views/caboose/checkout/step_four_old.html.erb +0 -63
- data/app/views/caboose/checkout/step_one.html.erb +0 -54
- data/app/views/caboose/checkout/step_one_old.html.erb +0 -13
- data/app/views/caboose/checkout/step_three.html.erb +0 -55
- data/app/views/caboose/checkout/step_two_old.html.erb +0 -14
@@ -1,67 +0,0 @@
|
|
1
|
-
<%
|
2
|
-
store_config = @site.store_config
|
3
|
-
%>
|
4
|
-
<div id="checkout">
|
5
|
-
<h2>Payment</h2>
|
6
|
-
<%= render :partial => 'caboose/checkout/confirm' %>
|
7
|
-
<section id="checkout-payment">
|
8
|
-
<div class="wrapper">
|
9
|
-
<% if store_config.pp_name == 'authorize.net' %>
|
10
|
-
<form id="payment" target="relay" action="https://secure.authorize.net/gateway/transact.dll" method="post">
|
11
|
-
<%= sim_fields(@sim_transaction) %>
|
12
|
-
<input id="x_invoice_num" name="x_invoice_num" type="hidden" value="<%= @order.id %>" />
|
13
|
-
<input id="x_description" name="x_after_relay" type="hidden" value="<%= raw "#{@request.protocol}#{@request.host_with_port}/checkout/authnet-response/#{@order.id}" %>" />
|
14
|
-
<p>
|
15
|
-
<label>Card Number</label>
|
16
|
-
<input name="x_card_num" id='billing-cc-number' type="text" maxlength="16" />
|
17
|
-
</p>
|
18
|
-
|
19
|
-
<p>
|
20
|
-
<label>Expiration</label>
|
21
|
-
<input id="expiration" name="x_exp_date" type="hidden" />
|
22
|
-
<select id="month" name="month">
|
23
|
-
<option value="01">01 - Jan</option>
|
24
|
-
<option value="02">02 - Feb</option>
|
25
|
-
<option value="03">03 - Mar</option>
|
26
|
-
<option value="04">04 - Apr</option>
|
27
|
-
<option value="05">05 - May</option>
|
28
|
-
<option value="06">06 - Jun</option>
|
29
|
-
<option value="07">07 - Jul</option>
|
30
|
-
<option value="08">08 - Aug</option>
|
31
|
-
<option value="09">09 - Sep</option>
|
32
|
-
<option value="10">10 - Oct</option>
|
33
|
-
<option value="11">11 - Nov</option>
|
34
|
-
<option value="12">12 - Dec</option>
|
35
|
-
</select>
|
36
|
-
/
|
37
|
-
<select id="year" name="year">
|
38
|
-
<% (DateTime.now.year...DateTime.now.year + 20).each do |i| %>
|
39
|
-
<option value="<%= i-2000 %>"><%= i %></option>
|
40
|
-
<% end %>
|
41
|
-
</select>
|
42
|
-
</p>
|
43
|
-
|
44
|
-
<!--<input type="submit" value="Submit" />-->
|
45
|
-
|
46
|
-
</form>
|
47
|
-
<% end %>
|
48
|
-
</div>
|
49
|
-
</section>
|
50
|
-
<section id="checkout-continue">
|
51
|
-
<div id='message'></div>
|
52
|
-
<button class="blue">Continue</button>
|
53
|
-
<em>or</em>
|
54
|
-
<a href="/">return to the store</a>
|
55
|
-
</section>
|
56
|
-
<iframe id="relay" name="relay" style='display: block; width: 800px; height: 400px; border: #000 1px solid;'></iframe>
|
57
|
-
</div>
|
58
|
-
|
59
|
-
<%= content_for :caboose_js do %>
|
60
|
-
<%= javascript_include_tag 'caboose/checkout_step4' %>
|
61
|
-
<script type='text/javascript'>
|
62
|
-
var SHOW_RELAY = <%= @show_relay ? 'true' : 'false' %>;
|
63
|
-
</script>
|
64
|
-
<% end %>
|
65
|
-
<%= content_for :caboose_css do %>
|
66
|
-
<%= stylesheet_link_tag 'caboose/checkout' %>
|
67
|
-
<% end %>
|
@@ -1,63 +0,0 @@
|
|
1
|
-
<%
|
2
|
-
store_config = @site.store_config
|
3
|
-
%>
|
4
|
-
<div id="checkout">
|
5
|
-
<h2>Payment</h2>
|
6
|
-
<%= render :partial => 'caboose/checkout/confirm' %>
|
7
|
-
<section id="checkout-payment">
|
8
|
-
<div class="wrapper">
|
9
|
-
<% if store_config.pp_name == 'authorize.net' %>
|
10
|
-
<form id="payment" target="relay" action="https://secure.authorize.net/gateway/transact.dll" method="post">
|
11
|
-
<%= sim_fields(@sim_transaction) %>
|
12
|
-
|
13
|
-
<label>Card Number</label>
|
14
|
-
<input name="x_card_num" type="text" maxlength="16" />
|
15
|
-
<!--<br />
|
16
|
-
<label>Security Code</label><br />
|
17
|
-
<input id="x_card_code" name="x_card_code" type="text" />-->
|
18
|
-
<br />
|
19
|
-
|
20
|
-
<label>Expiration</label>
|
21
|
-
<input id="expiration" name="x_exp_date" type="hidden" />
|
22
|
-
<select id="month" name="month">
|
23
|
-
<option value="01">01 - Jan</option>
|
24
|
-
<option value="02">02 - Feb</option>
|
25
|
-
<option value="03">03 - Mar</option>
|
26
|
-
<option value="04">04 - Apr</option>
|
27
|
-
<option value="05">05 - May</option>
|
28
|
-
<option value="06">06 - Jun</option>
|
29
|
-
<option value="07">07 - Jul</option>
|
30
|
-
<option value="08">08 - Aug</option>
|
31
|
-
<option value="09">09 - Sep</option>
|
32
|
-
<option value="10">10 - Oct</option>
|
33
|
-
<option value="11">11 - Nov</option>
|
34
|
-
<option value="12">12 - Dec</option>
|
35
|
-
</select>
|
36
|
-
/
|
37
|
-
<select id="year" name="year">
|
38
|
-
<% (DateTime.now.year...DateTime.now.year + 20).each do |i| %>
|
39
|
-
<option value="<%= i-2000 %>"><%= i %></option>
|
40
|
-
<% end %>
|
41
|
-
</select><br />
|
42
|
-
<br />
|
43
|
-
<input type="submit" value="Submit" />
|
44
|
-
</form>
|
45
|
-
<iframe id="relay" name="relay" style='display: block; width: 800px; height: 400px; border: #000 1px solid;'></iframe>
|
46
|
-
<% end %>
|
47
|
-
</div>
|
48
|
-
</section>
|
49
|
-
<section id="checkout-continue">
|
50
|
-
<div id='message'></div>
|
51
|
-
<button class="blue">Continue</button>
|
52
|
-
<em>or</em>
|
53
|
-
<a href="/">return to the store</a>
|
54
|
-
</section>
|
55
|
-
|
56
|
-
</div>
|
57
|
-
|
58
|
-
<%= content_for :caboose_js do %>
|
59
|
-
<%= javascript_include_tag 'caboose/checkout_step4' %>
|
60
|
-
<% end %>
|
61
|
-
<%= content_for :caboose_css do %>
|
62
|
-
<%= stylesheet_link_tag 'caboose/checkout' %>
|
63
|
-
<% end %>
|
@@ -1,54 +0,0 @@
|
|
1
|
-
<h1>Checkout</h1>
|
2
|
-
|
3
|
-
<div id="checkout">
|
4
|
-
|
5
|
-
<% if @logged_in_user.id == 1 %>
|
6
|
-
<p class='note error'>You are logged in as the admin user. Please <a href='/logout'>logout</a> and complete your order as a different user.</p>
|
7
|
-
<% else %>
|
8
|
-
<section id="checkout-login">
|
9
|
-
<div class="wrapper" class='login-choices'>
|
10
|
-
<ul>
|
11
|
-
<li><p>Already a member? </p><button data-login-action="signin" id='signin_button' >Sign in</button></li>
|
12
|
-
<li><p>Continue as a new customer </p><button data-login-action="register" id='register_button' >New Customer</button></li>
|
13
|
-
</ul>
|
14
|
-
</div>
|
15
|
-
|
16
|
-
<section id='checkout-login-form'>
|
17
|
-
<div class="constrain" id='signin_form_container'>
|
18
|
-
<form action="/login" method="post" id='signin_form'>
|
19
|
-
<p><input name="username" type="text" placeholder="Email" /></p>
|
20
|
-
<p><input name="password" type="password" placeholder="Password" /></p>
|
21
|
-
<p><input type="submit" value="Continue" /></p>
|
22
|
-
</form>
|
23
|
-
</div>
|
24
|
-
<div class="constrain" id='register_form_container'>
|
25
|
-
<form action="/register" method="post" id='register_form'></p>
|
26
|
-
<p><input name="first_name" type="text" placeholder="First Name" /></p>
|
27
|
-
<p><input name="last_name" type="text" placeholder="Last Name" /></p>
|
28
|
-
<p><input name="email" type="text" placeholder="Email" /></p>
|
29
|
-
<p><input name="phone" type="text" placeholder="Phone" /></p>
|
30
|
-
<p><input name="pass1" type="password" placeholder="Password" /></p>
|
31
|
-
<p><input name="pass2" type="password" placeholder="Confirm Password" /></p>
|
32
|
-
<p><input name='newsletter' id='newsletter' type='checkbox' value='1' /> <label for='newsletter'>Send me updates on new products and special deals</label></p>
|
33
|
-
<p><input type="submit" value="Continue" /></p>
|
34
|
-
</form>
|
35
|
-
</div>
|
36
|
-
<div class="wrapper">
|
37
|
-
<div id='message'></div>
|
38
|
-
</div>
|
39
|
-
</section>
|
40
|
-
</section>
|
41
|
-
<% end %>
|
42
|
-
|
43
|
-
<section id="checkout-continue">
|
44
|
-
<a href="/">return to the store</a>
|
45
|
-
</section>
|
46
|
-
</div>
|
47
|
-
|
48
|
-
<%= content_for :caboose_js do %>
|
49
|
-
<%= javascript_include_tag 'caboose/checkout_step1' %>
|
50
|
-
<% end %>
|
51
|
-
<%= content_for :caboose_css do %>
|
52
|
-
<%= stylesheet_link_tag 'caboose/message_boxes' %>
|
53
|
-
<%= stylesheet_link_tag 'caboose/checkout' %>
|
54
|
-
<% end %>
|
@@ -1,13 +0,0 @@
|
|
1
|
-
<div id="checkout" class="loading">
|
2
|
-
<header>Checkout Step 1 of 3</header>
|
3
|
-
<section id="checkout-line-items"></section>
|
4
|
-
<figure class="loading"></figure>
|
5
|
-
<section id="checkout-login"></section>
|
6
|
-
<section id="checkout-address"></section>
|
7
|
-
|
8
|
-
<section id="checkout-continue">
|
9
|
-
<button class="blue">Continue</button>
|
10
|
-
<em>or</em>
|
11
|
-
<a href="/">return to the store</a>
|
12
|
-
</section>
|
13
|
-
</div>
|
@@ -1,55 +0,0 @@
|
|
1
|
-
|
2
|
-
<h1>Shipping Rates</h1>
|
3
|
-
<div id="checkout">
|
4
|
-
<%
|
5
|
-
Caboose.log(@rates.count)
|
6
|
-
%>
|
7
|
-
<% if @rates.count == 1 %>
|
8
|
-
<p>Please select which shipping method you'd like to use.</p>
|
9
|
-
<p>
|
10
|
-
<% @rates[0][:rates].each do |rate| %>
|
11
|
-
<a href='#' class='shipping_rate btn' data-carrier="<%= rate[:carrier] %>" data-service-code="<%= rate[:service_code] %>" data-service-name="<%= rate[:service_name] %>">
|
12
|
-
<%= number_to_currency(rate[:total_price], :precision => 2) %><br /><%= rate[:service_name] %>
|
13
|
-
</a>
|
14
|
-
<% end %>
|
15
|
-
</p>
|
16
|
-
<% else %>
|
17
|
-
<p>Your order must be shipped in multiple packages. Please select how you would like each package to be delivered.</p>
|
18
|
-
<table>
|
19
|
-
<tr>
|
20
|
-
<th>Package</th>
|
21
|
-
<th>Shipping Options</th>
|
22
|
-
</tr>
|
23
|
-
<% @rates.each_with_index do |package_rates, i| %>
|
24
|
-
<% op = package_rates[:order_package] %>
|
25
|
-
<% sp = op.shipping_package %>
|
26
|
-
<tr>
|
27
|
-
<td valign='top'>
|
28
|
-
<ul><% op.line_items.each do |li| %><li><%= li.variant.product.title %> (<%= li.variant.title %>)<% end %></ul>
|
29
|
-
</td>
|
30
|
-
<td valign='top'>
|
31
|
-
<% package_rates[:rates].each do |rate| %>
|
32
|
-
<a href='#' class='shipping_rate btn' data-carrier="<%= rate[:carrier] %>" data-service-code="<%= rate[:service_code] %>" data-service-name="<%= rate[:service_name] %>">
|
33
|
-
<%= number_to_currency(rate[:total_price], :precision => 2) %><br /><%= rate[:service_name] %>
|
34
|
-
</a>
|
35
|
-
<% end %>
|
36
|
-
</td>
|
37
|
-
</tr>
|
38
|
-
<% end %>
|
39
|
-
</table>
|
40
|
-
<% end %>
|
41
|
-
</div>
|
42
|
-
|
43
|
-
<div id='message'></div>
|
44
|
-
<p><a href="/">return to the store</a></p>
|
45
|
-
|
46
|
-
<%= content_for :caboose_js do %>
|
47
|
-
<%= javascript_include_tag 'caboose/checkout_step3' %>
|
48
|
-
<% end %>
|
49
|
-
<%= content_for :caboose_css do %>
|
50
|
-
<%= stylesheet_link_tag 'caboose/message_boxes' %>
|
51
|
-
<%= stylesheet_link_tag 'caboose/checkout' %>
|
52
|
-
<style type='text/css'>
|
53
|
-
a.shipping_rate { margin-bottom: 10px; margin-right: 10px; }
|
54
|
-
</style>
|
55
|
-
<% end %>
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<div id="checkout" class="loading">
|
2
|
-
<header>Thanks for shopping with us!</header>
|
3
|
-
<h3><span>step 2 of 2</span></h3>
|
4
|
-
<figure class="loading"></figure>
|
5
|
-
<section id="checkout-shipping"></section>
|
6
|
-
<section id="checkout-line-items"></section>
|
7
|
-
<section id="checkout-payment"></section>
|
8
|
-
|
9
|
-
<section id="checkout-complete">
|
10
|
-
<button class="blue">Complete my Purchase</button>
|
11
|
-
<em>or</em>
|
12
|
-
<a href="/">return to the store</a>
|
13
|
-
</section>
|
14
|
-
</div>
|