Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Option cart form changes. Adding Google Analytics. Commenting out Thu…
…mbnails. Style changes.
- Loading branch information
Steph Powell
committed
Jun 22, 2010
1 parent
87836bc
commit b8c722f
Showing
5 changed files
with
370 additions
and
21 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
vendor/extensions/site/app/views/products/_option_cart_form.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<% if @sc_matrix -%> | ||
<p>Choose your color, size, and quantity:</p> | ||
<table id="option-matrix"> | ||
<tr> | ||
<th></th> | ||
<% @sc_matrix['sizes'].each do |s| %> | ||
<th class="size"><%= s.presentation %></th> | ||
<td class="spacer"></td> | ||
<% end -%> | ||
</tr> | ||
<% @sc_matrix['colors'].each do |c| -%> | ||
<tr> | ||
<th class="color"><%= c.presentation %></th> | ||
<% @sc_matrix['sizes'].each do |s| -%> | ||
<td> | ||
<% if @sc_matrix['variant_ids'][s.id.to_s + '_' + c.id.to_s] -%> | ||
<input type="radio" value="<%= @sc_matrix['variant_ids'][s.id.to_s + '_' + c.id.to_s] %>" name="products[<%= @product.id %>]" /> | ||
<% else -%> | ||
<img src="/images/radio-notavailable.png" alt="X" width="20" height="20" /> | ||
<% end -%> | ||
</td> | ||
<td class="spacer"></td> | ||
<% end -%> | ||
</tr> | ||
<% end -%> | ||
</table> | ||
<% else -%> | ||
<% if @product.has_variants? %> | ||
<div id="product-variants"> | ||
<h2><%= t('variants') %></h2> | ||
<ul> | ||
<% has_checked = false | ||
@product.variants.active.each_with_index do |v,index| | ||
next if v.option_values.empty? || (!v.in_stock && !Spree::Config[:show_zero_stock_products]) | ||
checked = !has_checked && (v.in_stock || Spree::Config[:allow_backorders]) | ||
has_checked = true if checked %> | ||
<li> | ||
<label> | ||
<%= radio_button_tag "products[#{@product.id}]", v.id, checked, :disabled => !v.in_stock && !Spree::Config[:allow_backorders] %> | ||
<span class="variant-description"> | ||
<%= variant_options v %> | ||
</span> | ||
<% if variant_price_diff v %> | ||
<span class="price diff"><%= variant_price_diff v %></span> | ||
<% end %> | ||
</label> | ||
</li> | ||
<% end%> | ||
</ul> | ||
</div> | ||
<% end%> | ||
<% end -%> | ||
<% if @product.has_stock? || Spree::Config[:allow_backorders] %> | ||
<%= text_field_tag (@product.has_variants? ? :quantity : "variants[#{@product.master.id}]"), | ||
1, :class => "title", :size => 3 %> | ||
| ||
<button type='submit' class='large primary'> | ||
<%= image_tag('/images/add-to-cart.png') + t('add_to_cart') %> | ||
</button> | ||
<% else %> | ||
<%= content_tag('strong', t('out_of_stock')) %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
if Preference.table_exists? | ||
Spree::Config.set(:stylesheets => 'screen,spreedemo') | ||
Spree::Config.set(:stylesheets => 'spreedemo') | ||
Spree::Config.set(:allow_ssl_in_production => false) | ||
Spree::Config.set(:logo => '/images/logo.png') | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
tracker_1: | ||
environment: development | ||
analytics_id: test | ||
tracker_2: | ||
environment: production | ||
analytics_id: UA-525312-13 |
Oops, something went wrong.