spree_zoned 0.5.28 → 0.5.29

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,7 @@ module Spree
7
7
  c = c ? c.to_i : 0
8
8
  return p.price if c == 0
9
9
  zpl = Spree::Zoned::Product.where "spree_product_id = ? AND spree_country_id = ?", p.id, c
10
- zpl == [] ? p.price : zpl[0].cprice
10
+ zpl == [] ? p.price : (zpl[0].cprice.nil? ? p.price : zpl[0].cprice)
11
11
  end
12
12
 
13
13
  end
@@ -6,7 +6,7 @@ module Spree
6
6
  c = c ? c.to_i : 0
7
7
  return p.price if c == 0
8
8
  zpl = Spree::Zoned::Product.where "spree_product_id = ? AND spree_country_id = ?", p.id, c
9
- zpl == [] ? p.price : zpl[0].cprice
9
+ zpl == [] ? p.price : (zpl[0].cprice.nil? ? p.price : zpl[0].cprice)
10
10
  end
11
11
 
12
12
  end
@@ -0,0 +1,6 @@
1
+ Deface::Override.new(
2
+ :name => "replace_product_price",
3
+ :virtual_path => "spree/products/_cart_form",
4
+ :replace_contents => "[data-hook='product_price']",
5
+ :partial => "spree/zoned/product_price",
6
+ )
@@ -0,0 +1,18 @@
1
+ <div id="product-price">
2
+ <h6 class="product-section-title"><%= t(:price) %></h6>
3
+ <div><span class="price selling" itemprop="price"><%= number_to_currency getCountryPrice @product %></span></div>
4
+ </div>
5
+
6
+ <div class="add-to-cart">
7
+ <% if @product.has_stock? || Spree::Config[:allow_backorders] %>
8
+ <%= number_field_tag (@product.has_variants? ? :quantity : "variants[#{@product.master.id}]"),
9
+ 1, :class => 'title', :in => 1..@product.on_hand %>
10
+ <%= button_tag :class => 'large primary', :id => 'add-to-cart-button', :type => :submit do %>
11
+ <%= t(:add_to_cart) %>
12
+ <% end %>
13
+ <% else %>
14
+ <%= content_tag('strong', t(:out_of_stock)) %>
15
+ <% end %>
16
+ </div>
17
+
18
+ </div>
data/spree_zoned.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |s|
3
3
  s.platform = Gem::Platform::RUBY
4
4
  s.name = 'spree_zoned'
5
- s.version = '0.5.28'
5
+ s.version = '0.5.29'
6
6
  s.summary = 'A Spree extension to make your store zoned'
7
7
  s.description = "Everything you need for a zoned Spree store: zoned pricing, zoned products, zoned product ordering, zoned locales, ...\nProbalbly essential to you if you operate outside of the US."
8
8
  s.required_ruby_version = '>= 1.9.2'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_zoned
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.28
4
+ version: 0.5.29
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-30 00:00:00.000000000 Z
12
+ date: 2012-09-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: spree_core
@@ -145,6 +145,7 @@ files:
145
145
  - app/overrides/add_prd_country.rb
146
146
  - app/overrides/replace_admin_product_right.rb
147
147
  - app/overrides/replace_index_rows.rb
148
+ - app/overrides/replace_product_price.rb
148
149
  - app/overrides/zone_shared_product.rb
149
150
  - app/views/spree/admin/zoned/_index_rows.html.erb
150
151
  - app/views/spree/admin/zoned/_prd_country.html.erb
@@ -152,6 +153,7 @@ files:
152
153
  - app/views/spree/admin/zoned/setcountry.js.erb
153
154
  - app/views/spree/shared/_products_list_item.html.erb
154
155
  - app/views/spree/zoned/_countryselect.html.erb
156
+ - app/views/spree/zoned/_product_price.html.erb
155
157
  - app/views/spree/zoned/setcountry.js.erb
156
158
  - app/views/spree/zoned/setlanguage.js.erb
157
159
  - config/initializers/zoned_init.rb