add cart test
This commit is contained in:
parent
76cd08b27b
commit
5afb1670d8
|
|
@ -3,35 +3,22 @@
|
|||
<script>
|
||||
getCart();
|
||||
// console.log("qqq");
|
||||
function getCart(query, limit) {
|
||||
console.log(query);
|
||||
$(document).ready(function () {
|
||||
$.ajax({
|
||||
url: `https://nurgul.com.tm/app/api/customer/cart`,
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$('#products_{{id}}').hide();
|
||||
$('#loader_{{id}}').show();
|
||||
},
|
||||
success: function (data, textStatus, xhr) {
|
||||
$('#loader_{{id}}').hide(500);
|
||||
$('#products_{{id}}').show(500);
|
||||
function getCart() {
|
||||
// console.log(query);
|
||||
|
||||
|
||||
// console.log(data.data);
|
||||
|
||||
var products = data.data;
|
||||
for (var product of products) {
|
||||
// console.log(product.hasOwnProperty('special_price'));
|
||||
$('#products_{{id}}').append(productCard(product));
|
||||
}
|
||||
},
|
||||
error: function (xhr, textStatus, errorThrown) {
|
||||
console.log('Error in Operation');
|
||||
}
|
||||
});
|
||||
$.ajax({
|
||||
url: `https://nurgul.com.tm/app/api/customer/cart`,
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
headers: { Authorization: 'Bearer {{token}}' },
|
||||
success: function (data, textStatus, xhr) {
|
||||
console.log(data);
|
||||
},
|
||||
error: function (xhr, textStatus, errorThrown) {
|
||||
console.log('Error in Operation');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
{% endput %}
|
||||
|
|
|
|||
|
|
@ -147,3 +147,5 @@
|
|||
<!-- header-bottom-area end -->
|
||||
</header>
|
||||
<!-- HEADER AREA END -->
|
||||
|
||||
{% partial 'cart/get' %}
|
||||
|
|
|
|||
Loading…
Reference in New Issue