How to override E:xampphtdocsmagevendormagentomodule-customerControllerAccount controller magento 2?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
1
down vote

favorite













Actually i am trying to override
E:xampphtdocsmagevendormagentomodule-customerControllerAccount
controller using custom module here i am trying to to override




$message = __(
'You did not sign in correctly or your account is temporarily disabled.'
);



this message




<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace MagentoCustomerControllerAccount;

use MagentoCustomerModelAccountRedirect as AccountRedirect;
use MagentoFrameworkAppActionContext;
use MagentoCustomerModelSession;
use MagentoCustomerApiAccountManagementInterface;
use MagentoCustomerModelUrl as CustomerUrl;
use MagentoFrameworkExceptionEmailNotConfirmedException;
use MagentoFrameworkExceptionAuthenticationException;
use MagentoFrameworkDataFormFormKeyValidator;
use MagentoFrameworkExceptionLocalizedException;
use MagentoFrameworkExceptionStateUserLockedException;
use MagentoFrameworkAppConfigScopeConfigInterface;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class LoginPost extends MagentoCustomerControllerAbstractAccount

/**
* @var MagentoCustomerApiAccountManagementInterface
*/
protected $customerAccountManagement;

/**
* @var MagentoFrameworkDataFormFormKeyValidator
*/
protected $formKeyValidator;

/**
* @var AccountRedirect
*/
protected $accountRedirect;

/**
* @var Session
*/
protected $session;

/**
* @var ScopeConfigInterface
*/
private $scopeConfig;

/**
* @var MagentoFrameworkStdlibCookieCookieMetadataFactory
*/
private $cookieMetadataFactory;

/**
* @var MagentoFrameworkStdlibCookiePhpCookieManager
*/
private $cookieMetadataManager;

/**
* @param Context $context
* @param Session $customerSession
* @param AccountManagementInterface $customerAccountManagement
* @param CustomerUrl $customerHelperData
* @param Validator $formKeyValidator
* @param AccountRedirect $accountRedirect
*/
public function __construct(
Context $context,
Session $customerSession,
AccountManagementInterface $customerAccountManagement,
CustomerUrl $customerHelperData,
Validator $formKeyValidator,
AccountRedirect $accountRedirect
)
$this->session = $customerSession;
$this->customerAccountManagement = $customerAccountManagement;
$this->customerUrl = $customerHelperData;
$this->formKeyValidator = $formKeyValidator;
$this->accountRedirect = $accountRedirect;
parent::__construct($context);


/**
* Get scope config
*
* @return ScopeConfigInterface
* @deprecated 100.0.10
*/
private function getScopeConfig()

if (!($this->scopeConfig instanceof MagentoFrameworkAppConfigScopeConfigInterface))
return MagentoFrameworkAppObjectManager::getInstance()->get(
MagentoFrameworkAppConfigScopeConfigInterface::class
);
else
return $this->scopeConfig;



/**
* Retrieve cookie manager
*
* @deprecated 100.1.0
* @return MagentoFrameworkStdlibCookiePhpCookieManager
*/
private function getCookieManager()

if (!$this->cookieMetadataManager)
$this->cookieMetadataManager = MagentoFrameworkAppObjectManager::getInstance()->get(
MagentoFrameworkStdlibCookiePhpCookieManager::class
);

return $this->cookieMetadataManager;


/**
* Retrieve cookie metadata factory
*
* @deprecated 100.1.0
* @return MagentoFrameworkStdlibCookieCookieMetadataFactory
*/
private function getCookieMetadataFactory()

if (!$this->cookieMetadataFactory)
$this->cookieMetadataFactory = MagentoFrameworkAppObjectManager::getInstance()->get(
MagentoFrameworkStdlibCookieCookieMetadataFactory::class
);

return $this->cookieMetadataFactory;


/**
* Login post action
*
* @return MagentoFrameworkControllerResultRedirect
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function execute()

if ($this->session->isLoggedIn()










share|improve this question























  • Are you facing any issue?
    – Rutvee Sojitra
    7 hours ago











  • i am trying to override this message ''You did not sign in correctly or your account is temporarily disabled.''
    – hitesh balpande
    6 hours ago






  • 1




    @hiteshbalpande instead of overriding class, you should use translation.
    – Ranjit Shinde
    6 hours ago
















up vote
1
down vote

favorite













Actually i am trying to override
E:xampphtdocsmagevendormagentomodule-customerControllerAccount
controller using custom module here i am trying to to override




$message = __(
'You did not sign in correctly or your account is temporarily disabled.'
);



this message




<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace MagentoCustomerControllerAccount;

use MagentoCustomerModelAccountRedirect as AccountRedirect;
use MagentoFrameworkAppActionContext;
use MagentoCustomerModelSession;
use MagentoCustomerApiAccountManagementInterface;
use MagentoCustomerModelUrl as CustomerUrl;
use MagentoFrameworkExceptionEmailNotConfirmedException;
use MagentoFrameworkExceptionAuthenticationException;
use MagentoFrameworkDataFormFormKeyValidator;
use MagentoFrameworkExceptionLocalizedException;
use MagentoFrameworkExceptionStateUserLockedException;
use MagentoFrameworkAppConfigScopeConfigInterface;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class LoginPost extends MagentoCustomerControllerAbstractAccount

/**
* @var MagentoCustomerApiAccountManagementInterface
*/
protected $customerAccountManagement;

/**
* @var MagentoFrameworkDataFormFormKeyValidator
*/
protected $formKeyValidator;

/**
* @var AccountRedirect
*/
protected $accountRedirect;

/**
* @var Session
*/
protected $session;

/**
* @var ScopeConfigInterface
*/
private $scopeConfig;

/**
* @var MagentoFrameworkStdlibCookieCookieMetadataFactory
*/
private $cookieMetadataFactory;

/**
* @var MagentoFrameworkStdlibCookiePhpCookieManager
*/
private $cookieMetadataManager;

/**
* @param Context $context
* @param Session $customerSession
* @param AccountManagementInterface $customerAccountManagement
* @param CustomerUrl $customerHelperData
* @param Validator $formKeyValidator
* @param AccountRedirect $accountRedirect
*/
public function __construct(
Context $context,
Session $customerSession,
AccountManagementInterface $customerAccountManagement,
CustomerUrl $customerHelperData,
Validator $formKeyValidator,
AccountRedirect $accountRedirect
)
$this->session = $customerSession;
$this->customerAccountManagement = $customerAccountManagement;
$this->customerUrl = $customerHelperData;
$this->formKeyValidator = $formKeyValidator;
$this->accountRedirect = $accountRedirect;
parent::__construct($context);


/**
* Get scope config
*
* @return ScopeConfigInterface
* @deprecated 100.0.10
*/
private function getScopeConfig()

if (!($this->scopeConfig instanceof MagentoFrameworkAppConfigScopeConfigInterface))
return MagentoFrameworkAppObjectManager::getInstance()->get(
MagentoFrameworkAppConfigScopeConfigInterface::class
);
else
return $this->scopeConfig;



/**
* Retrieve cookie manager
*
* @deprecated 100.1.0
* @return MagentoFrameworkStdlibCookiePhpCookieManager
*/
private function getCookieManager()

if (!$this->cookieMetadataManager)
$this->cookieMetadataManager = MagentoFrameworkAppObjectManager::getInstance()->get(
MagentoFrameworkStdlibCookiePhpCookieManager::class
);

return $this->cookieMetadataManager;


/**
* Retrieve cookie metadata factory
*
* @deprecated 100.1.0
* @return MagentoFrameworkStdlibCookieCookieMetadataFactory
*/
private function getCookieMetadataFactory()

if (!$this->cookieMetadataFactory)
$this->cookieMetadataFactory = MagentoFrameworkAppObjectManager::getInstance()->get(
MagentoFrameworkStdlibCookieCookieMetadataFactory::class
);

return $this->cookieMetadataFactory;


/**
* Login post action
*
* @return MagentoFrameworkControllerResultRedirect
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function execute()

if ($this->session->isLoggedIn()










share|improve this question























  • Are you facing any issue?
    – Rutvee Sojitra
    7 hours ago











  • i am trying to override this message ''You did not sign in correctly or your account is temporarily disabled.''
    – hitesh balpande
    6 hours ago






  • 1




    @hiteshbalpande instead of overriding class, you should use translation.
    – Ranjit Shinde
    6 hours ago












up vote
1
down vote

favorite









up vote
1
down vote

favorite












Actually i am trying to override
E:xampphtdocsmagevendormagentomodule-customerControllerAccount
controller using custom module here i am trying to to override




$message = __(
'You did not sign in correctly or your account is temporarily disabled.'
);



this message




<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace MagentoCustomerControllerAccount;

use MagentoCustomerModelAccountRedirect as AccountRedirect;
use MagentoFrameworkAppActionContext;
use MagentoCustomerModelSession;
use MagentoCustomerApiAccountManagementInterface;
use MagentoCustomerModelUrl as CustomerUrl;
use MagentoFrameworkExceptionEmailNotConfirmedException;
use MagentoFrameworkExceptionAuthenticationException;
use MagentoFrameworkDataFormFormKeyValidator;
use MagentoFrameworkExceptionLocalizedException;
use MagentoFrameworkExceptionStateUserLockedException;
use MagentoFrameworkAppConfigScopeConfigInterface;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class LoginPost extends MagentoCustomerControllerAbstractAccount

/**
* @var MagentoCustomerApiAccountManagementInterface
*/
protected $customerAccountManagement;

/**
* @var MagentoFrameworkDataFormFormKeyValidator
*/
protected $formKeyValidator;

/**
* @var AccountRedirect
*/
protected $accountRedirect;

/**
* @var Session
*/
protected $session;

/**
* @var ScopeConfigInterface
*/
private $scopeConfig;

/**
* @var MagentoFrameworkStdlibCookieCookieMetadataFactory
*/
private $cookieMetadataFactory;

/**
* @var MagentoFrameworkStdlibCookiePhpCookieManager
*/
private $cookieMetadataManager;

/**
* @param Context $context
* @param Session $customerSession
* @param AccountManagementInterface $customerAccountManagement
* @param CustomerUrl $customerHelperData
* @param Validator $formKeyValidator
* @param AccountRedirect $accountRedirect
*/
public function __construct(
Context $context,
Session $customerSession,
AccountManagementInterface $customerAccountManagement,
CustomerUrl $customerHelperData,
Validator $formKeyValidator,
AccountRedirect $accountRedirect
)
$this->session = $customerSession;
$this->customerAccountManagement = $customerAccountManagement;
$this->customerUrl = $customerHelperData;
$this->formKeyValidator = $formKeyValidator;
$this->accountRedirect = $accountRedirect;
parent::__construct($context);


/**
* Get scope config
*
* @return ScopeConfigInterface
* @deprecated 100.0.10
*/
private function getScopeConfig()

if (!($this->scopeConfig instanceof MagentoFrameworkAppConfigScopeConfigInterface))
return MagentoFrameworkAppObjectManager::getInstance()->get(
MagentoFrameworkAppConfigScopeConfigInterface::class
);
else
return $this->scopeConfig;



/**
* Retrieve cookie manager
*
* @deprecated 100.1.0
* @return MagentoFrameworkStdlibCookiePhpCookieManager
*/
private function getCookieManager()

if (!$this->cookieMetadataManager)
$this->cookieMetadataManager = MagentoFrameworkAppObjectManager::getInstance()->get(
MagentoFrameworkStdlibCookiePhpCookieManager::class
);

return $this->cookieMetadataManager;


/**
* Retrieve cookie metadata factory
*
* @deprecated 100.1.0
* @return MagentoFrameworkStdlibCookieCookieMetadataFactory
*/
private function getCookieMetadataFactory()

if (!$this->cookieMetadataFactory)
$this->cookieMetadataFactory = MagentoFrameworkAppObjectManager::getInstance()->get(
MagentoFrameworkStdlibCookieCookieMetadataFactory::class
);

return $this->cookieMetadataFactory;


/**
* Login post action
*
* @return MagentoFrameworkControllerResultRedirect
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function execute()

if ($this->session->isLoggedIn()










share|improve this question
















Actually i am trying to override
E:xampphtdocsmagevendormagentomodule-customerControllerAccount
controller using custom module here i am trying to to override




$message = __(
'You did not sign in correctly or your account is temporarily disabled.'
);



this message




<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace MagentoCustomerControllerAccount;

use MagentoCustomerModelAccountRedirect as AccountRedirect;
use MagentoFrameworkAppActionContext;
use MagentoCustomerModelSession;
use MagentoCustomerApiAccountManagementInterface;
use MagentoCustomerModelUrl as CustomerUrl;
use MagentoFrameworkExceptionEmailNotConfirmedException;
use MagentoFrameworkExceptionAuthenticationException;
use MagentoFrameworkDataFormFormKeyValidator;
use MagentoFrameworkExceptionLocalizedException;
use MagentoFrameworkExceptionStateUserLockedException;
use MagentoFrameworkAppConfigScopeConfigInterface;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class LoginPost extends MagentoCustomerControllerAbstractAccount

/**
* @var MagentoCustomerApiAccountManagementInterface
*/
protected $customerAccountManagement;

/**
* @var MagentoFrameworkDataFormFormKeyValidator
*/
protected $formKeyValidator;

/**
* @var AccountRedirect
*/
protected $accountRedirect;

/**
* @var Session
*/
protected $session;

/**
* @var ScopeConfigInterface
*/
private $scopeConfig;

/**
* @var MagentoFrameworkStdlibCookieCookieMetadataFactory
*/
private $cookieMetadataFactory;

/**
* @var MagentoFrameworkStdlibCookiePhpCookieManager
*/
private $cookieMetadataManager;

/**
* @param Context $context
* @param Session $customerSession
* @param AccountManagementInterface $customerAccountManagement
* @param CustomerUrl $customerHelperData
* @param Validator $formKeyValidator
* @param AccountRedirect $accountRedirect
*/
public function __construct(
Context $context,
Session $customerSession,
AccountManagementInterface $customerAccountManagement,
CustomerUrl $customerHelperData,
Validator $formKeyValidator,
AccountRedirect $accountRedirect
)
$this->session = $customerSession;
$this->customerAccountManagement = $customerAccountManagement;
$this->customerUrl = $customerHelperData;
$this->formKeyValidator = $formKeyValidator;
$this->accountRedirect = $accountRedirect;
parent::__construct($context);


/**
* Get scope config
*
* @return ScopeConfigInterface
* @deprecated 100.0.10
*/
private function getScopeConfig()

if (!($this->scopeConfig instanceof MagentoFrameworkAppConfigScopeConfigInterface))
return MagentoFrameworkAppObjectManager::getInstance()->get(
MagentoFrameworkAppConfigScopeConfigInterface::class
);
else
return $this->scopeConfig;



/**
* Retrieve cookie manager
*
* @deprecated 100.1.0
* @return MagentoFrameworkStdlibCookiePhpCookieManager
*/
private function getCookieManager()

if (!$this->cookieMetadataManager)
$this->cookieMetadataManager = MagentoFrameworkAppObjectManager::getInstance()->get(
MagentoFrameworkStdlibCookiePhpCookieManager::class
);

return $this->cookieMetadataManager;


/**
* Retrieve cookie metadata factory
*
* @deprecated 100.1.0
* @return MagentoFrameworkStdlibCookieCookieMetadataFactory
*/
private function getCookieMetadataFactory()

if (!$this->cookieMetadataFactory)
$this->cookieMetadataFactory = MagentoFrameworkAppObjectManager::getInstance()->get(
MagentoFrameworkStdlibCookieCookieMetadataFactory::class
);

return $this->cookieMetadataFactory;


/**
* Login post action
*
* @return MagentoFrameworkControllerResultRedirect
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function execute()

if ($this->session->isLoggedIn()







magento2 overrides customer-account






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 6 hours ago









mrfizh

5851421




5851421










asked 7 hours ago









hitesh balpande

1308




1308











  • Are you facing any issue?
    – Rutvee Sojitra
    7 hours ago











  • i am trying to override this message ''You did not sign in correctly or your account is temporarily disabled.''
    – hitesh balpande
    6 hours ago






  • 1




    @hiteshbalpande instead of overriding class, you should use translation.
    – Ranjit Shinde
    6 hours ago
















  • Are you facing any issue?
    – Rutvee Sojitra
    7 hours ago











  • i am trying to override this message ''You did not sign in correctly or your account is temporarily disabled.''
    – hitesh balpande
    6 hours ago






  • 1




    @hiteshbalpande instead of overriding class, you should use translation.
    – Ranjit Shinde
    6 hours ago















Are you facing any issue?
– Rutvee Sojitra
7 hours ago





Are you facing any issue?
– Rutvee Sojitra
7 hours ago













i am trying to override this message ''You did not sign in correctly or your account is temporarily disabled.''
– hitesh balpande
6 hours ago




i am trying to override this message ''You did not sign in correctly or your account is temporarily disabled.''
– hitesh balpande
6 hours ago




1




1




@hiteshbalpande instead of overriding class, you should use translation.
– Ranjit Shinde
6 hours ago




@hiteshbalpande instead of overriding class, you should use translation.
– Ranjit Shinde
6 hours ago










2 Answers
2






active

oldest

votes

















up vote
1
down vote



accepted










how about this :



in your di.xml



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoCustomerControllerAccountLoginPost" type="CompanyModuleControllerAccountLoginPost" />
</config>


and now you can customize the message :



<?php
namespace CompanyModuleControllerAccount;

use MagentoCustomerModelAccountRedirect as AccountRedirect;
use MagentoFrameworkAppActionContext;
use MagentoCustomerModelSession;
use MagentoCustomerApiAccountManagementInterface;
use MagentoCustomerModelUrl as CustomerUrl;
use MagentoFrameworkExceptionEmailNotConfirmedException;
use MagentoFrameworkExceptionAuthenticationException;
use MagentoFrameworkDataFormFormKeyValidator;
use MagentoFrameworkExceptionLocalizedException;
use MagentoFrameworkExceptionStateUserLockedException;
use MagentoFrameworkAppConfigScopeConfigInterface;

class LoginPost extends MagentoCustomerControllerAccountLoginPost


/**
* @var MagentoCustomerApiAccountManagementInterface
*/
protected $customerAccountManagement;

/**
* @var MagentoFrameworkDataFormFormKeyValidator
*/
protected $formKeyValidator;

/**
* @var AccountRedirect
*/
protected $accountRedirect;

/**
* @var Session
*/
protected $session;

/**
* @var ScopeConfigInterface
*/
private $scopeConfig;

/**
* @var MagentoFrameworkStdlibCookieCookieMetadataFactory
*/
private $cookieMetadataFactory;

/**
* @var MagentoFrameworkStdlibCookiePhpCookieManager
*/
private $cookieMetadataManager;

/**
* @param Context $context
* @param Session $customerSession
* @param AccountManagementInterface $customerAccountManagement
* @param CustomerUrl $customerHelperData
* @param Validator $formKeyValidator
* @param AccountRedirect $accountRedirect
*/
public function __construct(
Context $context,
Session $customerSession,
AccountManagementInterface $customerAccountManagement,
CustomerUrl $customerHelperData,
Validator $formKeyValidator,
AccountRedirect $accountRedirect
)
$this->session = $customerSession;
$this->customerAccountManagement = $customerAccountManagement;
$this->customerUrl = $customerHelperData;
$this->formKeyValidator = $formKeyValidator;
$this->accountRedirect = $accountRedirect;
parent::__construct($context);




/**
* Get scope config
*
* @return ScopeConfigInterface
* @deprecated 100.0.10
*/
private function getScopeConfig()

if (!($this->scopeConfig instanceof MagentoFrameworkAppConfigScopeConfigInterface))
return MagentoFrameworkAppObjectManager::getInstance()->get(
MagentoFrameworkAppConfigScopeConfigInterface::class
);
else
return $this->scopeConfig;



/**
* Retrieve cookie manager
*
* @deprecated 100.1.0
* @return MagentoFrameworkStdlibCookiePhpCookieManager
*/
private function getCookieManager()

if (!$this->cookieMetadataManager)
$this->cookieMetadataManager = MagentoFrameworkAppObjectManager::getInstance()->get(
MagentoFrameworkStdlibCookiePhpCookieManager::class
);

return $this->cookieMetadataManager;


/**
* Retrieve cookie metadata factory
*
* @deprecated 100.1.0
* @return MagentoFrameworkStdlibCookieCookieMetadataFactory
*/
private function getCookieMetadataFactory()

if (!$this->cookieMetadataFactory)
$this->cookieMetadataFactory = MagentoFrameworkAppObjectManager::getInstance()->get(
MagentoFrameworkStdlibCookieCookieMetadataFactory::class
);

return $this->cookieMetadataFactory;


/**
* Login post action
*
* @return MagentoFrameworkControllerResultRedirect
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function execute()

if ($this->session->isLoggedIn()






share|improve this answer




















  • Fatal error: Cannot declare class MagentoCustomerControllerAccountLoginPost, because the name is already in use in E:xampphtdocsmageappcodeInkindNavdataControllerAccountLoginPost.php on line 205 error is showing
    – hitesh balpande
    4 hours ago










  • I see so you already custom extension that override LoginPost.php Class, just remove my answer question, and go to app/code/Inkind/NavData/Controller/Account/LoginPost.php just change error message that you want.
    – mrfizh
    4 hours ago










  • ok i understand
    – hitesh balpande
    4 hours ago

















up vote
4
down vote













To change only error message you should use translations instead of file overriding.



You can add translations by creating csv file at following location



app/design/frontend/Vendorname/themename/i18n/en_US.csv



and change the message as you want.



"You did not sign in correctly or your account is temporarily disabled.","Your custom message."






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f246936%2fhow-to-override-e-xampp-htdocs-mage-vendor-magento-module-customer-controller-a%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    how about this :



    in your di.xml



    <?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="MagentoCustomerControllerAccountLoginPost" type="CompanyModuleControllerAccountLoginPost" />
    </config>


    and now you can customize the message :



    <?php
    namespace CompanyModuleControllerAccount;

    use MagentoCustomerModelAccountRedirect as AccountRedirect;
    use MagentoFrameworkAppActionContext;
    use MagentoCustomerModelSession;
    use MagentoCustomerApiAccountManagementInterface;
    use MagentoCustomerModelUrl as CustomerUrl;
    use MagentoFrameworkExceptionEmailNotConfirmedException;
    use MagentoFrameworkExceptionAuthenticationException;
    use MagentoFrameworkDataFormFormKeyValidator;
    use MagentoFrameworkExceptionLocalizedException;
    use MagentoFrameworkExceptionStateUserLockedException;
    use MagentoFrameworkAppConfigScopeConfigInterface;

    class LoginPost extends MagentoCustomerControllerAccountLoginPost


    /**
    * @var MagentoCustomerApiAccountManagementInterface
    */
    protected $customerAccountManagement;

    /**
    * @var MagentoFrameworkDataFormFormKeyValidator
    */
    protected $formKeyValidator;

    /**
    * @var AccountRedirect
    */
    protected $accountRedirect;

    /**
    * @var Session
    */
    protected $session;

    /**
    * @var ScopeConfigInterface
    */
    private $scopeConfig;

    /**
    * @var MagentoFrameworkStdlibCookieCookieMetadataFactory
    */
    private $cookieMetadataFactory;

    /**
    * @var MagentoFrameworkStdlibCookiePhpCookieManager
    */
    private $cookieMetadataManager;

    /**
    * @param Context $context
    * @param Session $customerSession
    * @param AccountManagementInterface $customerAccountManagement
    * @param CustomerUrl $customerHelperData
    * @param Validator $formKeyValidator
    * @param AccountRedirect $accountRedirect
    */
    public function __construct(
    Context $context,
    Session $customerSession,
    AccountManagementInterface $customerAccountManagement,
    CustomerUrl $customerHelperData,
    Validator $formKeyValidator,
    AccountRedirect $accountRedirect
    )
    $this->session = $customerSession;
    $this->customerAccountManagement = $customerAccountManagement;
    $this->customerUrl = $customerHelperData;
    $this->formKeyValidator = $formKeyValidator;
    $this->accountRedirect = $accountRedirect;
    parent::__construct($context);




    /**
    * Get scope config
    *
    * @return ScopeConfigInterface
    * @deprecated 100.0.10
    */
    private function getScopeConfig()

    if (!($this->scopeConfig instanceof MagentoFrameworkAppConfigScopeConfigInterface))
    return MagentoFrameworkAppObjectManager::getInstance()->get(
    MagentoFrameworkAppConfigScopeConfigInterface::class
    );
    else
    return $this->scopeConfig;



    /**
    * Retrieve cookie manager
    *
    * @deprecated 100.1.0
    * @return MagentoFrameworkStdlibCookiePhpCookieManager
    */
    private function getCookieManager()

    if (!$this->cookieMetadataManager)
    $this->cookieMetadataManager = MagentoFrameworkAppObjectManager::getInstance()->get(
    MagentoFrameworkStdlibCookiePhpCookieManager::class
    );

    return $this->cookieMetadataManager;


    /**
    * Retrieve cookie metadata factory
    *
    * @deprecated 100.1.0
    * @return MagentoFrameworkStdlibCookieCookieMetadataFactory
    */
    private function getCookieMetadataFactory()

    if (!$this->cookieMetadataFactory)
    $this->cookieMetadataFactory = MagentoFrameworkAppObjectManager::getInstance()->get(
    MagentoFrameworkStdlibCookieCookieMetadataFactory::class
    );

    return $this->cookieMetadataFactory;


    /**
    * Login post action
    *
    * @return MagentoFrameworkControllerResultRedirect
    * @SuppressWarnings(PHPMD.CyclomaticComplexity)
    */
    public function execute()

    if ($this->session->isLoggedIn()






    share|improve this answer




















    • Fatal error: Cannot declare class MagentoCustomerControllerAccountLoginPost, because the name is already in use in E:xampphtdocsmageappcodeInkindNavdataControllerAccountLoginPost.php on line 205 error is showing
      – hitesh balpande
      4 hours ago










    • I see so you already custom extension that override LoginPost.php Class, just remove my answer question, and go to app/code/Inkind/NavData/Controller/Account/LoginPost.php just change error message that you want.
      – mrfizh
      4 hours ago










    • ok i understand
      – hitesh balpande
      4 hours ago














    up vote
    1
    down vote



    accepted










    how about this :



    in your di.xml



    <?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="MagentoCustomerControllerAccountLoginPost" type="CompanyModuleControllerAccountLoginPost" />
    </config>


    and now you can customize the message :



    <?php
    namespace CompanyModuleControllerAccount;

    use MagentoCustomerModelAccountRedirect as AccountRedirect;
    use MagentoFrameworkAppActionContext;
    use MagentoCustomerModelSession;
    use MagentoCustomerApiAccountManagementInterface;
    use MagentoCustomerModelUrl as CustomerUrl;
    use MagentoFrameworkExceptionEmailNotConfirmedException;
    use MagentoFrameworkExceptionAuthenticationException;
    use MagentoFrameworkDataFormFormKeyValidator;
    use MagentoFrameworkExceptionLocalizedException;
    use MagentoFrameworkExceptionStateUserLockedException;
    use MagentoFrameworkAppConfigScopeConfigInterface;

    class LoginPost extends MagentoCustomerControllerAccountLoginPost


    /**
    * @var MagentoCustomerApiAccountManagementInterface
    */
    protected $customerAccountManagement;

    /**
    * @var MagentoFrameworkDataFormFormKeyValidator
    */
    protected $formKeyValidator;

    /**
    * @var AccountRedirect
    */
    protected $accountRedirect;

    /**
    * @var Session
    */
    protected $session;

    /**
    * @var ScopeConfigInterface
    */
    private $scopeConfig;

    /**
    * @var MagentoFrameworkStdlibCookieCookieMetadataFactory
    */
    private $cookieMetadataFactory;

    /**
    * @var MagentoFrameworkStdlibCookiePhpCookieManager
    */
    private $cookieMetadataManager;

    /**
    * @param Context $context
    * @param Session $customerSession
    * @param AccountManagementInterface $customerAccountManagement
    * @param CustomerUrl $customerHelperData
    * @param Validator $formKeyValidator
    * @param AccountRedirect $accountRedirect
    */
    public function __construct(
    Context $context,
    Session $customerSession,
    AccountManagementInterface $customerAccountManagement,
    CustomerUrl $customerHelperData,
    Validator $formKeyValidator,
    AccountRedirect $accountRedirect
    )
    $this->session = $customerSession;
    $this->customerAccountManagement = $customerAccountManagement;
    $this->customerUrl = $customerHelperData;
    $this->formKeyValidator = $formKeyValidator;
    $this->accountRedirect = $accountRedirect;
    parent::__construct($context);




    /**
    * Get scope config
    *
    * @return ScopeConfigInterface
    * @deprecated 100.0.10
    */
    private function getScopeConfig()

    if (!($this->scopeConfig instanceof MagentoFrameworkAppConfigScopeConfigInterface))
    return MagentoFrameworkAppObjectManager::getInstance()->get(
    MagentoFrameworkAppConfigScopeConfigInterface::class
    );
    else
    return $this->scopeConfig;



    /**
    * Retrieve cookie manager
    *
    * @deprecated 100.1.0
    * @return MagentoFrameworkStdlibCookiePhpCookieManager
    */
    private function getCookieManager()

    if (!$this->cookieMetadataManager)
    $this->cookieMetadataManager = MagentoFrameworkAppObjectManager::getInstance()->get(
    MagentoFrameworkStdlibCookiePhpCookieManager::class
    );

    return $this->cookieMetadataManager;


    /**
    * Retrieve cookie metadata factory
    *
    * @deprecated 100.1.0
    * @return MagentoFrameworkStdlibCookieCookieMetadataFactory
    */
    private function getCookieMetadataFactory()

    if (!$this->cookieMetadataFactory)
    $this->cookieMetadataFactory = MagentoFrameworkAppObjectManager::getInstance()->get(
    MagentoFrameworkStdlibCookieCookieMetadataFactory::class
    );

    return $this->cookieMetadataFactory;


    /**
    * Login post action
    *
    * @return MagentoFrameworkControllerResultRedirect
    * @SuppressWarnings(PHPMD.CyclomaticComplexity)
    */
    public function execute()

    if ($this->session->isLoggedIn()






    share|improve this answer




















    • Fatal error: Cannot declare class MagentoCustomerControllerAccountLoginPost, because the name is already in use in E:xampphtdocsmageappcodeInkindNavdataControllerAccountLoginPost.php on line 205 error is showing
      – hitesh balpande
      4 hours ago










    • I see so you already custom extension that override LoginPost.php Class, just remove my answer question, and go to app/code/Inkind/NavData/Controller/Account/LoginPost.php just change error message that you want.
      – mrfizh
      4 hours ago










    • ok i understand
      – hitesh balpande
      4 hours ago












    up vote
    1
    down vote



    accepted







    up vote
    1
    down vote



    accepted






    how about this :



    in your di.xml



    <?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="MagentoCustomerControllerAccountLoginPost" type="CompanyModuleControllerAccountLoginPost" />
    </config>


    and now you can customize the message :



    <?php
    namespace CompanyModuleControllerAccount;

    use MagentoCustomerModelAccountRedirect as AccountRedirect;
    use MagentoFrameworkAppActionContext;
    use MagentoCustomerModelSession;
    use MagentoCustomerApiAccountManagementInterface;
    use MagentoCustomerModelUrl as CustomerUrl;
    use MagentoFrameworkExceptionEmailNotConfirmedException;
    use MagentoFrameworkExceptionAuthenticationException;
    use MagentoFrameworkDataFormFormKeyValidator;
    use MagentoFrameworkExceptionLocalizedException;
    use MagentoFrameworkExceptionStateUserLockedException;
    use MagentoFrameworkAppConfigScopeConfigInterface;

    class LoginPost extends MagentoCustomerControllerAccountLoginPost


    /**
    * @var MagentoCustomerApiAccountManagementInterface
    */
    protected $customerAccountManagement;

    /**
    * @var MagentoFrameworkDataFormFormKeyValidator
    */
    protected $formKeyValidator;

    /**
    * @var AccountRedirect
    */
    protected $accountRedirect;

    /**
    * @var Session
    */
    protected $session;

    /**
    * @var ScopeConfigInterface
    */
    private $scopeConfig;

    /**
    * @var MagentoFrameworkStdlibCookieCookieMetadataFactory
    */
    private $cookieMetadataFactory;

    /**
    * @var MagentoFrameworkStdlibCookiePhpCookieManager
    */
    private $cookieMetadataManager;

    /**
    * @param Context $context
    * @param Session $customerSession
    * @param AccountManagementInterface $customerAccountManagement
    * @param CustomerUrl $customerHelperData
    * @param Validator $formKeyValidator
    * @param AccountRedirect $accountRedirect
    */
    public function __construct(
    Context $context,
    Session $customerSession,
    AccountManagementInterface $customerAccountManagement,
    CustomerUrl $customerHelperData,
    Validator $formKeyValidator,
    AccountRedirect $accountRedirect
    )
    $this->session = $customerSession;
    $this->customerAccountManagement = $customerAccountManagement;
    $this->customerUrl = $customerHelperData;
    $this->formKeyValidator = $formKeyValidator;
    $this->accountRedirect = $accountRedirect;
    parent::__construct($context);




    /**
    * Get scope config
    *
    * @return ScopeConfigInterface
    * @deprecated 100.0.10
    */
    private function getScopeConfig()

    if (!($this->scopeConfig instanceof MagentoFrameworkAppConfigScopeConfigInterface))
    return MagentoFrameworkAppObjectManager::getInstance()->get(
    MagentoFrameworkAppConfigScopeConfigInterface::class
    );
    else
    return $this->scopeConfig;



    /**
    * Retrieve cookie manager
    *
    * @deprecated 100.1.0
    * @return MagentoFrameworkStdlibCookiePhpCookieManager
    */
    private function getCookieManager()

    if (!$this->cookieMetadataManager)
    $this->cookieMetadataManager = MagentoFrameworkAppObjectManager::getInstance()->get(
    MagentoFrameworkStdlibCookiePhpCookieManager::class
    );

    return $this->cookieMetadataManager;


    /**
    * Retrieve cookie metadata factory
    *
    * @deprecated 100.1.0
    * @return MagentoFrameworkStdlibCookieCookieMetadataFactory
    */
    private function getCookieMetadataFactory()

    if (!$this->cookieMetadataFactory)
    $this->cookieMetadataFactory = MagentoFrameworkAppObjectManager::getInstance()->get(
    MagentoFrameworkStdlibCookieCookieMetadataFactory::class
    );

    return $this->cookieMetadataFactory;


    /**
    * Login post action
    *
    * @return MagentoFrameworkControllerResultRedirect
    * @SuppressWarnings(PHPMD.CyclomaticComplexity)
    */
    public function execute()

    if ($this->session->isLoggedIn()






    share|improve this answer












    how about this :



    in your di.xml



    <?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="MagentoCustomerControllerAccountLoginPost" type="CompanyModuleControllerAccountLoginPost" />
    </config>


    and now you can customize the message :



    <?php
    namespace CompanyModuleControllerAccount;

    use MagentoCustomerModelAccountRedirect as AccountRedirect;
    use MagentoFrameworkAppActionContext;
    use MagentoCustomerModelSession;
    use MagentoCustomerApiAccountManagementInterface;
    use MagentoCustomerModelUrl as CustomerUrl;
    use MagentoFrameworkExceptionEmailNotConfirmedException;
    use MagentoFrameworkExceptionAuthenticationException;
    use MagentoFrameworkDataFormFormKeyValidator;
    use MagentoFrameworkExceptionLocalizedException;
    use MagentoFrameworkExceptionStateUserLockedException;
    use MagentoFrameworkAppConfigScopeConfigInterface;

    class LoginPost extends MagentoCustomerControllerAccountLoginPost


    /**
    * @var MagentoCustomerApiAccountManagementInterface
    */
    protected $customerAccountManagement;

    /**
    * @var MagentoFrameworkDataFormFormKeyValidator
    */
    protected $formKeyValidator;

    /**
    * @var AccountRedirect
    */
    protected $accountRedirect;

    /**
    * @var Session
    */
    protected $session;

    /**
    * @var ScopeConfigInterface
    */
    private $scopeConfig;

    /**
    * @var MagentoFrameworkStdlibCookieCookieMetadataFactory
    */
    private $cookieMetadataFactory;

    /**
    * @var MagentoFrameworkStdlibCookiePhpCookieManager
    */
    private $cookieMetadataManager;

    /**
    * @param Context $context
    * @param Session $customerSession
    * @param AccountManagementInterface $customerAccountManagement
    * @param CustomerUrl $customerHelperData
    * @param Validator $formKeyValidator
    * @param AccountRedirect $accountRedirect
    */
    public function __construct(
    Context $context,
    Session $customerSession,
    AccountManagementInterface $customerAccountManagement,
    CustomerUrl $customerHelperData,
    Validator $formKeyValidator,
    AccountRedirect $accountRedirect
    )
    $this->session = $customerSession;
    $this->customerAccountManagement = $customerAccountManagement;
    $this->customerUrl = $customerHelperData;
    $this->formKeyValidator = $formKeyValidator;
    $this->accountRedirect = $accountRedirect;
    parent::__construct($context);




    /**
    * Get scope config
    *
    * @return ScopeConfigInterface
    * @deprecated 100.0.10
    */
    private function getScopeConfig()

    if (!($this->scopeConfig instanceof MagentoFrameworkAppConfigScopeConfigInterface))
    return MagentoFrameworkAppObjectManager::getInstance()->get(
    MagentoFrameworkAppConfigScopeConfigInterface::class
    );
    else
    return $this->scopeConfig;



    /**
    * Retrieve cookie manager
    *
    * @deprecated 100.1.0
    * @return MagentoFrameworkStdlibCookiePhpCookieManager
    */
    private function getCookieManager()

    if (!$this->cookieMetadataManager)
    $this->cookieMetadataManager = MagentoFrameworkAppObjectManager::getInstance()->get(
    MagentoFrameworkStdlibCookiePhpCookieManager::class
    );

    return $this->cookieMetadataManager;


    /**
    * Retrieve cookie metadata factory
    *
    * @deprecated 100.1.0
    * @return MagentoFrameworkStdlibCookieCookieMetadataFactory
    */
    private function getCookieMetadataFactory()

    if (!$this->cookieMetadataFactory)
    $this->cookieMetadataFactory = MagentoFrameworkAppObjectManager::getInstance()->get(
    MagentoFrameworkStdlibCookieCookieMetadataFactory::class
    );

    return $this->cookieMetadataFactory;


    /**
    * Login post action
    *
    * @return MagentoFrameworkControllerResultRedirect
    * @SuppressWarnings(PHPMD.CyclomaticComplexity)
    */
    public function execute()

    if ($this->session->isLoggedIn()







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 6 hours ago









    mrfizh

    5851421




    5851421











    • Fatal error: Cannot declare class MagentoCustomerControllerAccountLoginPost, because the name is already in use in E:xampphtdocsmageappcodeInkindNavdataControllerAccountLoginPost.php on line 205 error is showing
      – hitesh balpande
      4 hours ago










    • I see so you already custom extension that override LoginPost.php Class, just remove my answer question, and go to app/code/Inkind/NavData/Controller/Account/LoginPost.php just change error message that you want.
      – mrfizh
      4 hours ago










    • ok i understand
      – hitesh balpande
      4 hours ago
















    • Fatal error: Cannot declare class MagentoCustomerControllerAccountLoginPost, because the name is already in use in E:xampphtdocsmageappcodeInkindNavdataControllerAccountLoginPost.php on line 205 error is showing
      – hitesh balpande
      4 hours ago










    • I see so you already custom extension that override LoginPost.php Class, just remove my answer question, and go to app/code/Inkind/NavData/Controller/Account/LoginPost.php just change error message that you want.
      – mrfizh
      4 hours ago










    • ok i understand
      – hitesh balpande
      4 hours ago















    Fatal error: Cannot declare class MagentoCustomerControllerAccountLoginPost, because the name is already in use in E:xampphtdocsmageappcodeInkindNavdataControllerAccountLoginPost.php on line 205 error is showing
    – hitesh balpande
    4 hours ago




    Fatal error: Cannot declare class MagentoCustomerControllerAccountLoginPost, because the name is already in use in E:xampphtdocsmageappcodeInkindNavdataControllerAccountLoginPost.php on line 205 error is showing
    – hitesh balpande
    4 hours ago












    I see so you already custom extension that override LoginPost.php Class, just remove my answer question, and go to app/code/Inkind/NavData/Controller/Account/LoginPost.php just change error message that you want.
    – mrfizh
    4 hours ago




    I see so you already custom extension that override LoginPost.php Class, just remove my answer question, and go to app/code/Inkind/NavData/Controller/Account/LoginPost.php just change error message that you want.
    – mrfizh
    4 hours ago












    ok i understand
    – hitesh balpande
    4 hours ago




    ok i understand
    – hitesh balpande
    4 hours ago












    up vote
    4
    down vote













    To change only error message you should use translations instead of file overriding.



    You can add translations by creating csv file at following location



    app/design/frontend/Vendorname/themename/i18n/en_US.csv



    and change the message as you want.



    "You did not sign in correctly or your account is temporarily disabled.","Your custom message."






    share|improve this answer
























      up vote
      4
      down vote













      To change only error message you should use translations instead of file overriding.



      You can add translations by creating csv file at following location



      app/design/frontend/Vendorname/themename/i18n/en_US.csv



      and change the message as you want.



      "You did not sign in correctly or your account is temporarily disabled.","Your custom message."






      share|improve this answer






















        up vote
        4
        down vote










        up vote
        4
        down vote









        To change only error message you should use translations instead of file overriding.



        You can add translations by creating csv file at following location



        app/design/frontend/Vendorname/themename/i18n/en_US.csv



        and change the message as you want.



        "You did not sign in correctly or your account is temporarily disabled.","Your custom message."






        share|improve this answer












        To change only error message you should use translations instead of file overriding.



        You can add translations by creating csv file at following location



        app/design/frontend/Vendorname/themename/i18n/en_US.csv



        and change the message as you want.



        "You did not sign in correctly or your account is temporarily disabled.","Your custom message."







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 6 hours ago









        Ranjit Shinde

        348316




        348316



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f246936%2fhow-to-override-e-xampp-htdocs-mage-vendor-magento-module-customer-controller-a%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            What does second last employer means? [closed]

            List of Gilmore Girls characters

            One-line joke