code added
This commit is contained in:
Vendored
+2
-1
@@ -1,6 +1,7 @@
|
||||
//let SERVERNAME = 'https://anwi.bizgaze.app';
|
||||
//let SERVERNAME = 'http://beta.bizgaze.com';
|
||||
let SERVERNAME = 'http://localhost:3088';
|
||||
let SERVERNAME = 'https://qa.anwisystems.com';
|
||||
//let SERVERNAME = 'http://localhost:3088';
|
||||
|
||||
//template
|
||||
const STAT = '8041f78ba55b4847bc4aacaeae9d24ef';
|
||||
|
||||
Vendored
+13
-2
@@ -4,6 +4,11 @@
|
||||
/*--
|
||||
Menu Stick
|
||||
-----------------------------------*/
|
||||
|
||||
let width = $(window).width();
|
||||
|
||||
|
||||
|
||||
var header = $('.sticky-bar');
|
||||
var win = $(window);
|
||||
let ele_page = $("body").hasClass("product_pg");
|
||||
@@ -22,12 +27,12 @@
|
||||
let img_src = `./dist/assets/imgs/anwi-logo-2.png`;
|
||||
$(".logo-menu-wrap").find("a img").attr("src",img_src);
|
||||
$(".main-menu").find("nav ul li a").addClass("text-white");
|
||||
debugger;
|
||||
|
||||
$("body.product_pg").find(".header-large-device").find(".header-action-wrap").find(".same-style").find("svg").find("path").attr("fill","#fff");
|
||||
$('.header-bottom-flex').find('svg path').attr('fill','#fff')
|
||||
} else {
|
||||
header.addClass('stick');
|
||||
debugger;
|
||||
|
||||
$(".header-bottom").addClass("sticky-bar stick");
|
||||
let src = `./dist/assets/imgs/anwi-logo-1.png`;
|
||||
$(".logo-menu-wrap").find("a img").attr("src",src);
|
||||
@@ -1446,6 +1451,12 @@
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
setTimeout(()=>{
|
||||
if(width<=600){
|
||||
$('.same-style').find('svg path').attr('fill','#000')
|
||||
}
|
||||
},300)
|
||||
|
||||
})(jQuery);
|
||||
|
||||
|
||||
Vendored
+31
-31
@@ -1,13 +1,13 @@
|
||||
async function bindOrderDetails() {
|
||||
let user_number =$('.User_phoneum').text();
|
||||
// validatesession()
|
||||
debugger
|
||||
let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
|
||||
let { userId} = cookieRes;
|
||||
//let userId = '106631380000048';
|
||||
debugger;
|
||||
let port = SERVERNAME;
|
||||
// let port = "http://localhost:3088";
|
||||
let user_number = $('.User_phoneum').text();
|
||||
// validatesession()
|
||||
debugger
|
||||
let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
|
||||
let { userId } = cookieRes;
|
||||
//let userId = '106631380000048';
|
||||
debugger;
|
||||
let port = SERVERNAME;
|
||||
// let port = "http://localhost:3088";
|
||||
let url = `${port}/apis/v4/Bizgaze/integrations/products/salesorderdetailsbyorgid/organizationid/${userId}`;
|
||||
// /apis/v4/bizgaze/integrations/products/salesorderdetailsbyorgid/phonenumber/
|
||||
// https://anwi.bizgaze.app/apis/v4/Bizgaze/integrations/products/salesorderdetailsbyorgid/organizationid/{organizationid}
|
||||
@@ -17,11 +17,11 @@ let port = SERVERNAME;
|
||||
headers: {
|
||||
'Authorization': `stat ${STAT} `,
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}
|
||||
};
|
||||
debugger
|
||||
let res = await axios(config);
|
||||
if(res.data.result == '[]' || res.data.result === null){
|
||||
if (res.data.result == '[]' || res.data.result === null) {
|
||||
$(".user_order_details").append(`<div><h6 class="text-center">No orders Found</h6></div>`);
|
||||
return;
|
||||
}
|
||||
@@ -31,19 +31,19 @@ let port = SERVERNAME;
|
||||
console.log(new_arrr);
|
||||
$(".user_order_details").html(``)
|
||||
console.log('hello')
|
||||
let user_order_details =``;
|
||||
let user_order_details = ``;
|
||||
let order_itemTotal = '';
|
||||
let order_netTotal = '' ;
|
||||
let order_quantity = '' ;
|
||||
let order_taxAmount = '' ;
|
||||
for(let i=0;i<new_arrr.length;i++){
|
||||
let current=new_arrr[i]
|
||||
let updatedCurent_total= current.nettotal.toLocaleString()
|
||||
order_itemTotal = current.itemtotal;
|
||||
order_netTotal = current.nettotal;
|
||||
order_quantity =current.Quantity;
|
||||
order_taxAmount =current.taxamount;
|
||||
user_order_details+= `<a href="" class="order_details_main_container">
|
||||
let order_netTotal = '';
|
||||
let order_quantity = '';
|
||||
let order_taxAmount = '';
|
||||
for (let i = 0; i < new_arrr.length; i++) {
|
||||
let current = new_arrr[i]
|
||||
let updatedCurent_total = current.nettotal.toLocaleString()
|
||||
order_itemTotal = current.itemtotal;
|
||||
order_netTotal = current.nettotal;
|
||||
order_quantity = current.Quantity;
|
||||
order_taxAmount = current.taxamount;
|
||||
user_order_details += `<a href="" class="order_details_main_container">
|
||||
<div class="border-3 mb-3 card">
|
||||
<div class="text-dark card-body px-0 pt-0">
|
||||
<div class="d-none">
|
||||
@@ -102,17 +102,17 @@ let port = SERVERNAME;
|
||||
</div>
|
||||
</div>
|
||||
</a>`;
|
||||
}
|
||||
}
|
||||
$(".user_order_details").append(user_order_details);
|
||||
$('.order_details_main_container').click(function(){
|
||||
let current_serial_no= $(this).find('.serial_no').text();
|
||||
$('.order_details_main_container').click(function () {
|
||||
let current_serial_no = $(this).find('.serial_no').text();
|
||||
// window.localStorage.setItem('orderDate',current_order_date);
|
||||
window.localStorage.setItem('orderSerialno',current_serial_no);
|
||||
window.localStorage.setItem('Userphonenumber',user_number);
|
||||
$(this).attr('href','./orderdetails.html')
|
||||
})
|
||||
// window.localStorage.setItem('orderSerialno',current_serial_no);
|
||||
// window.localStorage.setItem('Userphonenumber',user_number);
|
||||
$(this).attr('href', `./orderdetails.html#${current_serial_no}`)
|
||||
})
|
||||
}
|
||||
function toasterOpts(){
|
||||
function toasterOpts() {
|
||||
toastr.options = {
|
||||
"closeButton": true,
|
||||
"debug": false,
|
||||
|
||||
Vendored
+10
-4
@@ -1,7 +1,7 @@
|
||||
navINIT();
|
||||
|
||||
function navINIT() {
|
||||
if(!window.location.href.includes('orderconfirmation')){
|
||||
if(!window.location.href.includes('orderconfirmation')&&!window.location.href.includes('/w/')){
|
||||
loadCart();
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ function navINIT() {
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-small-device header-small-ptb sticky-bar py-md-2 py-2 bg-white">
|
||||
<div class="container-fluid">
|
||||
<div class="container-fluid px-4">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-6 header-action-wrap">
|
||||
<div class="d-flex">
|
||||
@@ -113,10 +113,10 @@ function navINIT() {
|
||||
<div class="col-6">
|
||||
<div class="header-action-wrap header-action-flex header-action-mrg-1">
|
||||
<div class="same-style">
|
||||
<a href="./myaccount.html" class="my_avatar"><i class="fa-solid fa-user"></i></a>
|
||||
<a href="./myaccount.html" class="my_avatar"> <svg style="width:22px;" viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" class="icon" data-di-res-id="e576e1a9-2f4a9ed6" data-di-rand="1682677695656"><path fill="#fff" d="M48 50c17.346 0 32 14.221 32 31.054V89c0 2.757-2.243 5-5 5H21c-2.757 0-5-2.243-5-5v-7.946C16 64.221 30.654 50 48 50zm0 8c-12.785 0-24 10.773-24 23.054V86h48v-4.946C72 68.773 60.785 58 48 58zm-.002-56c12.133 0 22.003 9.87 22.003 22.001C70 36.131 60.13 46 47.998 46c-12.13 0-21.997-9.869-21.997-21.999C26 11.87 35.867 2 47.998 2zm0 8c-7.718 0-13.997 6.281-13.997 14.001C34 31.72 40.28 38 47.998 38 55.718 38 62 31.72 62 24.001 62 16.281 55.719 10 47.998 10z"></path></svg></a>
|
||||
</div>
|
||||
<div class="same-style header-cart">
|
||||
<a class="cart-active1 position-relative" href="./shopping-cart.html"><i class="fa-solid fa-cart-shopping"></i>
|
||||
<a class="cart-active1 position-relative" href="./shopping-cart.html"> <svg style="width:22px;" viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" class="icon" data-di-res-id="e576e1a9-90f52cd9" data-di-rand="1682677695656"><path fill="#fff" d="M72.848 70.25c6.075 0 11 4.925 11 11s-4.925 11-11 11-11-4.925-11-11 4.925-11 11-11zm-35 0c6.075 0 11 4.925 11 11s-4.925 11-11 11-11-4.925-11-11c0-6.074 4.926-11 11-11zm35 7a4 4 0 10.002 8.001 4 4 0 00-.002-8.001zm-35 0a4 4 0 100 8 4 4 0 000-8zM13.892 3.75c2.287 0 4.376 1.55 5.058 3.72l.064.22 2.97 11.187h68.128a4.727 4.727 0 014.661 5.786l-.048.2-9.559 36.291c-.583 2.216-2.618 3.842-4.894 3.944l-.228.005H30.06c-2.287 0-4.377-1.55-5.06-3.72l-.063-.219-13.124-49.413-10.7.006-.004-8 12.782-.007zm72.03 23.127H24.108l8.027 30.226H77.96l7.962-30.226z"></path></svg>
|
||||
<span class="position-absolute cartnumcount d-none" style="top:-27%;right:-80%">0</span>
|
||||
</a>
|
||||
</div>
|
||||
@@ -296,4 +296,10 @@ function navINIT() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setTimeout(()=>{
|
||||
if(width<=600){
|
||||
$('.same-style').find('svg path').attr('fill','#000')
|
||||
}
|
||||
},300)
|
||||
}
|
||||
+44
-52
@@ -1,57 +1,49 @@
|
||||
async function order_summary(){
|
||||
let current_orderSerialDate =window.localStorage.getItem('orderSerialno');
|
||||
// let user_number =window.localStorage.getItem('Userphonenumber');
|
||||
let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
|
||||
let { userId} = cookieRes;
|
||||
// let userId = '106631380000048';
|
||||
let port = SERVERNAME;
|
||||
// let port = "http://localhost:3088";
|
||||
// let url = `${port}/apis/v4/bizgaze/integrations/products/salesorderdetailsbyphonenumber/phonenumber/${user_number}`;
|
||||
let url = `${port}/apis/v4/Bizgaze/integrations/products/salesorderdetailsbyorgid/organizationid/${userId}`;
|
||||
const config = {
|
||||
url,
|
||||
method: "get",
|
||||
headers: {
|
||||
'Authorization': `stat ${STAT} `,
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
};
|
||||
let res = await axios(config);
|
||||
const orderDetailsres = JSON.parse(res.data.result);
|
||||
console.log(orderDetailsres);
|
||||
let new_arrr = orderDetailsres;
|
||||
console.log(new_arrr)
|
||||
let orderNumber = localStorage.getItem("orderSerialno");
|
||||
let filteredOrders = new_arrr.filter(function(order) {
|
||||
return order.OrderNo === orderNumber;
|
||||
});
|
||||
|
||||
$.each(filteredOrders, function(index, order) {
|
||||
console.log(order.OrderNo)
|
||||
let Delivery_status =order.stageshortcode
|
||||
let deliverdCard=`<div class="card rounded-0 border-0 bg-white mb-3 "><div class=card-body><div class="align-items-center row"><div class=col-md-6><div class=d-flex><img class=img-fluid src=""></div><div class="d-flex align-items-center"><div class="text-secondary">Delivery Status : </div><div class=" delivery_status text-blue fw-600" data-status="${order.stageshortcode}"></div></div></div><div class="col-md-6 text-end"><button class=" bg-gradient-anwi-outline btn-sm btn ">Claim warranty</button> <button class=" bg-gradient-anwi-outline btn-sm btn ">Support</button></div></div><div><small class=" text-secondary me-2">Delivered To : </small><small class="fw-600 user_name">${order.OrganizationName}</div><div class="row pb-4 pb-md-0 align-items-center"><div class="col-md-4 text-center"><img class="img-fluid order_img w-75"src=https://appassets.bizgaze.app/${order.imageurl}></div><div class="col-md-8 position-relative"><small class=" mb-0 order_itemname">${order.itemname} (${order.Quantity} items)<small class=" align-items-center d-flex fw-600 mb-3"><svg class="bi bi-currency-rupee"fill=currentColor height=16 viewBox="0 0 16 16"width=16 xmlns=http://www.w3.org/2000/svg><path d="M4 3.06h2.726c1.22 0 2.12.575 2.325 1.724H4v1.051h5.051C8.855 7.001 8 7.558 6.788 7.558H4v1.317L8.437 14h2.11L6.095 8.884h.855c2.316-.018 3.465-1.476 3.688-3.049H12V4.784h-1.345c-.08-.778-.357-1.335-.793-1.732H12V2H4v1.06Z"></path></svg><small class="order_price fs-6">${order.itemtotal}</small><p class=" mb-0 close_exchange position-absolute d-none text-secondary">Return/Exchange window closed on Friday,24 March <a class=text-primary href=#>Why?</a></div></div></div></div>`;
|
||||
$('.deliverd-card').append(deliverdCard)
|
||||
if(Delivery_status == 'CMD'){
|
||||
$('.delivery_status').html('Deliverd')
|
||||
}
|
||||
if(Delivery_status == 'APL'){
|
||||
$('.delivery_status').html('Approval')
|
||||
}
|
||||
});
|
||||
console.log(filteredOrders)
|
||||
let summary =`<div class=card-body><div><p class="mb-0 fw-500">Order : <span>${orderNumber}</span><small class=" "> ( ${filteredOrders.length} items )</samll><p class="mb-0 ">Order placed on ${filteredOrders[0].OrderDate}</p></div>`;
|
||||
|
||||
$('.order_tax').html(filteredOrders[0].taxamount)
|
||||
$('.Order_total').html(filteredOrders[0].nettotal)
|
||||
$('.order_price').html(filteredOrders[0].itemtotal)
|
||||
$('.order-summary').html(summary);
|
||||
$('.back_to_orders').click(function(){
|
||||
let Local_keys_update =['Userphonenumber','orderSerialno']
|
||||
debugger
|
||||
for (key of Local_keys_update) {
|
||||
window.localStorage.removeItem(key);
|
||||
let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
|
||||
let { userId} = cookieRes;
|
||||
// let res = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/Bizgaze/integrations/products/salesorderdetailsbyorgid/organizationid/${userId}`,true);
|
||||
// https://templateserver.bizgaze.com/apis/v4/bizgaze/integrations/products/getordersbyid/organizationid/{organizationid}/orderno/{orderno}
|
||||
let orderno = window.location.hash.split('#')[1];
|
||||
let res = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getordersbyid/organizationid/${userId}/orderno/${orderno}`);
|
||||
if(res.isError){
|
||||
return;
|
||||
}
|
||||
$(this).attr('href','./myaccount.html')
|
||||
})
|
||||
const orderDetailsres = JSON.parse(res.response.result);
|
||||
|
||||
let new_arrr = orderDetailsres;
|
||||
console.log(new_arrr)
|
||||
let orderNumber =window.location.hash.split('#')[1];
|
||||
let filteredOrders = new_arrr.filter(function(order) {
|
||||
return order.OrderNo === orderNumber;
|
||||
});
|
||||
|
||||
for(let i=0;i<filteredOrders.length;i++){
|
||||
let order = filteredOrders[i];
|
||||
let Delivery_status =order.stageshortcode
|
||||
let deliverdCard=appendItemHTML(order);
|
||||
$('.deliverd-card').append(deliverdCard)
|
||||
if(Delivery_status == 'CMD'){
|
||||
$('.delivery_status').html('Deliverd')
|
||||
}
|
||||
if(Delivery_status == 'APL'){
|
||||
$('.delivery_status').html('Approval')
|
||||
}
|
||||
}
|
||||
|
||||
let summary =`<div class=card-body><div><p class="mb-0 fw-500">Order : <span>${orderNumber}</span><small class=" "> ( ${filteredOrders.length} items )</samll><p class="mb-0 ">Order placed on ${filteredOrders[0].OrderDate}</p></div>`;
|
||||
|
||||
$('.Order_details_section .order_tax').html(filteredOrders[0].taxamount)
|
||||
$('.Order_details_section .Order_total').html(filteredOrders[0].nettotal)
|
||||
$('.Order_details_section .order_price').html(filteredOrders[0].assessableamount)
|
||||
$('.Order_details_section .order-summary').html(summary);
|
||||
|
||||
$('.back_to_orders').click(function(){
|
||||
$(this).attr('href','./myaccount.html')
|
||||
});
|
||||
|
||||
function appendItemHTML(order){
|
||||
return `<div class="card rounded-0 border-0 bg-white mb-3 "><div class=card-body><div class="align-items-center row"><div class=col-md-6><div class=d-flex><img class=img-fluid src=""></div><div class="d-flex align-items-center"><div class="text-secondary">Delivery Status : </div><div class=" delivery_status text-blue fw-600" data-status="${order.stageshortcode}"></div></div></div><div class="col-md-6 text-end"><button class=" bg-gradient-anwi-outline btn-sm btn ">Claim warranty</button> <button class=" bg-gradient-anwi-outline btn-sm btn ">Support</button></div></div><div><small class=" text-secondary me-2">Delivered To : </small><small class="fw-600 user_name">${order.OrganizationName}</div><div class="row pb-4 pb-md-0 align-items-center"><div class="col-md-4 text-center"><img class="img-fluid order_img w-75"src=https://appassets.bizgaze.app/${order.imageurl}></div><div class="col-md-8 position-relative"><small class=" mb-0 order_itemname">${order.itemname} (${order.Quantity} items)<small class=" align-items-center d-flex fw-600 mb-3"><svg class="bi bi-currency-rupee"fill=currentColor height=16 viewBox="0 0 16 16"width=16 xmlns=http://www.w3.org/2000/svg><path d="M4 3.06h2.726c1.22 0 2.12.575 2.325 1.724H4v1.051h5.051C8.855 7.001 8 7.558 6.788 7.558H4v1.317L8.437 14h2.11L6.095 8.884h.855c2.316-.018 3.465-1.476 3.688-3.049H12V4.784h-1.345c-.08-.778-.357-1.335-.793-1.732H12V2H4v1.06Z"></path></svg><small class="order_price fs-6">${order.itemtotal}</small><p class=" mb-0 close_exchange position-absolute d-none text-secondary">Return/Exchange window closed on Friday,24 March <a class=text-primary href=#>Why?</a></div></div></div></div>`;
|
||||
}
|
||||
}
|
||||
order_summary()
|
||||
+10
-11
@@ -25,7 +25,7 @@ function startDetails(){
|
||||
}
|
||||
|
||||
let currentClick = null;
|
||||
debugger;
|
||||
|
||||
if(productId){
|
||||
loadingActions.addLoader();
|
||||
updateProductId(productId);
|
||||
@@ -45,7 +45,7 @@ function startDetails(){
|
||||
|
||||
let specification_wrap_action = {
|
||||
remove(){
|
||||
debugger;
|
||||
|
||||
$('.specification-wrap').addClass('d-none');
|
||||
},
|
||||
|
||||
@@ -125,8 +125,7 @@ function startDetails(){
|
||||
}
|
||||
|
||||
}
|
||||
debugger;
|
||||
|
||||
|
||||
$('.specContainerleft').html(leftHtml)
|
||||
$('.specContainerRight').html(rightHtml)
|
||||
|
||||
@@ -162,7 +161,7 @@ function startDetails(){
|
||||
|
||||
$('.optiontaganwi').each(function (i,el){
|
||||
$(el).click(function (e){
|
||||
|
||||
$('#quantity').val(1)
|
||||
$(e.target).parent().find('.borderselector').removeClass('borderselector');
|
||||
$(e.target).addClass('borderselector')
|
||||
searchComb();
|
||||
@@ -183,7 +182,7 @@ function startDetails(){
|
||||
|
||||
let defaultImg = obj.itemimageurl ? imgServerNameBuild(obj.itemimageurl): `./dist/assets/imgs/nophoto.png`;
|
||||
console.log(obj.itemimageurl,'obj.itemimageurlobj.itemimageurlobj.itemimageurl');
|
||||
debugger;
|
||||
|
||||
$('.productDetailsMain > img').attr('src',defaultImg);
|
||||
|
||||
updateItemId(obj.itemid);
|
||||
@@ -244,7 +243,7 @@ debugger;
|
||||
// $('.des_productdes').html(itemtagscombinationRes[i].itemdescription);
|
||||
updateDetailsByObj(itemtagscombinationRes[i]);
|
||||
}else{
|
||||
debugger;
|
||||
|
||||
let name = itemtagscombinationRes[i].itemname.split('-')[0];
|
||||
$('#addtocart').addClass('disabled');
|
||||
let itemsName = name;
|
||||
@@ -329,7 +328,7 @@ debugger;
|
||||
|
||||
async function getProductDetails(id){
|
||||
|
||||
debugger
|
||||
|
||||
|
||||
// let res = await getStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/productattributelist/productid/${id}`);
|
||||
|
||||
@@ -412,7 +411,7 @@ debugger;
|
||||
let val = $(el).html();
|
||||
valuesSelected.push(val.trim());
|
||||
});
|
||||
debugger;
|
||||
|
||||
let searchParams = window.location.search.split("&");
|
||||
let skuId = window.location.hash.split('#')[1].split('=')[1];
|
||||
// skuId = skuId.split('=')[1]
|
||||
@@ -437,7 +436,7 @@ debugger;
|
||||
}
|
||||
|
||||
if(isTrue){
|
||||
debugger;
|
||||
|
||||
console.log(itemtagscombinationRes[i],'itemtagscombinationRes[i]');
|
||||
|
||||
|
||||
@@ -447,7 +446,7 @@ debugger;
|
||||
// $('.productname').html(itemtagscombinationRes[i].itemname);
|
||||
// $('#skudetailitem').val(itemtagscombinationRes[i].sku)
|
||||
// $('.price').html(itemtagscombinationRes[i].pricelist)
|
||||
// debugger;
|
||||
|
||||
// appendSpecs(itemtagscombinationRes[i].itemid);
|
||||
// $('.des_productdes').html(itemtagscombinationRes[i].itemdescription);
|
||||
|
||||
|
||||
Vendored
+6
-2
@@ -83,9 +83,12 @@ debugger;
|
||||
|
||||
return `<div class="col-lg-4 col-md-6 mb-4 col-md-6 ram_card cursor-pointer">
|
||||
<div class="card border bg-gray-3 rounded-3 p-1 h-100">
|
||||
<img src="${img}" alt="${itemname}" class="w-100 h-100"></a>
|
||||
|
||||
<a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class=""><img src="${img}" alt="${itemname}" class="w-100 h-100"></a>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title satoshi_font mb-0">${itemname}</h5>
|
||||
<a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="">
|
||||
<h5 class="card-title satoshi_font mb-0 px-2 text-center font-weight-600">${itemname}</h5>
|
||||
</a>
|
||||
</div>
|
||||
<ul class="border-0 d-flex h-100 justify-content-between px-md-3 px-4 list-group-flush p-0 text-secondary" style="list-style: none;">
|
||||
<li class="border-0 py-0">
|
||||
@@ -99,6 +102,7 @@ debugger;
|
||||
<a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="btn bg-white font-1-2 px-5 w-100">Details
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
|
||||
Vendored
+37
-14
@@ -62,7 +62,7 @@ function updateCartQuantity(id,val){
|
||||
}
|
||||
|
||||
function removeCartItem(id){
|
||||
debugger;
|
||||
|
||||
let data = getCartData();
|
||||
if(!data) return;
|
||||
|
||||
@@ -105,7 +105,7 @@ function updateSummaryPriceAdd(){
|
||||
}
|
||||
|
||||
function initAddToCart(){
|
||||
debugger;
|
||||
|
||||
addEventListeners();
|
||||
|
||||
function addToCartFun(){
|
||||
@@ -116,7 +116,7 @@ debugger;
|
||||
if(!data){
|
||||
|
||||
let cartObj = {};
|
||||
debugger;
|
||||
|
||||
|
||||
cartObj[$('#skudetailitem').val()] = {
|
||||
name:$('.productname').html(),
|
||||
@@ -171,34 +171,57 @@ debugger;
|
||||
}
|
||||
|
||||
}
|
||||
debugger;
|
||||
|
||||
setLengthCart();
|
||||
|
||||
}
|
||||
|
||||
function addEventListeners(){
|
||||
$('#addtocart').html('Add to cart')
|
||||
$('#addtocart').off().click((e)=>{
|
||||
debugger
|
||||
$('#addtocart').html('Add to cart');
|
||||
$('#addtocart').removeAttr('gotocart');
|
||||
$('#addtocart').off('click').click((e)=>{
|
||||
|
||||
$('.insufficientqty').addClass('d-none');
|
||||
const qty = parseInt($('#addtocart').data('qty'));
|
||||
debugger;
|
||||
|
||||
if(parseInt($('#quantity').val())>qty){
|
||||
$('.insufficientqty').removeClass('d-none');
|
||||
return;
|
||||
}
|
||||
$('#addtocart').off().click(function (el){
|
||||
window.location.href = '/shopping-cart.html';
|
||||
// $('#addtocart').off().click(function (el){
|
||||
// window.location.href = '/shopping-cart.html';
|
||||
|
||||
});
|
||||
// });
|
||||
|
||||
addToCartFun();
|
||||
debugger;
|
||||
|
||||
toasterHelper('success',"Item added to cart","toast-top-right");
|
||||
|
||||
$('#addtocart').html('Go to cart');
|
||||
// $('#addtocart').html('Go to cart');
|
||||
// debugger;
|
||||
// $('#addtocart').attr('gotocart',1);
|
||||
});
|
||||
|
||||
// $('.quantityHTML #quantity').off('change').change(function (e){
|
||||
// let sku = $('#skudetailitem').val();
|
||||
// let data = getCartData();
|
||||
// const qty = parseInt($('#addtocart').data('qty'));
|
||||
// let isCart = $('#addtocart').attr('gotocart');
|
||||
// if(!isCart) return;
|
||||
// if(parseInt($('#quantity').val())>qty){
|
||||
// $('.insufficientqty').removeClass('d-none');
|
||||
// return;
|
||||
// }
|
||||
// if(!data[sku]){
|
||||
// return;
|
||||
// }
|
||||
|
||||
// data[sku].quantity = $('.quantityHTML #quantity').val();
|
||||
// toasterHelper("success","Your item quantity was been updated","toast-top-right")
|
||||
// setCartData(data);
|
||||
// setLengthCart();
|
||||
// })
|
||||
|
||||
$('.buynow').off('click').click(async (e)=>{
|
||||
addToCartFun();
|
||||
const res = await COOKIE_HELPER.validateToken();
|
||||
@@ -212,7 +235,7 @@ debugger;
|
||||
}
|
||||
window.location.href = '/selectdelivery.html';
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function addtoCart(data){
|
||||
|
||||
Vendored
-1
@@ -1,6 +1,5 @@
|
||||
shoppingCartInit();
|
||||
|
||||
debugger;
|
||||
function shoppingCartInit() {
|
||||
|
||||
shoppingCartAppend();
|
||||
|
||||
Vendored
+1
@@ -41,6 +41,7 @@ function getCurrencySymbol(value=0) {
|
||||
function toasterHelper(type,message,align='toast-top-center'){
|
||||
// toasterOpts()
|
||||
debugger;
|
||||
toastr.clear()
|
||||
toasterOpts(align);
|
||||
Command: toastr[type](message);
|
||||
|
||||
|
||||
Vendored
+1
@@ -1,4 +1,5 @@
|
||||
function wattantyFunction() {
|
||||
setLengthCart();
|
||||
let order_card = `<div class=warranty_product><div class="py-3 warranty_productform"><div class=mb-3><label class=form-label for=Add_serial_number_inp>Enter Your Serial Number</label><input class=form-control id=Add_serial_number_inp required><label class="form-label text-danger d-none error_serial_num" for=Add_serial_number_inp >Serial Number should not be empty</label></div><div class=mb-3><label class="form-label d-none Add_phonenumber_inp_label" for=Add_phonenumber_inp>Enter Your Phone Number</label> <input type="number" inputmode="tel" class="form-control d-none" pattern="[1-9]{1}[0-9]{9}^[0-9]*$" onKeyPress="if(this.value.length==10) return false;"maxlength="10" id=Add_phonenumber_inp required><label class="text-danger d-none form-label error_phonenumber" for=Add_phonenumber_inp>Enter Valid Phone Number</label></div><div class=mb-3><label class="form-label d-none Add_Contact_inp_label" for=Add_contactname_inp>Enter Your Contactname</label> <input class="form-control d-none" id=Add_contactname_inp required></div><div class="serial_submit text-end"><button class="btn btn-dark warranty_serialNumber_check" type="button">Submit</button><button class="btn btn-dark warranty_serialNumber_submit d-none" type="button">Submit</button></div></div></div>`;
|
||||
$(".user_orders").append(order_card);
|
||||
$(".add_serialNum").click(function () {
|
||||
|
||||
Reference in New Issue
Block a user