嗨,当我单击“添加到购物车”按钮时,我创建了有关特定产品的动态页面我想发送文本框值> 我创建了类似的页面
$(document).on('pageshow','#productdetails', function() {
var pid = getURLParameter('pid');
$.getJSON("http://vinoth.com/magento/api/rest/products/"+pid, function(data) {
if (data.is_in_stock == "1") {
var stock = "In Stock"
}
else {
var stock = "Out of Stock"
}
//var imageurl = 'http://vinoth.com/magento/api/rest/products/'+data.entity_id+'/images';
// $.getJSON(imageurl,function(result){
// $.each(result, function(j, k) {
$("div[data-role='content']").append('<h4>'+data.name+'</h4><img src=' + data.image_url + ' width="100%"><br><p><strong>Description: </strong>' + data.description + '</p><span><strong>Actual Price: </strong>' + data.regular_price_with_tax + ' INR</span><br><span><strong>Special Price: </strong>' + data.final_price_with_tax + ' INR</span><br/> <span><strong>Availablity: </strong>' + stock + '</span><br><div data-role="fieldcontain"><label name="quantity"><strong>Qty: </strong></label><input type="text" name="quantity" value="" data-mini="true" data-inline="true" size="30" id="qty"/></div>').trigger('create');
var qty = $("#qty").val();
$("div[data-role='content']").append('<a data-role="button" data-mini="true" data-inline="true" data-icon="plus" href="checkoutcart.html?pid=' + data.entity_id + '&quantity=' + $("#qty").val() + '" >Add to Cart</a>').trigger('create');
//});
// });
});
});
如何获取qty
输入值以传递 addtocart 按钮链接?