Guest User

fefef

a guest
Apr 11th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.71 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 4') ?></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())) ?>">
  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" class="input-text required-entry validate-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]" class="input-text required-entry validate-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. <button type="submit" class="button" title="<?php echo $this->__('Login') ?>" name="send" id="send2"><span><span><?php echo $this->__('Login') ?></span></span></button>
  28. <div class="progress-indicator">
  29. <span class="please-wait" id="login-please-wait" style="display:none;">
  30. <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" class="v-middle" alt=""/>
  31. </span>
  32. </div>
  33. <a href="<?php echo $this->getForgotPasswordUrl() ?>" class="f-left ajaxlogin-forgot"><?php echo $this->__('Forgot Your Password?') ?></a>
  34. </div>
  35. </form>
  36. <script type="text/javascript">
  37. //<![CDATA[
  38. var ajaxLoginForm = new VarienForm('ajaxlogin-login-form', true);
  39. jQuery("#ajaxlogin-login-form").submit(function(e) {
  40. e.preventDefault();
  41. if (myForm.validator.validate()) {
  42. jQuery.ajax({
  43. type: "POST",
  44. url: jQuery('#ajaxlogin-login-form').attr('action'),
  45. }).done(function(result) {
  46. alert(result);
  47. }).fail(function() {
  48. alert('There is some error saving your design.');
  49. });
  50. }
  51. });
  52. //]]>
  53. </script>
  54. </div>
  55. <?php endif; ?>
  56.  
  57.  
  58.  
  59.  
  60.  
  61. <script type="text/javascript">
  62. function setproductlogin(pid)
  63. {
  64. document.getElementById("likeproduct_id").value=pid;
  65. jQuery("#productlistlogin").trigger("click");
  66. }
  67. function setproductregisteration()
  68. {
  69. var pid=document.getElementById("likeproduct_id").value;
  70. document.getElementById("likeproductreg_id").value=pid;
  71.  
  72. }
  73. document.observe("dom:loaded", function() {
  74. var triggers = {
  75. login: {
  76. el : $$('.ajaxlogin-login'),
  77. event : 'click',
  78. window: $('ajaxlogin-login-window'),
  79. size: {
  80. maxWidth: 300
  81. }
  82. },
  83. create: {
  84. el : $$('#noaccount'),
  85. event : 'click',
  86. window: $('ajaxlogin-create-window')
  87. },
  88. forgot: {
  89. el : $$('.ajaxlogin-forgot'),
  90. event : 'click',
  91. window: $('ajaxlogin-forgot-window'),
  92. size: {
  93. maxWidth: 300
  94. }
  95. },
  96. logout: {
  97. el : $$('.ajaxlogin-logout'),
  98. event : 'click',
  99. window: $('ajaxlogin-logout-window'),
  100. size: {
  101. maxWidth: 300
  102. }
  103. }
  104. };
  105. ajaxLoginWindow = new AjaxLogin({
  106.  
  107. triggers: triggers
  108. });
  109. });
  110.  
  111.  
  112.  
  113.  
  114. </script>
Add Comment
Please, Sign In to add comment