Skip to content

Commit

Permalink
Remove phone mandatory in bancomatpay block checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaymo committed Apr 11, 2024
1 parent 025ba96 commit ba5f84b
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions resources/js/blocks/molliePaymentMethod.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,36 +191,6 @@ const MollieComponent = (props) => {

}, [activePaymentMethod, onCheckoutValidation, billing.billingData, shippingData.shippingAddress, item, phoneString, inputBirthdate, inputPhone]);

useEffect(() => {
let phoneLabel = getPhoneField()?.labels?.[0] ?? null;
if (!phoneLabel || phoneLabel.length === 0) {
return
}
if (activePaymentMethod === 'mollie_wc_gateway_bancomatpay') {
phoneLabel.innerText = item.phonePlaceholder
} else {
if (phoneString !== false) {
phoneLabel.innerText = phoneString
}
}
let isPhoneEmpty = (billing.billingData.phone === '' && shippingData.shippingAddress.phone === '') && inputPhone === '';
const unsubscribeProcessing = onCheckoutValidation(

() => {
if (activePaymentMethod === 'mollie_wc_gateway_bancomatpay' && isPhoneEmpty) {
return {
errorMessage: item.errorMessage,
};
}
}
);
return () => {
unsubscribeProcessing()
};

}, [activePaymentMethod, onCheckoutValidation, billing.billingData, shippingData.shippingAddress, item, phoneString, inputPhone]);


onSubmitLocal = onSubmit
const updateIssuer = ( changeEvent ) => {
selectIssuer( changeEvent.target.value )
Expand Down Expand Up @@ -269,16 +239,6 @@ const MollieComponent = (props) => {
return <>{fields}</>;
}

if (item.name === "mollie_wc_gateway_bancomatpay"){
let fields = [];
if (!isPhoneFieldVisible) {
const phoneField = item.phonePlaceholder ? item.phonePlaceholder : "Phone";
fields.push(fieldMarkup("billing-phone-bancomatpay", "tel", phoneField, updatePhone, inputPhone));
}

return <>{fields}</>;
}

return <div><p></p></div>
}

Expand Down

0 comments on commit ba5f84b

Please sign in to comment.