Naprawa buga związanego z walidacją kodu pocztowego
This commit is contained in:
@@ -765,8 +765,6 @@ async function changeRegion(payAndDelData = null, firstLoad = false) {
|
||||
// Pobranie informacji o regionie z formularza
|
||||
const clientRegion = document.getElementById("client_region").value;
|
||||
const deliveryRegion = document.getElementById("deliver_to_billingaddr").checked ? document.getElementById("delivery_region").value : clientRegion;
|
||||
|
||||
|
||||
|
||||
// Zmiana regionu
|
||||
const regionStatus = await this.fetchData({
|
||||
@@ -1592,11 +1590,11 @@ async function validateAllInputs(){
|
||||
allGood = await validateRequest(document.getElementById("client_nip"), true) && allGood;
|
||||
}
|
||||
// Sprawdzenie reszty pól
|
||||
allGood = validateFormInputs("client") && allGood;
|
||||
allGood = await validateFormInputs("client") && allGood;
|
||||
}
|
||||
// Sprawdzanie pól dostawy na inny adres
|
||||
if(document.getElementById("deliver_to_billingaddr").checked){
|
||||
allGood = validateFormInputs("delivery") && allGood;
|
||||
allGood = await validateFormInputs("delivery") && allGood;
|
||||
allGood = validatePhone(document.getElementById("delivery_phone")) && allGood;
|
||||
}
|
||||
return allGood
|
||||
@@ -1616,12 +1614,13 @@ async function validateFormInputs(query){
|
||||
// Obsługa złożenia zamówienia
|
||||
const termsConditionsInput = document.getElementById("order2_terms_conditions");
|
||||
const cancelConditionsInput = document.getElementById("order2_cancel");
|
||||
document.querySelector(".order2_button_order").addEventListener("click", () => {
|
||||
document.querySelector(".order2_button_order").addEventListener("click", async () => {
|
||||
try {
|
||||
app_shop.fn.ajaxLoadSite(1);
|
||||
app_shop.vars.validation = 1;
|
||||
// Sprawdzenie pól formularza
|
||||
if(validateAllInputs() === false) app_shop.vars.validation = 0;
|
||||
const x = await validateAllInputs();
|
||||
if(x === false) app_shop.vars.validation = 0;
|
||||
|
||||
// Znalezienie obecnie zaznaczonej metody dostawy i płatności
|
||||
const deliveryMethod = document.querySelector(".ajax_cop [name=shipping]:checked");
|
||||
@@ -1682,7 +1681,7 @@ document.querySelector(".order2_button_order").addEventListener("click", () => {
|
||||
});
|
||||
// Przescrolluj do
|
||||
function scrollToHeight(scrollToEl){
|
||||
const yOffset = -45;
|
||||
const yOffset = app_shop.vars.view === 1 ? -100 : -45;
|
||||
const y = scrollToEl.getBoundingClientRect().top + window.pageYOffset + yOffset;
|
||||
window.scrollTo({top: y, behavior: 'smooth'});
|
||||
}
|
||||
|
||||
@@ -518,8 +518,9 @@
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
top: 12%;
|
||||
height: 75%;
|
||||
background: #fff;
|
||||
}
|
||||
#toggle_password:hover{
|
||||
color: @less_iaicolorscheme_background_active_color;
|
||||
|
||||
@@ -762,8 +762,6 @@ async function changeRegion(payAndDelData = null, firstLoad = false) {
|
||||
const clientRegion = document.getElementById("client_region").value;
|
||||
const deliveryRegion = document.getElementById("deliver_to_billingaddr").checked ? document.getElementById("delivery_region").value : clientRegion;
|
||||
|
||||
|
||||
|
||||
// Zmiana regionu
|
||||
const regionStatus = await this.fetchData({
|
||||
data: SET_REGION(`SetRegionInput: {
|
||||
@@ -1588,11 +1586,11 @@ async function validateAllInputs(){
|
||||
allGood = await validateRequest(document.getElementById("client_nip"), true) && allGood;
|
||||
}
|
||||
// Sprawdzenie reszty pól
|
||||
allGood = validateFormInputs("client") && allGood;
|
||||
allGood = await validateFormInputs("client") && allGood;
|
||||
}
|
||||
// Sprawdzanie pól dostawy na inny adres
|
||||
if(document.getElementById("deliver_to_billingaddr").checked){
|
||||
allGood = validateFormInputs("delivery") && allGood;
|
||||
allGood = await validateFormInputs("delivery") && allGood;
|
||||
allGood = validatePhone(document.getElementById("delivery_phone")) && allGood;
|
||||
}
|
||||
return allGood
|
||||
@@ -1612,12 +1610,13 @@ async function validateFormInputs(query){
|
||||
// Obsługa złożenia zamówienia
|
||||
const termsConditionsInput = document.getElementById("order2_terms_conditions");
|
||||
const cancelConditionsInput = document.getElementById("order2_cancel");
|
||||
document.querySelector(".order2_button_order").addEventListener("click", () => {
|
||||
document.querySelector(".order2_button_order").addEventListener("click", async () => {
|
||||
try {
|
||||
app_shop.fn.ajaxLoadSite(1);
|
||||
app_shop.vars.validation = 1;
|
||||
// Sprawdzenie pól formularza
|
||||
if(validateAllInputs() === false) app_shop.vars.validation = 0;
|
||||
const x = await validateAllInputs();
|
||||
if(x === false) app_shop.vars.validation = 0;
|
||||
|
||||
// Znalezienie obecnie zaznaczonej metody dostawy i płatności
|
||||
const deliveryMethod = document.querySelector(".ajax_cop [name=shipping]:checked");
|
||||
@@ -1678,7 +1677,7 @@ document.querySelector(".order2_button_order").addEventListener("click", () => {
|
||||
});
|
||||
// Przescrolluj do
|
||||
function scrollToHeight(scrollToEl){
|
||||
const yOffset = -45;
|
||||
const yOffset = app_shop.vars.view === 1 ? -100 : -45;
|
||||
const y = scrollToEl.getBoundingClientRect().top + window.pageYOffset + yOffset;
|
||||
window.scrollTo({top: y, behavior: 'smooth'});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user