Skip to content

Instantly share code, notes, and snippets.

@GeekOnCoffee
Created June 5, 2012 01:28
Show Gist options
  • Save GeekOnCoffee/2871874 to your computer and use it in GitHub Desktop.
Save GeekOnCoffee/2871874 to your computer and use it in GitHub Desktop.
Deface::Override.new(:virtual_path => "spree/products/_cart_form",
:name => "example-1",
:replace => ".add-to-cart",
:text => %{ <% if @product.has_stock? || Spree::Config[:allow_backorders] %>
<%= number_field_tag (@product.has_variants? ? :quantity : "variants[#\{@product.master.id\}]"),
1, :class => 'title', :in => [email protected]_hand %>
<input type="image" src="rainbow.gif" name="image" width="60" height="60">
<% else %>
<%= content_tag('strong', t(:out_of_stock)) %>
<% end %>})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment