Guest User

tyt

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