<commit_before>SpreeStore.module('Products.Show',function(Show, SpreeStore, Backbone,Marionette,$,_){
  Show.Product = Backbone.Marionette.ItemView.extend({
    tagName: 'div',
    className: 'product',
    template: "#product-template",

    events: {
      "click button": "addToCart"
    },

    addToCart: function (e) {
      var quantity = $(this.el).find("input").val()
      this.trigger("product:addToCart", this.model.id, quantity)
    },

    templateHelpers: {
      displayImage: function(type) {
        if (this.variants[0].images[0]) {
          return this.variants[0].images[0][type + '_url'];
        } else {
          return "/assets/noimage/" + type + ".png";
        }
      },
      <commit_msg>Use correct ID when adding to cart<commit_after>SpreeStore.module('Products.Show',function(Show, SpreeStore, Backbone,Marionette,$,_){
  Show.Product = Backbone.Marionette.ItemView.extend({
    tagName: 'div',
    className: 'product',
    template: "#product-template",

    events: {
      "click button": "addToCart"
    },

    addToCart: function (e) {
      var quantity = $(this.el).find("input").val()
      var variant_id = this.model.variants.first().id
      this.trigger("product:addToCart", variant_id, quantity)
    },

    templateHelpers: {
      displayImage: function(type) {
        if (this.variants[0].images[0]) {
          return this.variants[0].images[0][type + '_url'];
        } else {
          return "/assets/noimage/" + type + ".png";
        }
      },
      
{'fraction_non_alphanumeric': 0.16225165562913907, 'fraction_numerical': 0.005298013245033113, 'mean_word_length': 2.7680798004987532, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5010198', 'n_tokens_mistral': 482, 'n_tokens_neox': 475, 'n_words': 83}