spree_core 1.2.0.rc2 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. data/app/assets/images/noimage/large.png +0 -0
  2. data/app/assets/javascripts/admin/admin.js.erb +1 -0
  3. data/app/assets/javascripts/admin/product_autocomplete.js.erb +1 -0
  4. data/app/assets/javascripts/admin/shipping_methods.js.coffee +10 -0
  5. data/app/assets/javascripts/admin/zone.js.coffee +39 -0
  6. data/app/assets/javascripts/store/cart.js.coffee +4 -5
  7. data/app/assets/javascripts/store/product.js.coffee +1 -2
  8. data/app/controllers/spree/admin/general_settings_controller.rb +1 -1
  9. data/app/controllers/spree/admin/images_controller.rb +5 -13
  10. data/app/controllers/spree/admin/orders_controller.rb +3 -1
  11. data/app/controllers/spree/admin/products_controller.rb +2 -6
  12. data/app/controllers/spree/admin/prototypes_controller.rb +2 -2
  13. data/app/controllers/spree/checkout_controller.rb +12 -23
  14. data/app/controllers/spree/orders_controller.rb +1 -0
  15. data/app/helpers/spree/admin/general_settings_helper.rb +13 -0
  16. data/app/helpers/spree/admin/users_helper.rb +1 -1
  17. data/app/helpers/spree/base_helper.rb +9 -24
  18. data/app/helpers/spree/products_helper.rb +2 -6
  19. data/app/models/spree/ability.rb +3 -3
  20. data/app/models/spree/address.rb +1 -1
  21. data/app/models/spree/adjustment.rb +4 -0
  22. data/app/models/spree/app_configuration.rb +3 -1
  23. data/app/models/spree/credit_card.rb +1 -1
  24. data/app/models/spree/inventory_unit.rb +1 -1
  25. data/app/models/spree/line_item.rb +1 -1
  26. data/app/models/spree/order.rb +14 -1
  27. data/app/models/spree/order/checkout.rb +19 -5
  28. data/app/models/spree/product.rb +37 -29
  29. data/app/models/spree/product/scopes.rb +2 -2
  30. data/app/models/spree/shipping_rate.rb +10 -0
  31. data/app/models/spree/variant.rb +14 -8
  32. data/app/views/spree/admin/adjustments/_adjustments_table.html.erb +1 -1
  33. data/app/views/spree/admin/general_settings/edit.html.erb +15 -6
  34. data/app/views/spree/admin/general_settings/show.html.erb +6 -0
  35. data/app/views/spree/admin/images/_form.html.erb +4 -8
  36. data/app/views/spree/admin/orders/_form.html.erb +3 -3
  37. data/app/views/spree/admin/orders/_line_item.html.erb +2 -2
  38. data/app/views/spree/admin/orders/index.html.erb +5 -1
  39. data/app/views/spree/admin/payments/_list.html.erb +1 -1
  40. data/app/views/spree/admin/payments/index.html.erb +1 -1
  41. data/app/views/spree/admin/products/index.html.erb +1 -1
  42. data/app/views/spree/admin/reports/sales_total.html.erb +3 -3
  43. data/app/views/spree/admin/return_authorizations/_form.html.erb +1 -1
  44. data/app/views/spree/admin/return_authorizations/index.html.erb +1 -1
  45. data/app/views/spree/admin/shared/_order_details.html.erb +6 -6
  46. data/app/views/spree/admin/shared/_order_tabs.html.erb +2 -1
  47. data/app/views/spree/admin/shared/_update_order_state.js +1 -1
  48. data/app/views/spree/admin/shipments/edit.html.erb +1 -1
  49. data/app/views/spree/admin/shipments/index.html.erb +1 -1
  50. data/app/views/spree/admin/variants/_form.html.erb +2 -2
  51. data/app/views/spree/admin/variants/index.html.erb +1 -1
  52. data/app/views/spree/checkout/_address.html.erb +0 -6
  53. data/app/views/spree/checkout/_delivery.html.erb +1 -5
  54. data/app/views/spree/checkout/_summary.html.erb +4 -4
  55. data/app/views/spree/checkout/edit.html.erb +6 -0
  56. data/app/views/spree/order_mailer/cancel_email.text.erb +7 -7
  57. data/app/views/spree/order_mailer/confirm_email.text.erb +9 -8
  58. data/app/views/spree/orders/_adjustments.html.erb +1 -1
  59. data/app/views/spree/orders/_line_item.html.erb +2 -2
  60. data/app/views/spree/orders/edit.html.erb +2 -2
  61. data/app/views/spree/products/_cart_form.html.erb +1 -1
  62. data/app/views/spree/shared/_google_analytics.html.erb +16 -15
  63. data/app/views/spree/shared/_order_details.html.erb +24 -22
  64. data/app/views/spree/shared/_products.html.erb +1 -1
  65. data/app/views/spree/shipment_mailer/shipped_email.text.erb +6 -6
  66. data/config/locales/en.yml +21 -0
  67. data/config/routes.rb +1 -1
  68. data/lib/generators/spree/install/templates/config/initializers/spree.rb +1 -1
  69. data/lib/spree/core.rb +1 -0
  70. data/lib/spree/core/controller_helpers.rb +19 -1
  71. data/lib/spree/core/engine.rb +0 -1
  72. data/lib/spree/core/search/base.rb +5 -2
  73. data/lib/spree/core/version.rb +1 -1
  74. data/lib/spree/money.rb +16 -0
  75. data/lib/spree/product_filters.rb +4 -3
  76. metadata +64 -129
  77. data/app/assets/javascripts/admin/shipping_methods.js +0 -15
  78. data/app/assets/javascripts/admin/zone.js +0 -29
  79. data/app/views/spree/admin/payments/_transaction_list.html.erb +0 -24
  80. data/lib/spree/core/relation_serialization.rb +0 -9
@@ -31,7 +31,7 @@
31
31
  <%= f.field_container :amount do %>
32
32
  <%= f.label :amount, t(:amount) %> <span class="required">*</span><br />
33
33
  <% if @return_authorization.received? %>
34
- <%= number_to_currency @return_authorization.amount %>
34
+ <%= money @return_authorization.amount %>
35
35
  <% else %>
36
36
  <%= f.text_field :amount, {:style => 'width:80px;'} %> <%= t(:rma_value) %>: <span id="rma_value"></span>
37
37
  <%= f.error_message_on :amount %>
@@ -23,7 +23,7 @@
23
23
  <tr id="<%= spree_dom_id(return_authorization) %>" data-hook="rma_row">
24
24
  <td><%= return_authorization.number %></td>
25
25
  <td><%= t(return_authorization.state.downcase) %></td>
26
- <td><%= number_to_currency return_authorization.amount %></td>
26
+ <td><%= money return_authorization.amount %></td>
27
27
  <td><%= return_authorization.created_at.to_s(:date_time24) %></td>
28
28
  <td>
29
29
  <%= link_to_edit return_authorization %>
@@ -10,16 +10,16 @@
10
10
  <% @order.line_items.each do |item| %>
11
11
  <tr data-hook="order_details_line_item_row">
12
12
  <td width="300"><%= item.variant.product.name %> <%= "(" + variant_options(item.variant) + ")" unless item.variant.option_values.empty? %></td>
13
- <td class="price"><%= number_to_currency item.price %></td>
13
+ <td class="price"><%= money item.price %></td>
14
14
  <td class="qty"><%= item.quantity %></td>
15
- <td class="total"><span><%= number_to_currency (item.price * item.quantity) %></span></td>
15
+ <td class="total"><span><%= money(item.price * item.quantity) %></span></td>
16
16
  </tr>
17
17
  <% end %>
18
18
  </tbody>
19
19
  <tbody id="subtotal" data-hook="order_details_subtotal">
20
20
  <tr class="total" id="subtotal-row">
21
21
  <td colspan="3"><b><%= t(:subtotal) %>:</b></td>
22
- <td class="total"><span><%= number_to_currency @order.item_total %></span></td>
22
+ <td class="total"><span><%= money @order.item_total %></span></td>
23
23
  </tr>
24
24
  </tbody>
25
25
  <tbody id="order-charges" data-hook="order_details_adjustments">
@@ -27,14 +27,14 @@
27
27
  <% next if (adjustment.originator_type == 'Spree::TaxRate') and (adjustment.amount == 0) %>
28
28
  <tr class="total">
29
29
  <td colspan="3"><strong><%= adjustment.label %>:</strong></td>
30
- <td class="total"><span><%= number_to_currency adjustment.amount %></span></td>
30
+ <td class="total"><span><%= money adjustment.amount %></span></td>
31
31
  </tr>
32
32
  <% end %>
33
33
  </tbody>
34
34
  <tbody id="order-total" data-hook="order_details_total">
35
35
  <tr class="total">
36
36
  <td colspan="3"><b><%= t(:order_total) %>:</b></td>
37
- <td class="total"><span id="order_total"><%= number_to_currency @order.total %></span></td>
37
+ <td class="total"><span id="order_total"><%= money @order.total %></span></td>
38
38
  </tr>
39
39
  </tbody>
40
40
  <% if order.price_adjustment_totals.present? %>
@@ -42,7 +42,7 @@
42
42
  <% @order.price_adjustment_totals.keys.each do |key| %>
43
43
  <tr class="total">
44
44
  <td colspan="3"><strong><%= key %></strong></td>
45
- <td class="total"><span><%= number_to_currency @order.price_adjustment_totals[key] %></span></td>
45
+ <td class="total"><span><%= money @order.price_adjustment_totals[key] %></span></td>
46
46
  </tr>
47
47
  <% end %>
48
48
  </tbody>
@@ -4,10 +4,11 @@
4
4
  <div id="order_tab_summary" data-hook>
5
5
  <h3 id="order_number" data-hook><%= t(:order) %> #<%= @order.number%></h3>
6
6
  <h5 id="order_status" data-hook><%= t(:status) %>: <%= t(@order.state, :scope => :order_state) %></h5>
7
- <h5 id="order_total" data-hook><%= t(:total) %>: <%= number_to_currency @order.total %></h5>
7
+ <h5 id="order_total" data-hook><%= t(:total) %>: <%= money @order.total %></h5>
8
8
  <% if @order.completed? %>
9
9
  <h5 id="shipment_status"><%= t(:shipment) %>: <%= t(@order.shipment_state, :scope => :shipment_state, :default => [:missing, "none"]) %></h5>
10
10
  <h5 id="payment_status"><%= t(:payment) %>: <%= t(@order.payment_state, :scope => :payment_states, :default => [:missing, "none"]) %></h5>
11
+ <h5 id="date_completed" style="width:100%; float:none;" data-hook><%= t(:date_completed) %>: <%= I18n.l(@order.completed? ? @order.completed_at : @order.created_at) %></h5>
11
12
  <% end %>
12
13
  <br class="clear" />
13
14
  </div>
@@ -1,5 +1,5 @@
1
1
  $('#order_tab_summary h5#order_status').html('<%= j t(:status) %>: <%= j t(@order.state, :scope => :order_state) %>');
2
- $('#order_tab_summary h5#order_total').html('<%= j t(:total) %>: <%= j number_to_currency(@order.total) %>');
2
+ $('#order_tab_summary h5#order_total').html('<%= j t(:total) %>: <%= j @order.display_total.to_s %>');
3
3
 
4
4
  <% if @order.completed? %>
5
5
  $('#order_tab_summary h5#payment_status').html('<%= j t(:payment) %>: <%= j t(@order.payment_state, :scope => :payment_states, :default => [:missing, "none"]) %>');
@@ -14,7 +14,7 @@
14
14
  <div data-hook="admin_shipment_edit_header">
15
15
  <h2><%= t(:shipment) %> #<%= @shipment.number%> (<%= t(@shipment.state.to_sym, :scope => :state_names, :default => @shipment.state.to_s.humanize) %>)</h2>
16
16
  <% if @shipment.cost %>
17
- <h3><%= t(:charges) %> <%= number_to_currency @shipment.cost %></h3>
17
+ <h3><%= t(:charges) %> <%= money @shipment.cost %></h3>
18
18
  <% end %>
19
19
 
20
20
  <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @shipment } %>
@@ -23,7 +23,7 @@
23
23
  <tr id="<%= spree_dom_id shipment %>" data-hook="admin_shipments_index_rows">
24
24
  <td><%= shipment.number %></td>
25
25
  <td><%= shipment.shipping_method.name if shipment.shipping_method %></td>
26
- <td><%= number_to_currency shipment.cost %></td>
26
+ <td><%= money shipment.cost %></td>
27
27
  <td><%= shipment.tracking %></td>
28
28
  <td><%= t(shipment.state.to_sym, :scope => :state_names, :default => shipment.state.to_s.humanize) %></td>
29
29
  <td><%= shipment.shipped_at.to_s(:date_time24) if shipment.shipped_at %></td>
@@ -21,10 +21,10 @@
21
21
  <%= f.text_field :sku %></p>
22
22
 
23
23
  <p data-hook="price"><%= f.label :price, t(:price) %>:<br />
24
- <%= f.text_field :price, :value => number_with_precision(@variant.price, :precision => 2) %></p>
24
+ <%= f.text_field :price, :value => number_to_currency(@variant.price, :unit => '') %></p>
25
25
 
26
26
  <p data-hook="cost_price"><%= f.label :cost_price, t(:cost_price) %>:<br />
27
- <%= f.text_field :cost_price, :value => number_with_precision(@variant.cost_price, :precision => 2) %></p>
27
+ <%= f.text_field :cost_price, :value => number_to_currency(@variant.cost_price, :unit => '') %></p>
28
28
 
29
29
  <% if Spree::Config[:track_inventory_levels] %>
30
30
  <p data-hook="on_hand"><%= f.label :on_hand, t(:on_hand) %>: <br />
@@ -16,7 +16,7 @@
16
16
  <% next if variant.option_values.empty? %>
17
17
  <tr id="<%= spree_dom_id variant %>" <%= 'style="color:red;"' if variant.deleted? %> data-hook="variants_row">
18
18
  <td><span class="handle"></span> <%= variant.options_text %></td>
19
- <td><%= number_to_currency variant.price %></td>
19
+ <td><%= money variant.price %></td>
20
20
  <td><%= variant.sku %></td>
21
21
  <td><%= variant.on_hand %></td>
22
22
  <td valign="top">
@@ -1,10 +1,4 @@
1
1
  <div class="columns alpha six" data-hook="billing_fieldset_wrapper">
2
- <% unless @order.email? %>
3
- <p class="field" style='clear: both'>
4
- <%= form.label :email %><br />
5
- <%= form.text_field :email %>
6
- </p>
7
- <% end %>
8
2
  <fieldset id="billing" data-hook>
9
3
  <%= form.fields_for :bill_address do |bill_form| %>
10
4
  <legend><%= t(:billing_address) %></legend>
@@ -6,11 +6,7 @@
6
6
  <% @order.rate_hash.each do |shipping_method| %>
7
7
  <label>
8
8
  <%= radio_button(:order, :shipping_method_id, shipping_method[:id]) %>
9
- <% if Spree::Config[:shipment_inc_vat] %>
10
- <%= shipping_method[:name] %> <%= format_price (1 + Spree::TaxRate.default) * shipping_method[:cost] %>
11
- <% else %>
12
- <%= shipping_method[:name] %> <%= number_to_currency shipping_method[:cost] %>
13
- <% end %>
9
+ <%= shipping_method.name %> <%= shipping_method.display_price %>
14
10
  </label>
15
11
  <% end %>
16
12
  </p>
@@ -4,27 +4,27 @@
4
4
  <tbody>
5
5
  <tr data-hook="item_total">
6
6
  <td><strong><%= t(:item_total) %>:</strong></td>
7
- <td><strong><%= number_to_currency order.item_total %></strong></td>
7
+ <td><strong><%= money order.item_total %></strong></td>
8
8
  </tr>
9
9
  <tbody id="summary-order-charges" data-hook>
10
10
  <% order.adjustments.eligible.each do |adjustment| %>
11
11
  <% next if (adjustment.originator_type == 'Spree::TaxRate') and (adjustment.amount == 0) %>
12
12
  <tr>
13
13
  <td><%= adjustment.label %>: </td>
14
- <td><%= number_to_currency adjustment.amount %></td>
14
+ <td><%= money adjustment.amount %></td>
15
15
  </tr>
16
16
  <% end %>
17
17
  </tbody>
18
18
  <tr data-hook="order_total">
19
19
  <td><strong><%= t(:order_total) %>:</strong></td>
20
- <td><strong><span id='summary-order-total'><%= number_to_currency @order.total %></span></strong></td>
20
+ <td><strong><span id='summary-order-total'><%= money @order.total %></span></strong></td>
21
21
  </tr>
22
22
  <% if order.price_adjustment_totals.present? %>
23
23
  <tbody id="price-adjustments" data-hook="order_details_price_adjustments">
24
24
  <% @order.price_adjustment_totals.keys.each do |key| %>
25
25
  <tr class="total">
26
26
  <td><strong><%= key %></strong></td>
27
- <td><strong><span><%= number_to_currency @order.price_adjustment_totals[key] %></span></strong></td>
27
+ <td><strong><span><%= money @order.price_adjustment_totals[key] %></span></strong></td>
28
28
  </tr>
29
29
  <% end %>
30
30
  </tbody>
@@ -12,6 +12,12 @@
12
12
  <div class="row" data-hook="checkout_content">
13
13
  <div class="columns <%= if @order.state != 'confirm' then 'alpha twelve' else 'alpha omega sixteen' end %>" data-hook="checkout_form_wrapper">
14
14
  <%= form_for @order, :url => update_checkout_path(@order.state), :html => { :id => "checkout_form_#{@order.state}" } do |form| %>
15
+ <% unless @order.email? %>
16
+ <p class="field" style='clear: both'>
17
+ <%= form.label :email %><br />
18
+ <%= form.text_field :email %>
19
+ </p>
20
+ <% end %>
15
21
  <%= render @order.state, :form => form %>
16
22
  <% end %>
17
23
  </div>
@@ -1,16 +1,16 @@
1
- Dear Customer,
1
+ <%= t('order_mailer.cancel_email.dear_customer') %>
2
2
 
3
- Your order has been CANCELED. Please retain this cancellation information for your records.
3
+ <%= t('order_mailer.cancel_email.instructions') %>
4
4
 
5
5
  ============================================================
6
- Order Summary [CANCELED]
6
+ <%= t('order_mailer.cancel_email.order_summary_canceled') %>
7
7
  ============================================================
8
8
  <% @order.line_items.each do |item| %>
9
- <%= item.variant.sku %> <%= raw(item.variant.product.name) %> <%= raw(item.variant.options_text) -%> (<%=item.quantity%>) @ <%= number_to_currency item.price %> = <%= number_to_currency(item.price * item.quantity) %>
9
+ <%= item.variant.sku %> <%= raw(item.variant.product.name) %> <%= raw(item.variant.options_text) -%> (<%=item.quantity%>) @ <%= money item.price %> = <%= money(item.price * item.quantity) %>
10
10
  <% end %>
11
11
  ============================================================
12
- Subtotal: <%= number_to_currency @order.item_total %>
12
+ <%= t('order_mailer.cancel_email.subtotal') %> <%= money @order.item_total %>
13
13
  <% @order.adjustments.eligible.each do |adjustment| %>
14
- <%= raw(adjustment.label) %> <%= number_to_currency(adjustment.amount) %>
14
+ <%= raw(adjustment.label) %> <%= money(adjustment.amount) %>
15
15
  <% end %>
16
- Order Total: <%= number_to_currency(@order.total) %>
16
+ <%= t('order_mailer.cancel_email.total') %> <%= money(@order.total) %>
@@ -1,19 +1,20 @@
1
- Dear Customer,
1
+ <%= t('order_mailer.confirm_email.dear_customer') %>
2
2
 
3
- Please review and retain the following order information for your records.
3
+ <%= t('order_mailer.confirm_email.instructions') %>
4
4
 
5
5
  ============================================================
6
- Order Summary
6
+ <%= t('order_mailer.confirm_email.order_summary') %>
7
7
  ============================================================
8
8
  <% @order.line_items.each do |item| %>
9
- <%= item.variant.sku %> <%= raw(item.variant.product.name) %> <%= raw(item.variant.options_text) -%> (<%=item.quantity%>) @ <%= number_to_currency item.price %> = <%= number_to_currency(item.price * item.quantity) %>
9
+ <%= item.variant.sku %> <%= raw(item.variant.product.name) %> <%= raw(item.variant.options_text) -%> (<%=item.quantity%>) @ <%= money item.price %> = <%= money(item.price * item.quantity) %>
10
10
  <% end %>
11
11
  ============================================================
12
- Subtotal: <%= number_to_currency @order.item_total %>
12
+ <%= t('order_mailer.confirm_email.subtotal') %>: <%= money @order.item_total %>
13
+
13
14
  <% @order.adjustments.eligible.each do |adjustment| %>
14
- <%= raw(adjustment.label) %> <%= number_to_currency(adjustment.amount) %>
15
+ <%= raw(adjustment.label) %> <%= money(adjustment.amount) %>
15
16
  <% end %>
16
- Order Total: <%= number_to_currency(@order.total) %>
17
17
 
18
+ <%= t('order_mailer.confirm_email.total') %>: <%= money(@order.total) %>
18
19
 
19
- Thank you for your business.
20
+ <%= t('order_mailer.confirm_email.thanks') %>
@@ -7,7 +7,7 @@
7
7
  <% @order.adjustments.eligible.each do |adjustment| %>
8
8
  <tr>
9
9
  <td colspan="4"><%= adjustment.label %></td>
10
- <td><%= number_to_currency(adjustment.amount) %></td>
10
+ <td><%= money(adjustment.amount) %></td>
11
11
  <td></td>
12
12
  </tr>
13
13
  <% end %>
@@ -17,13 +17,13 @@
17
17
  <%= line_item_description(variant) %>
18
18
  </td>
19
19
  <td class="cart-item-price" data-hook="cart_item_price">
20
- <%= number_to_currency line_item.price %>
20
+ <%= money line_item.price %>
21
21
  </td>
22
22
  <td class="cart-item-quantity" data-hook="cart_item_quantity">
23
23
  <%= item_form.number_field :quantity, :min => 0, :class => "line_item_quantity", :size => 5 %>
24
24
  </td>
25
25
  <td class="cart-item-total" data-hook="cart_item_total">
26
- <%= number_to_currency(line_item.price * line_item.quantity) unless line_item.quantity.nil? %>
26
+ <%= money(line_item.price * line_item.quantity) unless line_item.quantity.nil? %>
27
27
  </td>
28
28
  <td class="cart-item-delete" data-hook="cart_item_delete">
29
29
  <%= link_to image_tag('icons/delete.png'), '#', :class => 'delete', :id => "delete_#{dom_id(line_item)}" %>
@@ -19,14 +19,14 @@
19
19
  </div>
20
20
 
21
21
  <div id="subtotal" data-hook class="columns sixteen alpha omega">
22
- <h5><%= t(:subtotal) %>: <span class="order-total"><%= order_subtotal(@order) %></span></h5>
22
+ <h5><%= t(:subtotal) %>: <span class="order-total"><%= @order.display_total %></span></h5>
23
23
  </div>
24
24
 
25
25
  <div class="links columns sixteen alpha omega" data-hook="cart_buttons">
26
26
  <%= button_tag :class => 'primary', :id => 'update-button' do %>
27
27
  <%= t(:update) %>
28
28
  <% end %>
29
- <%= link_to t(:checkout), checkout_path, :class => 'button checkout primary', :id => 'checkout-link' %>
29
+ <%= link_to t(:checkout), checkout_state_path(@order.checkout_steps.first), :class => 'button checkout primary', :id => 'checkout-link' %>
30
30
  </div>
31
31
 
32
32
  </div>
@@ -31,7 +31,7 @@
31
31
 
32
32
  <div id="product-price">
33
33
  <h6 class="product-section-title"><%= t(:price) %></h6>
34
- <div><span class="price selling" itemprop="price"><%= number_to_currency @product.price %></span></div>
34
+ <div><span class="price selling" itemprop="price"><%= money @product.price %></span></div>
35
35
  </div>
36
36
 
37
37
  <div class="add-to-cart">
@@ -6,27 +6,28 @@
6
6
  _gaq.push(['_trackPageview']);
7
7
 
8
8
  <% if flash[:commerce_tracking] %>
9
- // report e-commerce transaction information when applicable
9
+ <%# more info: https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiEcommerce %>
10
10
  _gaq.push(['_addTrans',
11
- "<%= @order.number %>", // Order Number
12
- "", // Affiliation
13
- "<%= @order.total %>", // Order total
14
- "<%= @order.adjustments.tax.sum(:amount) %>", // Tax Amount
15
- "<%= @order.adjustments.shipping.sum(:amount) %>", // Ship Amount
16
- "", // City
17
- "", // State
18
- "" // Country
11
+ "<%= @order.number %>",
12
+ "",
13
+ "<%= @order.total %>",
14
+ "<%= @order.adjustments.tax.sum(:amount) %>",
15
+ "<%= @order.adjustments.shipping.sum(:amount) %>",
16
+ "<%= @order.bill_address.city %>",
17
+ "<%= @order.bill_address.state_text %>",
18
+ "<%= @order.bill_address.country.name %>"
19
19
  ]);
20
20
  <% @order.line_items.each do |line_item| %>
21
21
  _gaq.push(['_addItem',
22
- "<%= @order.number %>", // order ID - required
23
- "<%= line_item.variant.sku %>", // SKU/code - required
24
- "<%= line_item.variant.product.name %>", // product name
25
- "", // category or variation, Product Category
26
- "<%= line_item.price %>", // unit price - required
27
- "<%= line_item.quantity %>" // quantity - required
22
+ "<%= @order.number %>",
23
+ "<%= line_item.variant.sku %>",
24
+ "<%= line_item.variant.product.name %>",
25
+ "",
26
+ "<%= line_item.price %>",
27
+ "<%= line_item.quantity %>"
28
28
  ]);
29
29
  <% end %>
30
+ _gaq.push(['_trackTrans']);
30
31
  <% end %>
31
32
 
32
33
  (function() {
@@ -1,26 +1,28 @@
1
1
  <div class="row steps-data">
2
2
 
3
- <div class="columns alpha four">
4
- <h6><%= t(:shipping_address) %> <%= link_to "(#{t(:edit)})", checkout_state_path(:address) unless @order.completed? %></h6>
5
- <div class="address">
6
- <%= order.ship_address %>
3
+ <% if order.has_step?("address") %>
4
+ <div class="columns alpha four">
5
+ <h6><%= t(:shipping_address) %> <%= link_to "(#{t(:edit)})", checkout_state_path(:address) unless @order.completed? %></h6>
6
+ <div class="address">
7
+ <%= order.ship_address %>
8
+ </div>
7
9
  </div>
8
- </div>
9
10
 
10
- <div class="columns alpha four">
11
- <h6><%= t(:billing_address) %> <%= link_to "(#{t(:edit)})", checkout_state_path(:address) unless @order.completed? %></h6>
12
- <div class="address">
13
- <%= order.bill_address %>
14
- </div>
15
- </div>
16
-
17
- <% if @order.has_step?("delivery") %>
18
11
  <div class="columns alpha four">
19
- <h6><%= t(:shipping_method) %> <%= link_to "(#{t(:edit)})", checkout_state_path(:delivery) unless @order.completed? %></h6>
20
- <div class="delivery">
21
- <%= order.shipping_method.name %>
12
+ <h6><%= t(:billing_address) %> <%= link_to "(#{t(:edit)})", checkout_state_path(:address) unless @order.completed? %></h6>
13
+ <div class="address">
14
+ <%= order.bill_address %>
22
15
  </div>
23
16
  </div>
17
+
18
+ <% if @order.has_step?("delivery") %>
19
+ <div class="columns alpha four">
20
+ <h6><%= t(:shipping_method) %> <%= link_to "(#{t(:edit)})", checkout_state_path(:delivery) unless @order.completed? %></h6>
21
+ <div class="delivery">
22
+ <%= order.shipping_method.name %>
23
+ </div>
24
+ </div>
25
+ <% end %>
24
26
  <% end %>
25
27
 
26
28
  <div class="columns omega four">
@@ -75,16 +77,16 @@
75
77
  <%= truncate(item.variant.product.description, :length => 100, :omission => "...") %>
76
78
  <%= "(" + variant_options(item.variant) + ")" unless item.variant .option_values.empty? %>
77
79
  </td>
78
- <td data-hook="order_item_price" class="price"><span><%= number_to_currency item.price %></span></td>
80
+ <td data-hook="order_item_price" class="price"><span><%= money item.price %></span></td>
79
81
  <td data-hook="order_item_qty"><%= item.quantity %></td>
80
- <td data-hook="order_item_total" class="total"><span><%= number_to_currency (item.price * item.quantity) %></span></td>
82
+ <td data-hook="order_item_total" class="total"><span><%= money(item.price * item.quantity) %></span></td>
81
83
  </tr>
82
84
  <% end %>
83
85
  </tbody>
84
86
  <tfoot id="order-total" data-hook="order_details_total">
85
87
  <tr class="total">
86
88
  <td colspan="4"><b><%= t(:order_total) %>:</b></td>
87
- <td class="total"><span id="order_total"><%= number_to_currency @order.total %></span></td>
89
+ <td class="total"><span id="order_total"><%= money @order.total %></span></td>
88
90
  </tr>
89
91
  </tfoot>
90
92
  <% if order.price_adjustment_totals.present? %>
@@ -92,7 +94,7 @@
92
94
  <% @order.price_adjustment_totals.keys.each do |key| %>
93
95
  <tr class="total">
94
96
  <td colspan="4"><strong><%= key %></strong></td>
95
- <td class="total"><span><%= number_to_currency @order.price_adjustment_totals[key] %></span></td>
97
+ <td class="total"><span><%= money @order.price_adjustment_totals[key] %></span></td>
96
98
  </tr>
97
99
  <% end %>
98
100
  </tfoot>
@@ -100,7 +102,7 @@
100
102
  <tfoot id="subtotal" data-hook="order_details_subtotal">
101
103
  <tr class="total" id="subtotal-row">
102
104
  <td colspan="4"><b><%= t(:subtotal) %>:</b></td>
103
- <td class="total"><span><%= number_to_currency @order.item_total %></span></td>
105
+ <td class="total"><span><%= money @order.item_total %></span></td>
104
106
  </tr>
105
107
  </tfoot>
106
108
  <tfoot id="order-charges" data-hook="order_details_adjustments">
@@ -108,7 +110,7 @@
108
110
  <% next if (adjustment.originator_type == 'Spree::TaxRate') and (adjustment.amount == 0) %>
109
111
  <tr class="total">
110
112
  <td colspan="4"><strong><%= adjustment.label %></strong></td>
111
- <td class="total"><span><%= number_to_currency adjustment.amount %></span></td>
113
+ <td class="total"><span><%= money adjustment.amount %></span></td>
112
114
  </tr>
113
115
  <% end %>
114
116
  </tfoot>