Skip to main content
Rollback to Revision 1 - Edit approval overridden by post owner or moderator
Source Link
Edwin Widhiyanto
  • 856
  • 1
  • 15
  • 41
  • I tried to show a popup message when customer tried to login. I add some code in LoginPost.php like in code below but it's not work.

I tried to show a popup message when customer tried to login. I add some code in LoginPost.php like in code below but it's not work.

LoginPost.php :

try {
      echo "  <script type='text/javascript'>
              alert('adadasd'); //This code i tried to popup a message
              </script>";

            $customer = $this->customerAccountManagement->authenticate($jsonObject[0]->EMAILOWNER, $jsonObject[0]->PASSWORDOWNER);
            $this->session->setCustomerDataAsLoggedIn($customer);
            $this->session->regenerateId();
            setcookie("Role", $jsonObject[0]->ROLE, time() + (86400 * 30), "/");
            if ($this->getCookieManager()->getCookie('mage-cache-sessid')) {
             $metadata = $this->getCookieMetadataFactory()->createCookieMetadata();
             $metadata->setPath('/');
             $this->getCookieManager()->deleteCookie('mage-cache-sessid', $metadata);
            }
    }

How can i show a popup there? So the login will not continue before the customer click the popup message?

  • I tried to show a popup message when customer tried to login. I add some code in LoginPost.php like in code below but it's not work.

LoginPost.php :

try {
      echo "  <script type='text/javascript'>
              alert('adadasd'); //This code i tried to popup a message
              </script>";

            $customer = $this->customerAccountManagement->authenticate($jsonObject[0]->EMAILOWNER, $jsonObject[0]->PASSWORDOWNER);
            $this->session->setCustomerDataAsLoggedIn($customer);
            $this->session->regenerateId();
            setcookie("Role", $jsonObject[0]->ROLE, time() + (86400 * 30), "/");
            if ($this->getCookieManager()->getCookie('mage-cache-sessid')) {
             $metadata = $this->getCookieMetadataFactory()->createCookieMetadata();
             $metadata->setPath('/');
             $this->getCookieManager()->deleteCookie('mage-cache-sessid', $metadata);
            }
    }

How can i show a popup there? So the login will not continue before the customer click the popup message?

I tried to show a popup message when customer tried to login. I add some code in LoginPost.php like in code below but it's not work.

LoginPost.php :

try {
      echo "  <script type='text/javascript'>
              alert('adadasd'); //This code i tried to popup a message
              </script>";

      $customer = $this->customerAccountManagement->authenticate($jsonObject[0]->EMAILOWNER, $jsonObject[0]->PASSWORDOWNER);
      $this->session->setCustomerDataAsLoggedIn($customer);
      $this->session->regenerateId();
      setcookie("Role", $jsonObject[0]->ROLE, time() + (86400 * 30), "/");
      if ($this->getCookieManager()->getCookie('mage-cache-sessid')) {
         $metadata = $this->getCookieMetadataFactory()->createCookieMetadata();
         $metadata->setPath('/');
         $this->getCookieManager()->deleteCookie('mage-cache-sessid', $metadata);
      }

How can i show a popup there? So the login will not continue before the customer click the popup message?

I tried to show a popup message when customer tried to login. I add some code in LoginPost.php like in code below but it's not work.

  • I tried to show a popup message when customer tried to login. I add some code in LoginPost.php like in code below but it's not work.

LoginPost.php :

try {
      echo "  <script type='text/javascript'>
              alert('adadasd'); //This code i tried to popup a message
              </script>";

            $customer = $this->customerAccountManagement->authenticate($jsonObject[0]->EMAILOWNER, $jsonObject[0]->PASSWORDOWNER);
            $this->session->setCustomerDataAsLoggedIn($customer);
            $this->session->regenerateId();
            setcookie("Role", $jsonObject[0]->ROLE, time() + (86400 * 30), "/");
            if ($this->getCookieManager()->getCookie('mage-cache-sessid')) {
             $metadata = $this->getCookieMetadataFactory()->createCookieMetadata();
             $metadata->setPath('/');
             $this->getCookieManager()->deleteCookie('mage-cache-sessid', $metadata);
            }
    }

How can i show a popup there? So the login will not continue before the customer click the popup message?

I tried to show a popup message when customer tried to login. I add some code in LoginPost.php like in code below but it's not work.

LoginPost.php :

try {
      echo "  <script type='text/javascript'>
              alert('adadasd'); //This code i tried to popup a message
              </script>";

      $customer = $this->customerAccountManagement->authenticate($jsonObject[0]->EMAILOWNER, $jsonObject[0]->PASSWORDOWNER);
      $this->session->setCustomerDataAsLoggedIn($customer);
      $this->session->regenerateId();
      setcookie("Role", $jsonObject[0]->ROLE, time() + (86400 * 30), "/");
      if ($this->getCookieManager()->getCookie('mage-cache-sessid')) {
         $metadata = $this->getCookieMetadataFactory()->createCookieMetadata();
         $metadata->setPath('/');
         $this->getCookieManager()->deleteCookie('mage-cache-sessid', $metadata);
      }

How can i show a popup there? So the login will not continue before the customer click the popup message?

  • I tried to show a popup message when customer tried to login. I add some code in LoginPost.php like in code below but it's not work.

LoginPost.php :

try {
      echo "  <script type='text/javascript'>
              alert('adadasd'); //This code i tried to popup a message
              </script>";

            $customer = $this->customerAccountManagement->authenticate($jsonObject[0]->EMAILOWNER, $jsonObject[0]->PASSWORDOWNER);
            $this->session->setCustomerDataAsLoggedIn($customer);
            $this->session->regenerateId();
            setcookie("Role", $jsonObject[0]->ROLE, time() + (86400 * 30), "/");
            if ($this->getCookieManager()->getCookie('mage-cache-sessid')) {
             $metadata = $this->getCookieMetadataFactory()->createCookieMetadata();
             $metadata->setPath('/');
             $this->getCookieManager()->deleteCookie('mage-cache-sessid', $metadata);
            }
    }

How can i show a popup there? So the login will not continue before the customer click the popup message?

Source Link
Edwin Widhiyanto
  • 856
  • 1
  • 15
  • 41

Show popup message before check for login

I tried to show a popup message when customer tried to login. I add some code in LoginPost.php like in code below but it's not work.

LoginPost.php :

try {
      echo "  <script type='text/javascript'>
              alert('adadasd'); //This code i tried to popup a message
              </script>";

      $customer = $this->customerAccountManagement->authenticate($jsonObject[0]->EMAILOWNER, $jsonObject[0]->PASSWORDOWNER);
      $this->session->setCustomerDataAsLoggedIn($customer);
      $this->session->regenerateId();
      setcookie("Role", $jsonObject[0]->ROLE, time() + (86400 * 30), "/");
      if ($this->getCookieManager()->getCookie('mage-cache-sessid')) {
         $metadata = $this->getCookieMetadataFactory()->createCookieMetadata();
         $metadata->setPath('/');
         $this->getCookieManager()->deleteCookie('mage-cache-sessid', $metadata);
      }

How can i show a popup there? So the login will not continue before the customer click the popup message?