45 lines
2.0 KiB
HTML
45 lines
2.0 KiB
HTML
{% put scripts %}
|
|
|
|
<script>
|
|
getWish();
|
|
$('#pagination').hide();
|
|
// console.log("qqq");
|
|
function getWish() {
|
|
|
|
oc.ajax('onGetWish', {
|
|
beforeSend: function () {
|
|
$('#products_{{id}}').html("");
|
|
$('#products_list_{{id}}').html("");
|
|
$('#pagination_numbers').html("");
|
|
$('#detail_screen').hide();
|
|
$('#products_{{id}}').hide();
|
|
$('#loader_{{id}}').show();
|
|
},
|
|
success: function (data, textStatus, xhr) {
|
|
$('#detail_screen').show();
|
|
$('#loader_{{id}}').hide();
|
|
$('#products_{{id}}').show();
|
|
// $('#show_title').html(`<span>{{'all'|_}}` + data.meta.total + `, {{'per.page'|_}} ` + data.meta.to + `</span>`);
|
|
|
|
|
|
var products = data.data;
|
|
console.log(data);
|
|
|
|
for (var product of products) {
|
|
// console.log(product.name);
|
|
$('#products_{{id}}').append(`{% partial 'product/category-card' url="/product/` + product.product.id + `" name="` + product.product.name + `" price="` + product.product.formatted_price + `" category="` + product.product.shop_title + `" img="` + product.product.images[0].original_image_url + `" product_id="` + product.product.id + `" %}`);
|
|
|
|
$('#products_list_{{id}}').append(`{% partial 'product/category-list' url="/product/` + product.product.id + `" id='cat' status='aksiýa' name="` + product.product.name + `" price="` + product.product.formatted_price + `" category="` + product.product.shop_title + `" img="` + product.product.images[0].original_image_url + `" desc="` + product.product.short_description + `" product_id="` + product.product.id + `" %}`);
|
|
}
|
|
|
|
|
|
},
|
|
error: function (xhr, textStatus, errorThrown) {
|
|
console.log('Error in Operation');
|
|
}
|
|
});
|
|
}
|
|
|
|
</script>
|
|
{% endput %}
|