1
I would like the following structure for my page:
<div id="ProdutosSeller" class="col-md-3 col-sm-6 hero-feature">
<div class="thumbnail">
<img src="imagem" alt="">
<div class="caption">
<div class="name" title="<?php echo $produto['name']; ?>">
nome do produto
</div>
<br>
<div class="price">
<span class="price-old"><strong>R$ preço do produto</strong></span>
</div>
<br>
<p>
descricao do produto
</p>
<p>
<a href="index.php?route=product/product&product_id=id do produto" class="btn btn-primary">Comprar</a>
</p>
</div>
</div>
<br>
</div>
My script is like this:
<script type="text/javascript">
var count = 0;
function verMaisProdutos() {
count = count + 4;
$.ajax({
url : "index.php?route=customerpartner/profile/getAjaxProducts&id=58&offset=" + count, //Página PHP que seleciona postagens
type : 'POST', // método post, GET ...
dataType: 'html',
success : function(data) {// sucesso de retorno executar função
$('#ProdutosSeller').append(data);
// adiciona o resultado na div #conteudo
} // fim success
}); // fim ajax
}
</script>
And the data array information is coming like this:
[{"product_id":"112","model":"A-744362K","sku":"744362K","upc":"","ean":"","jan":"","isbn":"","mpn":"","location":"","quantity":"67","stock_status_id":"0","image":"catalog\/tensionamento-de-correias-gates.jpg","manufacturer_id":"20","shipping":"1","price":"8.5","points":"0","tax_class_id":"9","date_available":"2017-04-24","weight":"1.00000000","weight_class_id":"1","length":"1.00000000","width":"1.00000000","height":"1.00000000","length_class_id":"1","subtract":"1","minimum":"1","sort_order":"1","status":"1","viewed":"1","date_added":"2017-05-15 13:29:41","date_modified":"0000-00-00 00:00:00","id":"53","customer_id":"58","seller_price":"8.5","currency_code":"BRL"},{"product_id":"113","model":"I-502165","sku":"502165","upc":"","ean":"","jan":"","isbn":"","mpn":"","location":"","quantity":"67","stock_status_id":"0","image":"catalog\/tensionamento-de-correias-gates.jpg","manufacturer_id":"20","shipping":"1","price":"8.5","points":"0","tax_class_id":"9","date_available":"2017-04-24","weight":"1.00000000","weight_class_id":"1","length":"1.00000000","width":"1.00000000","height":"1.00000000","length_class_id":"1","subtract":"1","minimum":"1","sort_order":"1","status":"1","viewed":"0","date_added":"2017-05-15 13:29:41","date_modified":"0000-00-00 00:00:00","id":"54","customer_id":"58","seller_price":"8.5","currency_code":"BRL"},{"product_id":"114","model":"L-201150","sku":"201150","upc":"","ean":"","jan":"","isbn":"","mpn":"","location":"","quantity":"67","stock_status_id":"0","image":"catalog\/tensionamento-de-correias-gates.jpg","manufacturer_id":"20","shipping":"1","price":"8.5","points":"0","tax_class_id":"9","date_available":"2017-04-24","weight":"1.00000000","weight_class_id":"1","length":"1.00000000","width":"1.00000000","height":"1.00000000","length_class_id":"1","subtract":"1","minimum":"1","sort_order":"1","status":"1","viewed":"0","date_added":"2017-05-15 13:29:41","date_modified":"0000-00-00 00:00:00","id":"55","customer_id":"58","seller_price":"8.5","currency_code":"BRL"},{"product_id":"115","model":"B-207191","sku":"207191","upc":"","ean":"","jan":"","isbn":"","mpn":"","location":"","quantity":"67","stock_status_id":"0","image":"catalog\/tensionamento-de-correias-gates.jpg","manufacturer_id":"20","shipping":"1","price":"8.5","points":"0","tax_class_id":"9","date_available":"2017-04-24","weight":"1.00000000","weight_class_id":"1","length":"1.00000000","width":"1.00000000","height":"1.00000000","length_class_id":"1","subtract":"1","minimum":"1","sort_order":"1","status":"1","viewed":"0","date_added":"2017-05-15 13:29:41","date_modified":"0000-00-00 00:00:00","id":"56","customer_id":"58","seller_price":"8.5","currency_code":"BRL"}]
Make $('#Productosseller'). html(date);
– Netinho Santos