assets/js/catalog.js
// (the things in the Product.allProducts array) into the drop down list.
(the things in the Product.allProducts array) into the drop down list.
( the things in the Product . allProducts array ) into the drop down list .
function populateForm() {
  var reviewList = document.getElementById('userReviewSlides');
  for (var x in Slider.allSliders) {
  }
  for (var i in Product.allProducts) {
    if(i < 20) {
      var div = document.createElement('div');
      div.setAttribute('class', 'card');
      div.setAttribute('id', 'newProduct' + Product.allProducts[i].id);
      div.innerHTML = '<div class="col-md-3 Marquee-tag">'+
      '<div class="productwrap">'+
        '<div class="pr-img">'+
          '<a onclick = "saveIDToLocalStorage('+Product.allProducts[i].id+')" href="productdetails.html"><img src="'+Product.allProducts[i].filePath+'" alt="" class="img-responsive"/></a>'+
          '<div class="pricetag on-sale"><div class="inner on-sale"><span class="onsale"><span class="oldprice">$314</span>$'+ Product.allProducts[i].price +'</span></div></div>'+
        '</div>'+
        '<span class="smalltitle"><a href="productdetails.html">'+Product.allProducts[i].name+'</a></span>'+
        '<span class="smalldesc">Item no.: 1000</span>'+
      '</div>'+
    '</div>';
    featurerProductSection.appendChild(div);
      }
  }
  for (var i in Product.allProducts) {
    if(i < 6) {
      var div = document.createElement('div');
      div.setAttribute('id', 'featureProduct' + Product.allProducts[i].id);
        div.innerHTML = '<div class="col-md-4">'+
        '<div class="productwrap">'+
          '<div class="pr-img">'+
            '<a onclick = "saveIDToLocalStorage('+Product.allProducts[i].id+')" href="productdetails.html"><img src="'+Product.allProducts[i].filePath+'" alt="" class="img-responsive"/></a>'+
            '<div class="pricetag on-sale"><div class="inner on-sale"><span class="onsale"><span class="oldprice">$314</span>$'+Product.allProducts[i].price+'</span></div></div>'+
         ' </div>'+
          '<span class="smalltitle"><a onclick="saveIDToLocalStorage('+Product.allProducts[i].id+')" href="product.html">'+Product.allProducts[i].name+'</a></span>'+
          '<span class="smalldesc">Item no.: 1000</span>'+
        '</div>'+
      '</div>';
      productSection.appendChild(div);
      }
  }
}
function populateForm ( ) { var reviewList = document . getElementById ( 'userReviewSlides' ) ; for ( var x in Slider . allSliders ) { } for ( var i in Product . allProducts ) { if ( i < 20 ) { var div = document . createElement ( 'div' ) ; div . setAttribute ( 'class' , 'card' ) ; div . setAttribute ( 'id' , 'newProduct' + Product . allProducts [ i ] . id ) ; div . innerHTML = '<div class="col-md-3 Marquee-tag">' + '<div class="productwrap">' + '<div class="pr-img">' + '<a onclick = "saveIDToLocalStorage(' + Product . allProducts [ i ] . id + ')" href="productdetails.html"><img src="' + Product . allProducts [ i ] . filePath + '" alt="" class="img-responsive"/></a>' + '<div class="pricetag on-sale"><div class="inner on-sale"><span class="onsale"><span class="oldprice">$314</span>$' + Product . allProducts [ i ] . price + '</span></div></div>' + '</div>' + '<span class="smalltitle"><a href="productdetails.html">' + Product . allProducts [ i ] . name + '</a></span>' + '<span class="smalldesc">Item no.: 1000</span>' + '</div>' + '</div>' ; featurerProductSection . appendChild ( div ) ; } } for ( var i in Product . allProducts ) { if ( i < 6 ) { var div = document . createElement ( 'div' ) ; div . setAttribute ( 'id' , 'featureProduct' + Product . allProducts [ i ] . id ) ; div . innerHTML = '<div class="col-md-4">' + '<div class="productwrap">' + '<div class="pr-img">' + '<a onclick = "saveIDToLocalStorage(' + Product . allProducts [ i ] . id + ')" href="productdetails.html"><img src="' + Product . allProducts [ i ] . filePath + '" alt="" class="img-responsive"/></a>' + '<div class="pricetag on-sale"><div class="inner on-sale"><span class="onsale"><span class="oldprice">$314</span>$' + Product . allProducts [ i ] . price + '</span></div></div>' + ' </div>' + '<span class="smalltitle"><a onclick="saveIDToLocalStorage(' + Product . allProducts [ i ] . id + ')" href="product.html">' + Product . allProducts [ i ] . name + '</a></span>' + '<span class="smalldesc">Item no.: 1000</span>' + '</div>' + '</div>' ; productSection . appendChild ( div ) ; } } }
(the things in the Product.allProducts array) into the drop down list.
( the things in the Product . allProducts array ) into the drop down list .
//TODO: Add an <option> tag inside the form's select for each product // var selectElement = document.getElementById('items'); // console.log(Product.allProducts[i]); // var optionElement = document.createElement('option'); // optionElement.textContent = Product.allProducts[i].name; // optionElement.setAttribute('value', Product.allProducts[i].name); // selectElement.appendChild(optionElement); //console.log(Product.allProducts[i]); // var optionElement = document.createElement('option'); // optionElement.textContent = Product.allProducts[i].name; // optionElement.setAttribute('value', Product.allProducts[i].name); // selectElement.appendChild(optionElement); // div.setAttribute('class', 'card'); // div.innerHTML = '<a href="productDetail.html"><img src="'+Product.allProducts[i].filePath+'" alt="Denim Jeans" style="width:100%">' + //   '<h2>'+Product.allProducts[i].name+'</h2>' + //   '<p class="price">'+ Product.allProducts[i].price +'</p></a>' + //   '<button onClick="handleSubmit(this);">Add to Cart</button>'; // for (var i in UserReview.allReviews) { //   var li = document.createElement('li'); //   li.innerHTML = '<li class="slide">' + //         '<p>' + //           '<q>'+ UserReview.allReviews[i].reviewText  +'</q>' + //           '<span class="author">' + //             '<img src="'+ UserReview.allReviews[i].imgPath  +'">' + //             UserReview.allReviews[i].name + '' + //           '</img></span>' + //         '</p>' + //       '</li>'; //       reviewList.appendChild(li); // }