Ensemble mobile graisse 60/1 ALGI pour tonnelet 50 Kg chariot 2 roues - 07705501
Ensemble mobile graisse 60/1 ALGI pour tonnelet 50 Kg chariot 2 roues - 07705501
Livraison prévue sous sous 2 à 3 semaines
Ajouter au panier
Ajouter au devis
Livraison à partir de 18,00€
Livraison sur chantier ou à domicile sous 5 jours ouvrés.
Satisfait ou remboursé
14 jours pour changer d’avis, à compter de votre livraison.
Paiement en 3x sans frais
Paiement en ligne sécurisé en 3x41,28€, sans frais.
Description
Ensemble mobile de marque Algi spécialement conçu pour une distribution rapide, propre et efficace de graisse conditionnée sous forme de tonnelet 50 kg. {
if (isReady) {
this._placeQuestion();
}
this.isFormReadyToSubmit = false;
})
},
toggleFaqForm: function () {
this.isFormActive = !this.isFormActive;
this.formBtnText = this.isFormActive ? this.hideFormBtnText : this.showFormBtnText;
},
receiveCustomerData(data) {
this.isLoggedIn = !!(data.customer && data?.customer?.firstname);
this._getAmFaqSettingsData();
const faqData = data.faq;
if (faqData && faqData.name) {
this.userName = faqData.name;
this.userEmail = faqData.email;
}
},
submitQuestionForm() {
if (this.getCaptchaEnabled && this.isFaqFormToProtect && this.gcaptchaToken) {
this._verifyGrecaptcha(this.gcaptchaToken);
} else {
this.isFormReadyToSubmit = true;
}
},
getCaptchaToken(form) {
const tokenField = form.querySelector('.g-recaptcha-response');
this.gcaptchaToken = tokenField ? tokenField.value : '';
},
validateForm(input) {
const emails = input.value.split(/[\s\n\,]+/g);
for (let i = 0; i < emails.length; i++) {
if (!this.validateEmailsRegex.test(emails[i].trim())) {
this.isValid = false;
input.setCustomValidity('Please\u0020enter\u0020a\u0020valid\u0020email\u0020address\u0020\u0028Ex\u003A\u0020johndoe\u0040domain.com\u0029');
return false;
}
}
this.isValid = true;
input.setCustomValidity('');
return true;
},
closeAndClearForm() {
this.userQuestion = '';
this.isFormActive = false;
this.isNameFieldEnabled = false;
this.isEmailFieldEnabled = false;
this.formBtnText = this.showFormBtnText;
},
_checkIsAllowCaptcha() {
const faqFormSelector = 'form[action*="faq/index/save"]';
Array.from(this.allowedCaptchaForm.split(',')).forEach(formSelector => {
if (formSelector === faqFormSelector) {
this.isFaqFormToProtect = true;
}
})
},
_placeQuestion() {
const data = this._prepareMutationData();
this.isLoading = true;
this._useQuery(
this.queries.placeAmFaqQuestion, data
).then(result => {
/* show errros */
if (result?.errors) {
console.error(result);
result.errors.map(error => {
this._showMessage(error.message, 'error', 5000);
});
return result;
}
/* get data */
const message = result?.data?.placeAmFaqQuestion?.message;
const messageType = result?.data?.placeAmFaqQuestion?.error ? 'error' : 'success';
this._showMessage(message, messageType, 10000);
this.closeAndClearForm();
}).finally(() => {
this.isLoading = false;
this.$nextTick(() => {
this.$refs.formToggle.focus();
})
});
},
_verifyGrecaptcha(token) {
let url = this.verifyUrl;
let requestData = '?token=' + token;
fetch(url + requestData, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Requested-With': 'XMLHttpRequest'
},
})
.then(response => response.json())
.then(result => {
if (result?.success) {
if (result?.verification?.success) {
this.isFormReadyToSubmit = true;
} else {
this._showMessage(result?.verification?.error, 'error', 10000)
this.isFormReadyToSubmit = false;
}
} else {
console.error(result.error_message);
this._showMessage(result.error_message, 'error', 4000)
}
})
},
_showMessage(message, type, delay) {
dispatchMessages([{
type: type,
text: message
}], delay);
},
_prepareMutationData() {
let data = {
title: this.userQuestion,
name: this.userName,
email: this.isEmailFieldEnabled ? this.userEmail : ''
}
switch (this.additionalField.field) {
case fieldCategory:
data['category_id'] = parseInt(this.additionalField.value);
break;
case fieldProduct:
data['product_id'] = parseInt(this.additionalField.value);
break;
}
return data;
},
_getAmFaqSettingsData() {
this._useQuery(
this.queries.getAmFaqSettings
).then(result => {
if (result?.errors) {
console.error(result);
result.errors.map(error => {
this._showMessage(error.message, 'error', 5000);
});
return result;
}
this.formSettings = result?.data?.getAmFaqSettings;
this.isShowForm = !(!this.formSettings.isGuestQuestionsAllowed && !this.isLoggedIn);
});
},
_useQuery(query, variables) {
return fetch(BASE_URL + "graphql", {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Store': 'distriartisan'
},
credentials: 'include',
body: JSON.stringify({query: query, variables: variables}),
}).then(response => response.json()).catch(() => {
this._showMessage('Une erreur est survenue. Veuillez réessayer plus tard.', 'error', 5000);
})
},
recaptchaCallbackEvent() {
return this.getCaptchaToken(this.$el)
},
userQuestionChangeEvent() {
return this.userQuestion = this.$el.value
},
nameFieldChangeEvent() {
return this.isNameFieldEnabled = this.$el.value
},
userNameChangeEvent() {
return this.userName = this.$el.value
},
emailFieldEnabledChangeEvent() {
return this.isEmailFieldEnabled = this.isEmailFieldEnabled ? false : this.$el.value
},
userEmailChangeEvent() {
return this.userEmail = this.$el.value
},
gdprText() {
return this.formSettings.gdprConsentText
},
isNotShowFormSettings() {
return !this.isShowForm && this.formSettings
},
isShowFormSettings() {
return this.isShowForm && this.formSettings
},
isFormSettingsAndEnabledGdprConsent() {
return this.formSettings && this.formSettings.isEnableGdprConsent
},
isNameFieldEnabledORGdprConsentDisabled() {
return this.isNameFieldEnabled ||
(this.formSettings && !this.formSettings.isEnableGdprConsent)
},
isEmailFieldEnabledOrEnableGdprConsent() {
return (this.isEmailFieldEnabled && this.isNameFieldEnabled)
|| (this.formSettings && !this.formSettings.isEnableGdprConsent && this.isEmailFieldEnabled)
},
userEmailInputEvent(event) {
return this.validateForm(this.$event.target)
},
questionFieldName() {
return this.additionalField.field
},
privateContentLoaded(event) {
return this.receiveCustomerData(this.$event.detail.data)
},
questionFieldValue() {
return this.additionalField.value
}
}
}
window.addEventListener(
'alpine:init',
() => Alpine.data(
'faqQuestionsForm_6a3b1797b6c98',
faqQuestionsForm_6a3b1797b6c98 ),
{once: true}
);
Ensemble mobile graisse 60/1 ALGI pour tonnelet 50 Kg chariot 2 roues - 07705501
Ajouter au panier