Sha256: e9fa165213d029d95b42f1a8d455e7f00beb4ba33e88c3afaace41711c7a2cf1

Contents?: true

Size: 634 Bytes

Versions: 9

Compression:

Stored size: 634 Bytes

Contents

Deface::Override.new(
  :virtual_path => 'spree/products/show',
  :name => 'add_link_to_mark_product_as_favorite',
  :insert_after => "div[itemprop='description']",
  :text => %Q{
    <% if spree_user_signed_in? && spree_current_user.has_favorite_product?(@product.id) %>
      <%= link_to Spree.t(:unmark_as_favorite), favorite_product_path(:id => @product.id), :method => :delete, :remote => true, :class => 'favorite_link' %>
    <% else %>
      <%= link_to Spree.t(:mark_as_favorite), favorite_products_path(:id => @product.id), :method => :post, :remote => spree_user_signed_in?, :class => 'favorite_link' %>
    <% end %>
  }
)

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spree_favorite_products-2.3.0 app/overrides/add_link_to_mark_product_as_favorite.rb
spree_favorite_products-3.0.0 app/overrides/add_link_to_mark_product_as_favorite.rb
spree_favorite_products-2.0.3 app/overrides/add_link_to_mark_product_as_favorite.rb
spree_favorite_products-2.2.3 app/overrides/add_link_to_mark_product_as_favorite.rb
spree_favorite_products-2.2.2 app/overrides/add_link_to_mark_product_as_favorite.rb
spree_favorite_products-2.0.2 app/overrides/add_link_to_mark_product_as_favorite.rb
spree_favorite_products-2.2.0 app/overrides/add_link_to_mark_product_as_favorite.rb
spree_favorite_products-2.0.1 app/overrides/add_link_to_mark_product_as_favorite.rb
spree_favorite_products-1.0.1 app/overrides/add_link_to_mark_product_as_favorite.rb