spree_ajax_cart 1.0.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -9,7 +9,7 @@ Basic Installation
9
9
 
10
10
  1. Add the following to your Gemfile
11
11
  <pre>
12
- gem 'spree_ajax_cart', '~> 1.0.1'
12
+ gem 'spree_ajax_cart', '~> 1.2.0'
13
13
  </pre>
14
14
  2. Run `bundle install`
15
15
  3. To copy and apply migrations run:
@@ -3,7 +3,7 @@ Spree::OrdersController.class_eval do
3
3
  respond_override :populate => { :js => { :success => lambda { render "populate" ,:object => @order } } }
4
4
 
5
5
  def ajax_cart
6
- render :partial => 'orders/ajax_cart'
6
+ render :partial => 'spree/orders/ajax_cart'
7
7
  end
8
8
 
9
9
  end
@@ -1,4 +1,4 @@
1
- Spree::OrdersHelper.module_eval do
1
+ Spree::BaseHelper.module_eval do
2
2
 
3
3
  def cart_item_count
4
4
  return "" if current_page?(cart_path)
@@ -1,7 +1,7 @@
1
1
  <div id="cart">
2
2
  <h3 id="cart-title" style="width: 660px;"><%= t(:shopping_cart) %></h3>
3
3
 
4
- <% if current_order.empty? && current_order.line_items.empty? %>
4
+ <% if !current_order && current_order.empty? && current_order.line_items.empty? %>
5
5
  <div data-hook="empty_cart">
6
6
  <p><%= t(:your_cart_is_empty) %></p>
7
7
  <p><%= link_to t(:continue_shopping), products_path, :class => 'button continue' %></p>
@@ -12,8 +12,8 @@
12
12
 
13
13
  <div data-hook="inside_cart_form">
14
14
  <div data-hook="cart_items">
15
- <% current_order.line_items.each do |order_form| %>
16
- <% variant = order_form.variant %>
15
+ <% current_order.line_items.each do |line_item| %>
16
+ <% variant = line_item.variant %>
17
17
  <table id="cart-detail" data-hook>
18
18
  <thead>
19
19
  <tr data-hook="cart_items_headers">
@@ -41,13 +41,13 @@
41
41
  <%= truncate(strip_tags(variant.product.description), :length => 30, :omission => "...") %>
42
42
  </td>
43
43
  <td data-hook="cart_item_price">
44
- <%= product_price(order_form.variant) %>
44
+ <%= money(line_item.price) %>
45
45
  </td>
46
46
  <td data-hook="cart_item_quantity">
47
- <%= order_form.quantity %>
47
+ <%= line_item.quantity %>
48
48
  </td>
49
49
  <td data-hook="cart_item_total">
50
- <%= format_price(product_price(order_form.variant, :format_as_currency => false) * order_form.quantity) unless order_form.quantity.nil?%>
50
+ <%= money(line_item.price * line_item.quantity) unless line_item.quantity.nil?%>
51
51
  </td>
52
52
  </tr>
53
53
  </tbody>
@@ -56,7 +56,7 @@
56
56
  </div>
57
57
 
58
58
  <div id="subtotal" data-hook>
59
- <h3><%= "#{t(:subtotal)}: #{order_price(current_order)}" %></h3>
59
+ <h3><%= "#{t(:subtotal)}: #{money(current_order.item_total)}" if current_order %></h3>
60
60
  <div class="links" data-hook="cart_buttons">
61
61
  <%= link_to "Procedi al carrello" , cart_path, :class => 'button checkout primary', :id => 'checkout-link' %>
62
62
  </div>
@@ -1,3 +1,3 @@
1
- Rails.application.routes.draw do
1
+ Spree::Core::Engine.routes.draw do
2
2
  match '/ajax_cart', :to => 'orders#ajax_cart', :via => :get, :as => :ajax_cart
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_ajax_cart
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -64,7 +64,7 @@ files:
64
64
  - app/assets/stylesheets/store/qtip-ajax_cart.css
65
65
  - app/assets/stylesheets/store/spree_ajax_cart.css
66
66
  - app/controllers/spree/orders_controller_decorator.rb
67
- - app/helpers/spree/orders_helper_decorator.rb
67
+ - app/helpers/spree/base_helper_decorator.rb
68
68
  - app/views/spree/orders/_ajax_cart.html.erb
69
69
  - app/views/spree/orders/populate.js.erb
70
70
  - config/locales/en.yml