Hey there,
I am wondering how I can remove the address mail field for a checkout as a guest.
Solved! Go to Solution.
ok so I managed to hide the fields by adding /app/code/{Vendor}/{Module}/view/frontend/layout/checkout_index_index.xml :
<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.root"> <arguments> <argument name="jsLayout" xsi:type="array"> <item name="components" xsi:type="array"> <item name="checkout" xsi:type="array"> <item name="children" xsi:type="array"> <item name="steps" xsi:type="array"> <item name="children" xsi:type="array"> <item name="shipping-step" xsi:type="array"> <item name="children" xsi:type="array"> <item name="shippingAddress" xsi:type="array"> <item name="children" xsi:type="array"> <item name="customer-email" xsi:type="array"> <item name="componentDisabled" xsi:type="boolean">true</item> </item> </item> </item> </item> </item> </item> </item> </item> </item> </item> </argument> </arguments> </referenceBlock> </body> </page>
But I cannot validate the form, it seems that the mail address is still required.
I managed to extend the shipping.js file and add a custom address if customer is not logged in
if (!customer.isLoggedIn()) {
quote.guestEmail = 'mail@example.com';
}
Hello @anthonyalb38ed,
What you actually mean here mail Id or residential address for removal as if guest checkout?
If my answer is helpful, then hit kudos and accept as solution
Best regards
Madhuresan
Hey @madhuresan_ramanan, thank you for answering back.
I am sorry if I was not clear.
What I would like to do is to remove/hide the login form in the checkout page, the one above the address form, so customers can order without bothering with providing email address.
(orders will be made and delivered at the actual store place so we don't need to ask for email)
ok so I managed to hide the fields by adding /app/code/{Vendor}/{Module}/view/frontend/layout/checkout_index_index.xml :
<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.root"> <arguments> <argument name="jsLayout" xsi:type="array"> <item name="components" xsi:type="array"> <item name="checkout" xsi:type="array"> <item name="children" xsi:type="array"> <item name="steps" xsi:type="array"> <item name="children" xsi:type="array"> <item name="shipping-step" xsi:type="array"> <item name="children" xsi:type="array"> <item name="shippingAddress" xsi:type="array"> <item name="children" xsi:type="array"> <item name="customer-email" xsi:type="array"> <item name="componentDisabled" xsi:type="boolean">true</item> </item> </item> </item> </item> </item> </item> </item> </item> </item> </item> </argument> </arguments> </referenceBlock> </body> </page>
But I cannot validate the form, it seems that the mail address is still required.