0

I'm in the checkout page and there are two options there: one radio button so that the user can choose a receipt when he/she submits the order and one button so the user can choose an invoice instead. When the user chooses the invoice button, I would like it to check if the user is logged in, and if he's not, the login pop up window should come up that makes the user log in. So my sample code is the following (billing.phtml file):

jQuery(document).ready(function() {


jQuery("#plirwmi_off").on('change', function (e) {


  jQuery('.visitor-disable').show("slow");

   jQuery('#shipping-area .visitor-disable').hide();

<?php


    if(!Mage::helper('customer')->isLoggedIn()):
      ?>

      alert('Not Logged in');

      //make the pop up window appear

      <?php elseif (Mage::helper('customer')->isLoggedIn()): ?>

      alert('Logged in');

       <?php endif; ?>

});

});

I've found the login pop up window already and I guess I have to call it somehow? Any hint ?

1

You can use this code to show login form fields on your popup. Tested on 1.9.3.4

echo $this->getLayout()->createBlock('customer/form_login')
->setTemplate('customer/form/mini.login.phtml')
->toHtml();
| improve this answer | |
  • This one is good!!! I tried it and the box pops up. However when I hit on the submit button of the pop up box it won't login. – Stefanos Aug 1 '17 at 8:42
  • Actually when I click on the submit button it does nothing.. any hint ? – Stefanos Aug 1 '17 at 11:04
  • Please check is there any javascript to prevent this form submission. – DelwaR Aug 3 '17 at 8:18
  • a formkey is missing form your form. i used same code but there was no formkey i placed form key and its now working fine. – Taseen Jan 19 '19 at 5:49
0

You can use ajax-popup-for-login-registration extension which is using the pop box. I think, this extension, solve your problem and its free

https://www.magentocommerce.com/magento-connect/ajax-popup-for-login-registration.html

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.