Sha256: 86ca7812ae7eb2f6542bafcac43ab3ec689416018c4ba3d88d141e70dcb98f50

Contents?: true

Size: 1.17 KB

Versions: 8

Compression:

Stored size: 1.17 KB

Contents

<script type="text/javascript">
window.adcurve_configuration = {};
<% case controller.controller_name %>
  <% when "home" %>
    window.adcurve_configuration.adcurve_page = "home";
  <% when "orders" %>
    <% if controller.action_name == "edit" %>
    window.adcurve_configuration.adcurve_page = "cart";
    window.adcurve_configuration.adcurve_cart_items = <%= raw @order.line_items.map{|li| {
      :adcurve_product_id => li.product.sku, :adcurve_quantity => li.quantity, :adcurve_amount_1 => li.display_amount.to_s, :adcurve_amount_2 => li.display_amount.to_s } }.to_json %>
    <% end %>
  <% when "products" %>
    <% if controller.action_name != "index" %>
      window.adcurve_configuration.adcurve_page = "product";
      window.adcurve_configuration.adcurve_product_id = <%= raw @product.sku.to_json %>
    <% end %>
  <% when "taxons" %>
      window.adcurve_configuration.adcurve_page = "category";
      window.adcurve_configuration.adcurve_category_path = "<%= raw params[:id].split("\/")[1..-1].join(" > ") %>";
      window.adcurve_configuration.adcurve_products = <%=raw @products.map{|product| { :adcurve_product_id => product.sku  } }.to_json %>;
<% end %>
//hello
</script>

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
adcurve_spree-0.0.12 app/views/spree/adcurve_tag/_configuration.html.erb
adcurve_spree-0.0.11 app/views/spree/adcurve_tag/_configuration.html.erb
adcurve_spree-0.0.10 app/views/spree/adcurve_tag/_configuration.html.erb
adcurve_spree-0.0.9 app/views/spree/adcurve_tag/_configuration.html.erb
adcurve_spree-0.0.8 app/views/spree/adcurve_tag/_configuration.html.erb
adcurve_spree-0.0.7 app/views/spree/adcurve_tag/_configuration.html.erb
adcurve_spree-0.0.6 app/views/spree/adcurve_tag/_configuration.html.erb
adcurve_spree-0.0.5 app/views/spree/adcurve_tag/_configuration.html.erb