Sha256: ba57bf58282bbd3c25af6efb16782c8b70423bba783403d774351a07f5365ed7

Contents?: true

Size: 650 Bytes

Versions: 24

Compression:

Stored size: 650 Bytes

Contents

<% order.line_items.each do |line_item| %>
ga('ec:addProduct', {               // Provide product details in a productFieldObject.
  'id': '<%= j (line_item.sku || line_item.variant_id) %>',  // Product ID (string).
  'name': '<%= j line_item.name %>', // Product name (string).
  'category': '<%= j line_item.category.try(:name) %>',            // Product category (string).
  'brand': '<%= j line_item.brand.try(:name) %>',                // Product brand (string).
  'variant': '<%= j line_item.options_text %>',               // Product variant (string).
  'price': '<%= line_item.price %>',
  'quantity': <%= line_item.quantity %>
});
<% end %>

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
spree_frontend-3.2.0 app/views/spree/shared/_google_add_items.js.erb
spree_frontend-3.2.0.rc3 app/views/spree/shared/_google_add_items.js.erb
spree_frontend-3.2.0.rc2 app/views/spree/shared/_google_add_items.js.erb
spree_frontend-3.2.0.rc1 app/views/spree/shared/_google_add_items.js.erb