add cart test

This commit is contained in:
Kerim 2023-06-21 03:16:17 +05:00
parent 76cd08b27b
commit 5afb1670d8
2 changed files with 16 additions and 27 deletions

View File

@ -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 %}

View File

@ -147,3 +147,5 @@
<!-- header-bottom-area end -->
</header>
<!-- HEADER AREA END -->
{% partial 'cart/get' %}