Guest User

Untitled

a guest
Nov 7th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.27 KB | None | 0 0
  1. <?php
  2. /**
  3. * Copyright © 2013-2017 Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6.  
  7. // @codingStandardsIgnoreFile
  8.  
  9. ?>
  10. <?php
  11. /**
  12. * Create account form template
  13. *
  14. * @var $block MagentoCustomerBlockFormRegister
  15. */
  16. ?>
  17. <style>
  18. #coupon_field { display:none; }
  19. </style>
  20. <script>
  21. function showMe (box) {
  22.  
  23. var chboxs = document.getElementsByName("vip_group_id");
  24. var vis = "none";
  25. for(var i=0;i<chboxs.length;i++) {
  26. if(chboxs[i].checked){
  27. vis = "block";
  28. break;
  29. }
  30. }
  31. document.getElementById(box).style.display = vis;
  32. if(vis=="block"){
  33.  
  34. document.getElementById('group_id').value = 3;
  35. }else{
  36.  
  37. document.getElementById('group_id').value = 1;
  38. }
  39.  
  40.  
  41. }
  42. </script>
  43. <?php echo $block->getChildHtml('form_fields_before')?>
  44. <?php /* Extensions placeholder */ ?>
  45. <?php echo $block->getChildHtml('customer.form.register.extra')?>
  46.  
  47. <form class="form create account form-create-account" action="<?php /*
  48. @escapeNotVerified */ echo $block->getPostActionUrl() ?>" method="post" id="form-validate" enctype="multipart/form-data" autocomplete="off">
  49. <input type="hidden" name="group_id" id="group_id" value="1" />
  50. <fieldset class="fieldset create info">
  51. <legend class="legend"><span><?php /* @escapeNotVerified */ echo __('Personal Information') ?></span></legend><br>
  52. <input type="hidden" name="success_url" value="<?php /* @escapeNotVerified */ echo $block->getSuccessUrl() ?>">
  53. <input type="hidden" name="error_url" value="<?php /* @escapeNotVerified */ echo $block->getErrorUrl() ?>">
  54. <?php echo $block->getLayout()->createBlock('MagentoCustomerBlockWidgetName')->setObject($block->getFormData())->setForceUseCustomerAttributes(true)->toHtml() ?>
  55. <?php if ($block->isNewsletterEnabled()): ?>
  56. <!--<div class="field choice newsletter">
  57. <input type="checkbox" name="is_subscribed" title="<?php /* @escapeNotVerified */ echo __('Sign Up for Newsletter') ?>" value="1" id="is_subscribed"<?php if ($block->getFormData()->getIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox">
  58. <label for="is_subscribed" class="label"><span><?php /* @escapeNotVerified */ echo __('Sign Up for Newsletter') ?></span></label>
  59. </div>-->
  60. <?php /* Extensions placeholder */ ?>
  61. <?php echo $block->getChildHtml('customer.form.register.newsletter')?>
  62. <?php endif ?>
  63.  
  64.  
  65.  
  66.  
  67. <div class="fieldset" style="margin:0">
  68. <label class="label vipsignuptext"><span>YES, sign me up as a VIP member!</span></label>
  69. <input type="checkbox" name="vip_group_id" onclick="showMe('div1')" style="margin: 10px 10px 0;">
  70. </div>
  71.  
  72. <div id="div1" class="fieldset" style="display:none">
  73. <?php $_dob = $block->getLayout()->createBlock('MagentoCustomerBlockWidgetDob') ?>
  74. <?php if ($_dob->isEnabled()): ?>
  75. <?php echo $_dob->setDate($block->getFormData()->getDob())->toHtml() ?>
  76. <?php endif ?>
  77.  
  78. <?php $_gender = $block->getLayout()->createBlock('MagentoCustomerBlockWidgetGender') ?>
  79. <?php if ($_gender->isEnabled()): ?>
  80. <?php echo $_gender->setGender($block->getFormData()->getGender())->toHtml() ?>
  81. <?php endif ?>
  82. </div>
  83.  
  84. <?php $_taxvat = $block->getLayout()->createBlock('MagentoCustomerBlockWidgetTaxvat') ?>
  85. <?php if ($_taxvat->isEnabled()): ?>
  86. <?php echo $_taxvat->setTaxvat($block->getFormData()->getTaxvat())->toHtml() ?>
  87. <?php endif ?>
  88.  
  89. </fieldset>
  90. <?php if ($block->getShowAddressFields()): ?>
  91. <fieldset class="fieldset address">
  92. <legend class="legend"><span><?php /* @escapeNotVerified */
  93. echo __('Address Information') ?></span></legend><br>
  94. <input type="hidden" name="create_address" value="1" />
  95. <div class="field company">
  96. <label for="company" class="label"><span><?php /* @escapeNotVerified */ echo __('Company') ?></span></label>
  97. <div class="control">
  98. <input type="text" name="company" id="company" value="<?php echo $block->escapeHtml($block->getFormData()->getCompany()) ?>" title="<?php /* @escapeNotVerified */ echo __('Company') ?>" class="input-text <?php /* @escapeNotVerified */ echo $this->helper('MagentoCustomerHelperAddress')->getAttributeValidationClass('company') ?>">
  99. </div>
  100. </div>
  101. <div class="field telephone">
  102. <label for="telephone" class="label"><span><?php /* @escapeNotVerified */ echo __('Phone Number') ?></span></label>
  103. <div class="control">
  104. <input type="text" name="telephone" id="telephone" value="<?php echo $block->escapeHtml($block->getFormData()->getTelephone()) ?>" title="<?php /* @escapeNotVerified */ echo __('Phone Number') ?>" class="input-text <?php /* @escapeNotVerified */ echo $this->helper('MagentoCustomerHelperAddress')->getAttributeValidationClass('telephone') ?>">
  105. </div>
  106. </div>
  107.  
  108. <?php $_streetValidationClass = $this->helper('MagentoCustomerHelperAddress')->getAttributeValidationClass('street'); ?>
  109.  
  110. <div class="field street required">
  111. <label for="street_1" class="label"><span><?php /* @escapeNotVerified */ echo __('Street Address') ?></span></label>
  112. <div class="control">
  113. <input type="text" name="street[]" value="<?php echo $block->escapeHtml($block->getFormData()->getStreet(0)) ?>" title="<?php /* @escapeNotVerified */ echo __('Street Address') ?>" id="street_1" class="input-text <?php /* @escapeNotVerified */ echo $_streetValidationClass ?>">
  114. <div class="nested">
  115. <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
  116. <?php for ($_i = 2, $_n = $this->helper('MagentoCustomerHelperAddress')->getStreetLines(); $_i <= $_n; $_i++): ?>
  117. <div class="field additional">
  118. <label class="label" for="street_<?php /* @escapeNotVerified */ echo $_i ?>">
  119. <span><?php /* @escapeNotVerified */ echo __('Address') ?></span>
  120. </label>
  121. <div class="control">
  122. <input type="text" name="street[]" value="<?php echo $block->escapeHtml($block->getFormData()->getStreetLine($_i - 1)) ?>" title="<?php /* @escapeNotVerified */ echo __('Street Address %1', $_i) ?>" id="street_<?php /* @escapeNotVerified */ echo $_i ?>" class="input-text <?php /* @escapeNotVerified */ echo $_streetValidationClass ?>">
  123. </div>
  124. </div>
  125. <?php endfor; ?>
  126. </div>
  127. </div>
  128. </div>
  129.  
  130. <div class="field required">
  131. <label for="city" class="label"><span><?php /* @escapeNotVerified */ echo __('City') ?></span></label>
  132. <div class="control">
  133. <input type="text" name="city" value="<?php echo $block->escapeHtml($block->getFormData()->getCity()) ?>" title="<?php /* @escapeNotVerified */ echo __('City') ?>" class="input-text <?php /* @escapeNotVerified */ echo $this->helper('MagentoCustomerHelperAddress')->getAttributeValidationClass('city') ?>" id="city">
  134. </div>
  135. </div>
  136.  
  137. <div class="field region required">
  138. <label for="region_id" class="label"><span><?php /* @escapeNotVerified */ echo __('State/Province') ?></span></label>
  139. <div class="control">
  140. <select id="region_id" name="region_id" title="<?php /* @escapeNotVerified */ echo __('State/Province') ?>" class="validate-select" style="display:none;">
  141. <option value=""><?php /* @escapeNotVerified */ echo __('Please select a region, state or province.') ?></option>
  142. </select>
  143. <input type="text" id="region" name="region" value="<?php echo $block->escapeHtml($block->getRegion()) ?>" title="<?php /* @escapeNotVerified */ echo __('State/Province') ?>" class="input-text <?php /* @escapeNotVerified */ echo $this->helper('MagentoCustomerHelperAddress')->getAttributeValidationClass('region') ?>" style="display:none;">
  144. </div>
  145. </div>
  146.  
  147. <div class="field zip required">
  148. <label for="zip" class="label"><span><?php /* @escapeNotVerified */ echo __('Zip/Postal Code') ?></span></label>
  149. <div class="control">
  150. <input type="text" name="postcode" value="<?php echo $block->escapeHtml($block->getFormData()->getPostcode()) ?>" title="<?php /* @escapeNotVerified */ echo __('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php /* @escapeNotVerified */ echo $this->helper('MagentoCustomerHelperAddress')->getAttributeValidationClass('postcode') ?>">
  151. </div>
  152. </div>
  153.  
  154. <div class="field country required">
  155. <label for="country" class="label"><span><?php /* @escapeNotVerified */ echo __('Country') ?></span></label>
  156. <div class="control">
  157. <?php echo $block->getCountryHtmlSelect() ?>
  158. </div>
  159. </div>
  160. <?php $addressAttributes = $block->getChildBlock('customer_form_address_user_attributes');?>
  161. <?php if ($addressAttributes): ?>
  162. <?php $addressAttributes->setEntityType('customer_address'); ?>
  163. <?php $addressAttributes->setFieldIdFormat('address:%1$s')->setFieldNameFormat('address[%1$s]');?>
  164. <?php $block->restoreSessionData($addressAttributes->getMetadataForm(), 'address');?>
  165. <?php echo $addressAttributes->setShowContainer(false)->toHtml()?>
  166. <?php endif;?>
  167. <input type="hidden" name="default_billing" value="1">
  168. <input type="hidden" name="default_shipping" value="1">
  169. </fieldset>
  170.  
  171. <?php endif; ?>
  172. <fieldset class="fieldset create account" data-hasrequired="<?php /* @escapeNotVerified */ echo __('* Required Fields') ?>">
  173. <legend class="legend"><span><?php /* @escapeNotVerified */ echo __('Sign-in Information') ?></span></legend><br>
  174. <div class="field required">
  175. <label for="email_address" class="label"><span><?php /* @escapeNotVerified */ echo __('Email') ?></span></label>
  176. <div class="control">
  177. <input type="email" name="email" autocomplete="email" id="email_address" value="<?php echo $block->escapeHtml($block->getFormData()->getEmail()) ?>" title="<?php /* @escapeNotVerified */ echo __('Email') ?>" class="input-text" data-validate="{required:true, 'validate-email':true}">
  178. </div>
  179. </div>
  180. <div class="field password required" data-mage-init='{"passwordStrengthIndicator": {}}'>
  181. <label for="password" class="label"><span><?php /* @escapeNotVerified */ echo __('Password') ?></span></label>
  182. <div class="control">
  183. <input type="password" name="password" id="password"
  184. title="<?php /* @escapeNotVerified */ echo __('Password') ?>"
  185. class="input-text"
  186. data-password-min-length="<?php echo $block->escapeHtml($block->getMinimumPasswordLength()) ?>"
  187. data-password-min-character-sets="<?php echo $block->escapeHtml($block->getRequiredCharacterClassesNumber()) ?>"
  188. data-validate="{required:true, 'validate-customer-password':true}"
  189. autocomplete="off">
  190. <div id="password-strength-meter-container" data-role="password-strength-meter" >
  191. <div id="password-strength-meter" class="password-strength-meter">
  192. <?php /* @escapeNotVerified */ echo __('Password Strength'); ?>:
  193. <span id="password-strength-meter-label" data-role="password-strength-meter-label" >
  194. <?php /* @escapeNotVerified */ echo __('No Password'); ?>
  195. </span>
  196. </div>
  197. </div>
  198. </div>
  199.  
  200. </div>
  201. <div class="field confirmation required">
  202. <label for="password-confirmation" class="label"><span><?php /* @escapeNotVerified */ echo __('Confirm Password') ?></span></label>
  203. <div class="control">
  204. <input type="password" name="password_confirmation" title="<?php /* @escapeNotVerified */ echo __('Confirm Password') ?>" id="password-confirmation" class="input-text" data-validate="{required:true, equalTo:'#password'}" autocomplete="off">
  205. </div>
  206. </div>
  207. <?php echo $block->getChildHtml('form_additional_info'); ?>
  208. </fieldset>
  209. <div class="actions-toolbar">
  210. <div class="primary">
  211. <input type="submit" class="btn btn-default roundbtn" value="Register">
  212. </div>
  213.  
  214. </div>
  215. </form>
  216. <script>
  217. require([
  218. 'jquery',
  219. 'mage/mage'
  220. ], function($){
  221.  
  222. var dataForm = $('#form-validate');
  223. var ignore = <?php /* @escapeNotVerified */ echo $_dob->isEnabled() ? ''input[id$="full"]'' : 'null'; ?>;
  224.  
  225. dataForm.mage('validation', {
  226. <?php if ($_dob->isEnabled()): ?>
  227. errorPlacement: function(error, element) {
  228. if (element.prop('id').search('full') !== -1) {
  229. var dobElement = $(element).parents('.customer-dob'),
  230. errorClass = error.prop('class');
  231. error.insertAfter(element.parent());
  232. dobElement.find('.validate-custom').addClass(errorClass)
  233. .after('<div class="' + errorClass + '"></div>');
  234. }
  235. else {
  236. error.insertAfter(element);
  237. }
  238. },
  239. ignore: ':hidden:not(' + ignore + ')'
  240. <?php else: ?>
  241. ignore: ignore ? ':hidden:not(' + ignore + ')' : ':hidden'
  242. <?php endif ?>
  243. }).find('input:text').attr('autocomplete', 'off');
  244.  
  245. });
  246. </script>
  247. <?php if ($block->getShowAddressFields()): ?>
  248. <script type="text/x-magento-init">
  249. {
  250. "#country": {
  251. "regionUpdater": {
  252. "optionalRegionAllowed": <?php /* @escapeNotVerified */
  253. echo($block->getConfig('general/region/display_all') ? 'true' : 'false'); ?>,
  254. "regionListId": "#region_id",
  255. "regionInputId": "#region",
  256. "postcodeId": "#zip",
  257. "form": "#form-validate",
  258. "regionJson": <?php /* @escapeNotVerified */ echo $this->helper('MagentoDirectoryHelperData')->getRegionJson() ?>,
  259. "defaultRegion": "<?php /* @escapeNotVerified */ echo $block->getFormData()->getRegionId() ?>",
  260. "countriesWithOptionalZip": <?php /* @escapeNotVerified */ echo $this->helper('MagentoDirectoryHelperData')->getCountriesWithOptionalZip(true) ?>
  261. }
  262. }
  263. }
  264. </script>
  265. <?php endif; ?>
Add Comment
Please, Sign In to add comment