View difference between Paste ID: aqv51qni and zjp1Aq8p
SHOW: | | - or go back to the newest paste.
1
<?php if (!Mage::getSingleton('customer/session')->isLoggedIn()): ?>
2
    <div id="ajaxlogin-login-window" style="display: none;">
3
        <div class="page-title">
4
            <span><?php echo $this->__('Login into your Account 1a') ?></span>
5
        </div>
6
       <form action="<?php echo $this->getUrl('example/amasty/createSimpleProductAndRedirect', array('_secure'=>(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS']==='on'), 'id' => Mage::registry('current_product')->getId())) ?>" id="ajaxlogin-login-form">
7
            <div class="content">
8
                <ul class="form-list">
9
                    <li>
10
                    <input type="hidden" id="likeproduct_id" name="product_id" value=""/>
11
                        <label for="email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
12
                        <div class="input-box">
13
                            <input type="text" name="login[username]" value="<?php echo $this->htmlEscape($this->getUsername()) ?>" id="email"  title="<?php echo $this->__('Email Address') ?>" />
14
                        </div>
15
                    </li>
16
                    <li>
17
                        <label for="pass" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
18
                        <div class="input-box">
19
                            <input type="password" name="login[password]"  id="pass" title="<?php echo $this->__('Password') ?>" />
20
                        </div>
21
                    </li>
22
                    <?php echo $this->getChildHtml('form.additional.info'); ?>
23
                </ul>
24
            </div>
25
            <div class="buttons-set">
26
                <button type="button" class="button" onclick="setproductregisteration();" title="<?php echo $this->__('Register') ?>" name="noaccount" id="noaccount"><span><span><?php echo $this->__('Register') ?></span></span></button>
27
                
28
				
29
				<button onclick = "hideWindow()" type="submit" class="button" title="<?php echo $this->__('Login') ?>" name="send" id="send2"  ><span><span><?php echo $this->__('Login') ?></span></span></button>
30
				
31
				<div class="progress-indicator">
32
                    <span class="please-wait" id="login-please-wait" style="display:none;">
33
                        <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" class="v-middle" alt=""/>
34
                    </span>
35
                </div>
36
                <a href="<?php echo $this->getForgotPasswordUrl() ?>" class="f-left ajaxlogin-forgot"><?php echo $this->__('Forgot Your Password?') ?></a>
37
            </div>
38
        </form>
39
        <script type="text/javascript">
40
            //<![CDATA[ 
41
            var ajaxLoginForm = new VarienForm('ajaxlogin-login-form', true);
42
            //]]>
43
        </script>
44
    </div>
45
<?php endif; ?>
46
47
48
<!-- Register -->
49
50
51
52
<?php if (!Mage::getSingleton('customer/session')->isLoggedIn()): ?>
53
    <div id="ajaxlogin-create-window" style="display: none;">
54
        <div class="page-title">
55
            <span><?php echo $this->__('Create an Account') ?></span>
56
        </div>
57
        <form action="<?php echo $this->getUrl('example/amasty/createSimpleProductAndRedirect1', array('_secure'=>(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS']==='on'), 'id' => Mage::registry('current_product')->getId() )) ?>" method="post" id="ajaxlogin-create-form">
58
            <?php echo $this->getChildHtml(); ?>
59
        </form>
60
        <script type="text/javascript">
61
            //<![CDATA[
62
            var ajaxCreateForm = new VarienForm('ajaxlogin-create-form', true);
63
            //]]>
64
        </script>
65
    </div>
66
<?php endif; ?>
67
68
<!-- Register end -->
69
70
<!-- logout and forget password -->
71
72
<?php if (!Mage::getSingleton('customer/session')->isLoggedIn()): ?>
73
    <div id="ajaxlogin-forgot-window" style="display: none;">
74
        <div class="page-title">
75
            <span><?php echo $this->__('Forgot Your Password?') ?></span>
76
        </div>
77
        <form action="<?php echo $this->getUrl('productlike/index/forgotpassword', array('_secure'=>(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS']==='on'))) ?>" method="post" id="ajaxlogin-forgot-password-form">
78
            <div class="content">
79
                <?php
80
                $customerHelper = Mage::helper('customer');
81
                if (method_exists($customerHelper, 'generateResetPasswordLinkToken')) : ?>
82
                    <p><?php echo $this->__('Please enter your email address below. You will receive a link to reset your password.') ?></p>
83
                <?php else: ?>
84
                    <p><?php echo $this->__('Please enter your email below and we will send you a new password.') ?></p>
85
                <?php endif; ?>
86
                <ul class="form-list">
87
                    <li>
88
                        <label for="email_address" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
89
                        <div class="input-box">
90
                            <input type="text" name="email" id="email_address" class="input-text required-entry validate-email" value="<?php echo $this->htmlEscape($this->getEmailValue()) ?>" />
91
                        </div>
92
                    </li>
93
                    <?php echo $this->getChildHtml('form.additional.info'); ?>
94
                </ul>
95
            </div>
96
            <div class="buttons-set">
97
                <button type="submit" title="<?php echo $this->__('Submit') ?>" id="btn-forgot" class="button"><span><span><?php echo $this->__('Submit') ?></span></span></button>
98
				<div class="progress-indicator">
99
                    <span class="please-wait" id="forgot-please-wait" style="display:none;">
100
                        <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" class="v-middle" alt=""/>
101
                    </span>
102
                </div>
103
                <p class="back-link"><a href="<?php echo $this->helper('customer')->getLoginUrl() ?>" class="ajaxlogin-login"><?php echo $this->__('Back to Login') ?></a></p>
104
            </div>
105
        </form>
106
        <script type="text/javascript">
107
            //<![CDATA[
108
            var ajaxForgotForm = new VarienForm('ajaxlogin-forgot-password-form', true);
109
            //]]>
110
        </script>
111
    </div>
112
<?php endif; ?>
113
114
115
<?php if (Mage::getSingleton('customer/session')->isLoggedIn()): ?>
116
    <div id="ajaxlogin-logout-window" style="display: none;">
117
        <div class="page-title">
118
            <span><?php echo $this->__('Logout from your Account') ?></span>
119
        </div>
120
        <form action="<?php echo $this->getUrl('ajaxlogin/index/logout', array('_secure'=>(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS']==='on'))) ?>" method="post" id="ajaxlogin-logout-form">
121
            <div class="content">
122
               <p><?php echo $this->__('Are you sure you want to log out ?') ?></p>
123
            </div>
124
            <div class="buttons-set">
125
                <button type="submit" class="button" title="<?php echo $this->__('Login') ?>" name="send" id="send2"><span><span><?php echo $this->__('Logout') ?></span></span></button>
126
				<div class="progress-indicator">
127
                    <span class="please-wait" id="login-please-wait" style="display:none;">
128
                        <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" class="v-middle" alt=""/>
129
                    </span>
130
                </div>
131
            </div>
132
        </form>
133
        <script type="text/javascript">
134
            //<![CDATA[
135
            var ajaxLogoutForm = new VarienForm('ajaxlogin-logout-form', true);
136
            //]]>
137
        </script>
138
    </div>
139
<?php endif; ?>
140
141
<?php if (Mage::getConfig()->getModuleConfig('Mage_Persistent')) : ?>
142
    <?php
143
    $isActive = Mage::getConfig()->getNode('modules/Mage_Persistent/active');
144
    if (!$isActive || !in_array((string)$isActive, array('true', '1'))) {
145
        return false;
146
    }
147
    ?>
148
149
    <?php if (Mage::helper('persistent/session')->isPersistent() && !Mage::getSingleton('customer/session')->isLoggedIn()): ?>
150
        <?php $customer = Mage::helper('persistent/session')->getCustomer(); ?>
151
        <div id="persistent-cart-window" style="display:none;">
152
            <div class="page-title">
153
                <span><?php echo Mage::helper('persistent')->__('Welcome, %s!', Mage::helper('core')->escapeHtml($customer->getName(), null)) ?></span>
154
            </div>
155
            <div class="content">
156
                <p><?php
157
                    echo Mage::helper('ajaxlogin')->__(
158
                        'You are browsing our store as %s %s',
159
                        $customer->getName(),
160
                        $this->getLayout()->createBlock('persistent/header_additional')->toHtml()
161
                    );
162
                    ?></p>
163
                <p><?php
164
                    $login    = $this->__('Login');
165
                    $register = $this->__('Register');
166
                    echo Mage::helper('ajaxlogin')->__(
167
                        'Please %s or %s a new account to place order.',
168
                        "<a href='" . $this->getUrl('customer/account/login') . "' class='ajaxlogin-login'>" . $login . "</a>",
169
                        "<a href='" . $this->getUrl('persistent/index/saveMethod') . "' class='ajaxlogin-register'>" . $register . "</a>"
170
                    );
171
                    ?></p>
172
            </div>
173
        </div>
174
175
        <script type="text/javascript">
176
            //<![CDATA[
177
            document.observe("dom:loaded", function() {
178
                persistentWindow = new AjaxLogin({
179
                    triggers: {},
180
                    size: {
181
                        maxWidth: 400
182
                    }
183
                });
184
                if (!Mage.Cookies.get('hasPersistentBeenClosed'))
185
                {
186
                    persistentWindow.update($('persistent-cart-window'))
187
                        .setModal(0)
188
                        .show();
189
                }
190
            });
191
192
            $('persistent-cart-window') && $('persistent-cart-window').up().up().next('.close') && $('persistent-cart-window').up().up().next('.close').observe('click', function(e) {
193
                if (!Mage.Cookies.get("hasPersistentBeenClosed"))
194
                {
195
                    // Create the expiry date
196
                    var expiryDate = new Date();
197
                    expiryDate.setDate(expiryDate.getDate() + <?php echo ( Mage::helper('persistent')->getLifeTime() / 86400 ) ?>);
198
                    // Call the set method
199
                    Mage.Cookies.set('hasPersistentBeenClosed', true, expiryDate);
200
                }
201
            });
202
            //]]>
203
        </script>
204
205
    <?php endif; ?>
206
<?php endif; ?>
207
208
<!-- logout and forget password end -->
209
210
211
<script type="text/javascript">
212
function setproductlogin(pid)
213
{
214
    document.getElementById("likeproduct_id").value=pid;
215
   jQuery("#productlistlogin").trigger("click");
216
}
217
function setproductregisteration()
218
{
219
    var pid=document.getElementById("likeproduct_id").value;
220
    document.getElementById("likeproductreg_id").value=pid;
221
   
222
}
223
    document.observe("dom:loaded", function() {
224
        var triggers = {
225
            login: {
226
                el    : $$('.ajaxlogin-login'),
227
                event : 'click',
228
                window: $('ajaxlogin-login-window'),
229
                size: {
230
                    maxWidth: 300
231
                }
232
            },
233
            create: {
234
                el    : $$('#noaccount'),
235
                event : 'click',
236
                window: $('ajaxlogin-create-window')
237
            },
238
            forgot: {
239
                el    : $$('.ajaxlogin-forgot'),
240
                event : 'click',
241
                window: $('ajaxlogin-forgot-window'),
242
                size: {
243
                    maxWidth: 300
244
                }
245
            },
246
            logout: {
247
                el    : $$('.ajaxlogin-logout'),
248
                event : 'click',
249
                window: $('ajaxlogin-logout-window'),
250
                size: {
251
                    maxWidth: 300
252
                }
253
            }
254
        };
255
        ajaxLoginWindow = new AjaxLogin({
256
257
            triggers: triggers
258
        });
259
    });
260
	
261
	
262
	
263
	
264
	
265
</script>
266
267
<script>
268
269
               function hideWindow() 
270
                { 
271
272
                console.log('hideWindow run');
273
                var username=jQuery( "#customusername" ).val();
274
				var password=jQuery( "#custompassword" ).val();
275
				
276
				 url="";
277
				 new Ajax.Request(url, {
278
				 method: 'POST', 
279
                 parameters: {
280
				    username: username,
281
				    password:password				
282-
				parameters: {
282+
283-
				username: username,
283+
				 onSuccess: function(response) { 
284-
				password:password				
284+
285-
				},
285+
286-
				 onSuccess: function(response)
286+
287-
				 { 
287+
288
                        document.getElementById('ajaxlogin-mask').style.display = 'none';
289
						jQuery('#something .close').click();
290
                        console.log('hideWindow action success');
291-
						
291+
292
				 },
293
				 onFailure: function(response){
294-
						jQuery('#productlistlogin .close').click();
294+
295
                        console.log(response);
296
				 },
297
				});
298-
				 
298+
299-
				 }
299+
300
			
301
			  
302
303
</script>