Skip to content

Commit

Permalink
Option cart form changes. Adding Google Analytics. Commenting out Thu…
Browse files Browse the repository at this point in the history
…mbnails. Style changes.
  • Loading branch information
Steph Powell committed Jun 22, 2010
1 parent 87836bc commit b8c722f
Show file tree
Hide file tree
Showing 5 changed files with 370 additions and 21 deletions.
@@ -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 %>
&nbsp;
<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 %>
2 changes: 1 addition & 1 deletion vendor/extensions/site/app/views/products/show.html.erb
Expand Up @@ -4,7 +4,7 @@
<%= render 'image' -%>
</div>
<div id="thumbnails">
<%= render 'thumbnails', :product => @product -%>
<%#= render 'thumbnails', :product => @product -%>
</div>
<% hook :product_properties do %>
<%= render 'properties' %>
Expand Down
2 changes: 1 addition & 1 deletion vendor/extensions/site/config/initializers/site.rb
@@ -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
3 changes: 3 additions & 0 deletions vendor/extensions/site/db/sample/trackers.yml
@@ -1,3 +1,6 @@
tracker_1:
environment: development
analytics_id: test
tracker_2:
environment: production
analytics_id: UA-525312-13

0 comments on commit b8c722f

Please sign in to comment.