Advertisement
Guest User

Untitled

a guest
Apr 28th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.23 KB | None | 0 0
  1. <script type="text/javascript">
  2. if (typeof jQuery == 'undefined'){
  3. document.write(unescape("%3Cscript src='//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js' type='text/javascript'%3E%3C/script%3E"));
  4. }
  5. </script>
  6. <?php
  7. $helper=Mage::helper('marketplace');
  8. $profile_hint_status = $helper->getProfileHintStatus();
  9. ?>
  10. <li class="field" id="wantptr">
  11. <label for="wantpartner" class="required"><?php echo $helper->__('Do You Want To Become A Seller / Vendor?') ?> </label>
  12. <?php
  13. if($profile_hint_status && Mage::getStoreConfig('marketplace/marketplace_profile/become_seller',Mage::app()->getStore())){?>
  14. <img src="<?php echo $this->getSkinUrl('marketplace/images/quest.png'); ?>" class='questimg' title="<?php echo Mage::getStoreConfig('marketplace/marketplace_profile/become_seller',Mage::app()->getStore()) ?>"/>
  15. <?php
  16. } ?>
  17. <div class="input-box">
  18. <input type="radio" id="wantpartner" class="wantpartner" name="wantpartner" value='1' title="<?php echo $helper->__('Agree as Seller') ?>" checked /> <?php echo $helper->__("Yes"); ?>&nbsp;&nbsp;
  19. <input type="radio" id="wantpartner" class="wantpartner" name="wantpartner" value='0' title="<?php echo $helper->__('Disagree as Seller') ?>" /> <?php echo $helper->__("No"); ?>
  20. </div>
  21. </li>
  22. <script>
  23. <?php
  24. if($profile_hint_status && Mage::getStoreConfig('marketplace/marketplace_profile/shopurl_seller',Mage::app()->getStore())){
  25. $shopurl_hint = '<img src="'.$this->getSkinUrl('marketplace/images/quest.png').'" class="questimg" title="'.Mage::getStoreConfig('marketplace/marketplace_profile/shopurl_seller',Mage::app()->getStore()).'"/>';
  26.  
  27. }else{
  28. $shopurl_hint = '';
  29. } ?>
  30. var $wk_jq= jQuery.noConflict();
  31. $wk_jq(function(){
  32. $wk_jq('#email_address').parents('li').after($wk_jq('#wantptr'));
  33. $wk_jq('#wantptr').show();
  34.  
  35. $wk_jq('.wantpartner').change(function(){
  36. if($wk_jq(this).val()==1){
  37. $wk_jq('.button').attr('disabled','disabled');
  38. $username=$wk_jq('<li/>').addClass('profileurl')
  39. .append($wk_jq('<label/>')
  40. .addClass('required')
  41. .text('<?php echo $helper->__('Shop URL'); ?>')
  42. .append($wk_jq('<em/>').text('*')))
  43. .append('<?php echo $shopurl_hint ?>')
  44. .append($wk_jq('<div/>')
  45. .addClass('input-box')
  46. .append($wk_jq('<input/>').addClass('input-text')
  47. .attr('title','<?php echo $helper->__(' Shop URL For Your Marketplace Shop ')?>')
  48. .addClass('required-entry')
  49. .attr('type','text')
  50. .attr('name','profileurl'))
  51. .append($wk_jq('<span/>')
  52. .text('<?php echo $helper->__(" (This will be used to display your public profile) ")?>')
  53. .addClass('required-entry')
  54. .attr('type','text'))
  55. )
  56. .append($wk_jq('<div/>')
  57. .attr('id','wk_load_conf')
  58. .append($wk_jq('<img/>')
  59. .attr('src','<?php echo $this->getSkinUrl('marketplace/images/ajax-loader-tr.gif'); ?>')
  60. .attr('height','20px')
  61. .attr('width','20px')));
  62. //$wk_jq('#wantptr').next('li').after($username);
  63. $wk_jq('#wantptr').after($username);
  64. }else{
  65. $wk_jq('.button').removeAttr('disabled');
  66. $wk_jq('.profileurl').remove();
  67. }
  68. });
  69. $wk_jq('ul').delegate('.profileurl input','keyup',function(){
  70. $wk_jq(this).val($wk_jq(this).val().replace(/[^a-z^A-Z^0-9.-]/g,''));
  71. });
  72. $wk_jq('#form-validate').delegate('.profileurl input','change', function(){
  73. $wk_jq('.unavailable,.available').remove();
  74. var profileurl=$wk_jq('.profileurl input').val();
  75. $wk_jq('.button').attr('disabled','disabled');
  76. if(profileurl!=''){
  77. $wk_jq('#wk_load_conf').show();
  78. $wk_jq.ajax({
  79. url:'<?php echo $this->getUrl("marketplace/seller/usernameverify")?>',
  80. type:'POST',
  81. data:{profileurl:profileurl},
  82. dataType:'JSON',
  83. success:function(data){
  84. $wk_jq('#wk_load_conf').hide();
  85. if(data==0){
  86. $wk_jq('.button').removeAttr('disabled');
  87. $wk_jq('.profileurl').append($wk_jq('<span/>').addClass('available success-msg').text('<?php echo $helper->__("available")?>'));
  88. }else{
  89. $wk_jq('.profileurl').append($wk_jq('<span/>').addClass('unavailable error-msg').text('<?php echo $helper->__("unavailable")?>'));
  90. }
  91. }
  92. });
  93. }
  94. });
  95. });
  96. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement