0

I want to add A custom Amasty Social login to my login page because I want a different layout of the login form meaning I want to insert it inside my form. But I cant figure out how. maybe because I am using amasty social login lite?

This is my XML file for the login page.

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <title>Customer Login</title>
    </head>
    <body>
        <referenceContainer name="content">
            <!-- customer.form.login.extra -->
            <container name="customer.login.container" label="Customer Login Container" htmlTag="div" htmlClass="login-container">
                <block class="Amasty\SocialLogin\Block\Social" name="amsociallogin-social-above_login" template="Amasty_SocialLogin::social.phtml" />
                <block class="Magento\Customer\Block\Form\Login" name="customer_form_login" template="Magento_Customer::form/login.phtml">
                    <container name="form.additional.info" as="form_additional_info"/>
                    <arguments>
                        <argument name="login_button_view_model" xsi:type="object">Magento\Customer\ViewModel\LoginButton</argument>
                    </arguments>
                </block>
                <block class="Magento\Customer\Block\Form\Login\Info" name="customer.new" template="Magento_Customer::newcustomer.phtml"/>
            </container>
            <block class="Magento\Cookie\Block\RequireCookie" name="require-cookie" template="Magento_Cookie::require_cookie.phtml">
                <arguments>
                    <argument name="triggers" xsi:type="array">
                        <item name="loginButton" xsi:type="string">.action.login</item>
                    </argument>
                </arguments>
            </block>
        </referenceContainer>
        <referenceContainer name="form.additional.info">
            <block class="Magento\Framework\View\Element\Template" name="form_additional_info_customer" template="Magento_Customer::additionalinfocustomer.phtml"/>
        </referenceContainer>
    </body>
</page>

This is my phtml

<div class="block block-customer-login">
    <div class="topheader-button">
        <div class="signin-button">
            <p><?= $block->escapeHtml(__('SIGN IN')) ?></p>
        </div>
        <div class="register-button"><a href="/customer/account/create/"><span><?= $block->escapeHtml(__('REGISTER')) ?></span></a></div>
    </div>
    <?= $block->getChildHtml('amsociallogin-social-above_login'); ?>
    <div class="block-content" aria-labelledby="block-customer-login-heading">
        <form class="form form-login" action="<?= $block->escapeUrl($block->getPostActionUrl()) ?>" method="post" id="login-form" data-mage-init='{"validation":{}}'>
            <?= $block->getBlockHtml('formkey') ?>
            <fieldset class="fieldset login" data-hasrequired="<?= $block->escapeHtml(__('* Required Fields')) ?>">
                <div class="field note"><?= $block->escapeHtml(__('Log into your Al-Ikhsan Sports account. If you don’t have one, you will be prompted to create one.')) ?></div>
                <div class="field email required">
                    <label class="label" for="email"><span><?= $block->escapeHtml(__('Email')) ?></span></label>
                    <div class="control">
                        <input name="login[username]" value="<?= $block->escapeHtmlAttr($block->getUsername()) ?>" <?php if ($block->isAutocompleteDisabled()) : ?> autocomplete="off" <?php endif; ?> id="email" type="email" class="input-text" title="<?= $block->escapeHtmlAttr(__('Email')) ?>" data-mage-init='{"mage/trim-input":{}}' data-validate="{required:true, 'validate-email':true}">
                    </div>
                </div>
                <div class="field password required">
                    <label for="pass" class="label"><span><?= $block->escapeHtml(__('Password')) ?></span></label>
                    <div class="control">
                        <input name="login[password]" type="password" <?php if ($block->isAutocompleteDisabled()) : ?> autocomplete="off" <?php endif; ?> class="input-text" id="pass" title="<?= $block->escapeHtmlAttr(__('Password')) ?>" data-validate="{required:true}">
                    </div>
                </div>
                <?= $block->getChildHtml('form_additional_info') ?>
                <div class="login-action">
                    <div class="dynamic-btn">
                        <button type="submit" name="send" id="send2"><span><?= $block->escapeHtml(__('Sign In')) ?></span></button>
                    </div>
                    <div class="bottomloginremember">
                        <div class="field choice persistent">
                            <input type="checkbox" name="persistent_remember_me" class="checkbox" id="remember_me" title="<?= $block->escapeHtmlAttr(__('Remember Me')) ?>" value="1" checked="checked" />
                            <label for="remember_me" class="label"><span><?= $block->escapeHtml(__('Remember Me')) ?></span></label>
                        </div>
                        <div class="forgot-password"><a href="<?= $block->escapeUrl($block->getForgotPasswordUrl()) ?>"><span><?= $block->escapeHtml(__('Forgot Your Password?')) ?></span></a></div>
                    </div>
                </div>
            </fieldset>
        </form>
        <div class="bottom-login">
            <div class="bottom-section">
                <div class="bottom-divider">
                </div>
                <div><?= $block->escapeHtml(__('OR')) ?></div>
                <div class="bottom-divider">
                </div>
            </div>
            <div class="bottom-section">
                <div><?= $block->escapeHtml(__('Continue with other social media account')) ?></div>
            </div>
        </div>
    </div>
    <script type="text/x-magento-init">
        {
            "*": {
                "Magento_Customer/js/block-submit-on-send": {
                    "formId": "login-form"
                }
            }
        }
    </script>
</div>

As you can see I want to put the block at the page getChildHtml('amsociallogin-social-above_login'); ?>. in the end it just doesnt show anything I assume because the xml cant be detected and i dont know how do i do it. hope someone can show me how to do it properly.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.