X hide

Magento Popup Login v1.x Developer's Guide & API Reference

From Plumrocket Documentation

You are viewing:  Popup-login-magento-extension-32.png  Popup Login

Display Popup Manually

In order to configure the Popup Login Extension for a particular page element you will have to select "Manually" for the option "Display Popup" in the extension settings as shown below:

Popup Login Display Manually1.png

Method 1: You will also have to add a class "show_popup_login" to the object to trigger the popup login.

Code Example
<a href="/seespecialevent" !!-class="show_popup_login"-!!>See Special Event</a>

Method 2: You will also have to write an event onclick="return showPopupLogin(this)" in the code for the chosen page element.

Code Example
<a href="/seespecialevent" !!- onclick="return showPopupLogin(this)" -!! >See Special Event</a>

Disable Popup Manually

If you want to disable Popup for some pages, you will have to add the following code to the appropriate section of xml file:

<update handle="popuplogin_remove" />
Code Example
<catalog_category_default translate="label">
 <update handle="popuplogin_remove" />

If you want to disable Popup only for a particular element on the page, you will have to add the parameter data-popup="yes" to the selected element. For instance, if you want to disable Pop up for the "About Us" link, you will have to edit the code.

<a href="/about/">About Us</a>

making the following changes:

<a href="/about/" data-popup="yes">About Us</a>

You can also deactivate Popup for a particular controller or block (without disabling it completely), if you set the "Manually" mode for it. As a result, popup will not be displayed on the page. It is very convenient if you want to hide popup due to certain conditions, input parameters and session values.

Code Example

If you want to hide popup on the "Contact us" page, add the following code in the page template:

public function indexAction()
 $this->getLayout()->getBlock('contactForm')->setFormAction( Mage::getUrl('*/*/post') );
 $this->getLayout()->getBlock('popup.login')->setMode(4);}} // add this line to set popup login to manual mode on this page

Popup Login Extension for Magento Popup Login Extension for Magento