nav cart error fix
Bu işleme şunda yer alıyor:
Sağlanmış
+1
-1
@@ -4,7 +4,7 @@ function navINIT() {
|
|||||||
loadCart();
|
loadCart();
|
||||||
function loadHelper(src = './dist/js/utils/helpers.js'){
|
function loadHelper(src = './dist/js/utils/helpers.js'){
|
||||||
if ($(`script[src="${src}"]`).length > 0) {
|
if ($(`script[src="${src}"]`).length > 0) {
|
||||||
return new Promise((resolve) => resolve);
|
return new Promise((resolve) => resolve());
|
||||||
}
|
}
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
var s;
|
var s;
|
||||||
|
|||||||
Sağlanmış
+67
-16
@@ -4,9 +4,11 @@ function initSelectDevlivery() {
|
|||||||
let currencyId = null;
|
let currencyId = null;
|
||||||
let billingInfo = null;
|
let billingInfo = null;
|
||||||
let userName = null;
|
let userName = null;
|
||||||
|
let stateArr = [];
|
||||||
|
|
||||||
$('.mianselectdelivery').removeClass('d-none');
|
$('.mianselectdelivery').removeClass('d-none');
|
||||||
|
|
||||||
|
|
||||||
let orderBtnAction = {
|
let orderBtnAction = {
|
||||||
removeOrdernowBtn() {
|
removeOrdernowBtn() {
|
||||||
$('.ordernowbtn').parent().addClass('d-none');
|
$('.ordernowbtn').parent().addClass('d-none');
|
||||||
@@ -98,6 +100,39 @@ function initSelectDevlivery() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clearAllInputs(){
|
||||||
|
$("#state").select2({
|
||||||
|
placeholder: "Select a City",
|
||||||
|
allowClear: true
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#phonenumber').val(null);
|
||||||
|
$('#addressdes').val(null);
|
||||||
|
$('#zipcode').val(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function appendFormDetails(){
|
||||||
|
let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
|
||||||
|
console.log(cookieRes);
|
||||||
|
const { errorMsg, isError, response } = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getbillinginfo/contactid/${cookieRes.userId}`);
|
||||||
|
let res = JSON.parse(response.result)[0];
|
||||||
|
debugger;
|
||||||
|
const {cityid, lobid,organizationname,addressline,cityname,phonenumber,zipcode,name } =res;
|
||||||
|
|
||||||
|
setAddressHeader({name:organizationname,phonenumber,addressline,cityname,zipcode});
|
||||||
|
|
||||||
|
$('#phonenumber').val(phonenumber);
|
||||||
|
$('#addressdes').val(addressline);
|
||||||
|
$('#zipcode').val(zipcode);
|
||||||
|
debugger;
|
||||||
|
$('.userNamelogin').html(`${userName}`);
|
||||||
|
|
||||||
|
editMode = true;
|
||||||
|
console.log(stateArr);
|
||||||
|
renderStates(stateArr);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
async function getAddressRes() {
|
async function getAddressRes() {
|
||||||
let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
|
let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
|
||||||
console.log(cookieRes);
|
console.log(cookieRes);
|
||||||
@@ -263,6 +298,8 @@ function initSelectDevlivery() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async function loadEvents() {
|
async function loadEvents() {
|
||||||
$('.addnewAddressContainer').off('click').click(function (e) {
|
$('.addnewAddressContainer').off('click').click(function (e) {
|
||||||
$('.addnewAddressContainer').addClass('d-none');
|
$('.addnewAddressContainer').addClass('d-none');
|
||||||
@@ -285,8 +322,19 @@ function initSelectDevlivery() {
|
|||||||
paymentContainerAction.paymentContainerAdd();
|
paymentContainerAction.paymentContainerAdd();
|
||||||
$('.displayadress').removeClass('d-none');
|
$('.displayadress').removeClass('d-none');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearAllInputs();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.changeAddressBtn').off('click').click(function (e){
|
||||||
|
console.log(e.target);
|
||||||
|
//getAddressRes();
|
||||||
|
appendFormDetails();
|
||||||
|
removeOrderSummary();
|
||||||
|
changeAddressBtnAction.removeChangeAddressBtn();
|
||||||
|
$('.displayadress').addClass('d-none')
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
$('.saveanddeliver').off('click').click(async function (e) {
|
$('.saveanddeliver').off('click').click(async function (e) {
|
||||||
|
|
||||||
@@ -338,12 +386,7 @@ function initSelectDevlivery() {
|
|||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
$('.changeAddressBtn').off('click').click(function (e){
|
|
||||||
console.log(e.target);
|
|
||||||
removeOrderSummary();
|
|
||||||
changeAddressBtnAction.removeChangeAddressBtn();
|
|
||||||
$('.displayadress').addClass('d-none')
|
|
||||||
})
|
|
||||||
|
|
||||||
$('.ordernowbtn').off().click(async function (e){
|
$('.ordernowbtn').off().click(async function (e){
|
||||||
let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
|
let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
|
||||||
@@ -488,6 +531,21 @@ function initSelectDevlivery() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function renderStates(data){
|
||||||
|
$('#state').off('select2:select');
|
||||||
|
let html = '';
|
||||||
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
html += `<option value="${data[i].cityid}" data-id="${data[i].cityid}">${data[i].cityname}</option>`
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#state').append(html);
|
||||||
|
$("#state").select2({
|
||||||
|
placeholder: "Select a City",
|
||||||
|
allowClear: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async function getCountryStateCurrency() {
|
async function getCountryStateCurrency() {
|
||||||
const countryRes = await API_SERVICES_ACTIONS.getAPIService('apis/v4/bizgaze/integrations/products/getcountry');;
|
const countryRes = await API_SERVICES_ACTIONS.getAPIService('apis/v4/bizgaze/integrations/products/getcountry');;
|
||||||
|
|
||||||
@@ -527,17 +585,10 @@ function initSelectDevlivery() {
|
|||||||
console.log("start")
|
console.log("start")
|
||||||
let html = '';
|
let html = '';
|
||||||
statesList = stateData;
|
statesList = stateData;
|
||||||
for (let i = 0; i < stateData.length; i++) {
|
stateArr = stateData;
|
||||||
html += `<option value="${stateData[i].cityid}" data-id="${stateData[i].cityid}">${stateData[i].cityname}</option>`
|
renderStates(stateArr)
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#state').append(html);
|
|
||||||
|
|
||||||
$("#state").select2({
|
|
||||||
placeholder: "Select a City",
|
|
||||||
allowClear: true
|
|
||||||
});
|
|
||||||
|
|
||||||
const currencyRes = await API_SERVICES_ACTIONS.getAPIService('apis/v4/bizgaze/integrations/products/getcurrencies');
|
const currencyRes = await API_SERVICES_ACTIONS.getAPIService('apis/v4/bizgaze/integrations/products/getcurrencies');
|
||||||
|
|
||||||
@@ -580,7 +631,7 @@ debugger;
|
|||||||
<input checked data-op="online" name="payment" type="radio" class="paymentbtn " id="online">
|
<input checked data-op="online" name="payment" type="radio" class="paymentbtn " id="online">
|
||||||
</label>
|
</label>
|
||||||
<label for="cod">
|
<label for="cod">
|
||||||
Cash on develiop
|
Cash on delivery
|
||||||
<input data-op="cod" name="payment" type="radio" class="paymentbtn " id="cod">
|
<input data-op="cod" name="payment" type="radio" class="paymentbtn " id="cod">
|
||||||
</label>`);
|
</label>`);
|
||||||
|
|
||||||
|
|||||||
Yeni konuda referans
Bir kullanıcı engelle