I migrated a custom code from shopify to shopify 2.0 but in shopify 2.0 is not function exact like o

I migrated a custom code from shopify to shopify 2.0 but in shopify 2.0 is not function exact like o

SyedWajahat
Shopify Partner
12 1 2

Hi, I shifted this code from the symmetry theme's older version to the new 2.0 version. The code is for registering an application for a wholesale account. But this is not giving results as was given in the older version. Please have a look at it and let me know. If you have any further questions please let me know. 

I migrated the whole code from the older version to the newer version. When someone submits the application in the older version they see a page and a message to check their inbox we have sent you a confirmation email but after migrating to 2.0 when someone submits an application they automatically logged in redirected to the home page without any notification, confirmation of email, or any successful message.

 

<div id="template" class="small-form">
<div id="customer">
<!-- Create Customer -->
<div id="create-customer">
<div class="template_header">
{% if settings.wholesale_reg_text != blank %}
<h1 class="majortitle">{{ settings.wholesale_reg_title }}</h1>
{% else %}
<h1 class="majortitle">{{ 'customer.wholesale.title' | t }}</h1>
{% endif %}
</div>

<div class="wholesale_text">
{{ settings.wholesale_reg_text }}
</div>

{% form 'create_customer', class:"wholesale-register" %}
{% if form.posted_successfully? %}
<script>
window.location.href = "/pages/wholesale-account";
</script>
{% endif %}

{% if form.errors %}
<ul class="errors">
{% for field in form.errors %}
<li>{{ field | replace: 'body','Message' | capitalize }} - {{ form.errors.messages[field] }}</li>
{% endfor %}
</ul>
{% endif %}

<input type="hidden" name="customer[tags]" value="apply_for_wholesale" />

<div class="grouped_inputs">
<div class="input-row">
<label for="first_name" class="login">{{ 'customer.wholesale.first_name' | t }}</label>
<input type="text" value="" name="customer[first_name]" id="first_name" class="large" size="30" />
</div>

<div class="input-row">
<label for="last_name" class="login">{{ 'customer.wholesale.last_name' | t }}</label>
<input type="text" value="" name="customer[last_name]" id="last_name" class="large" size="30" />
</div>
</div>

<div class="input-row">
<label for="email" class="login">{{ 'customer.wholesale.email' | t }}</label>
<input type="email" value="" name="customer[email]" id="email" class="large" size="30" />
</div>

<div class="input-row w-checkbox">
<input type="checkbox" id="newsletter" name="customer[tags]" value="prospect, newsletter, apply_for_wholesale" />
<label class="login">{{ 'customer.wholesale.newsletter_opt_in' | t }} <a href="/pages/privacy-policy">privacy policy</a></label>
</div>

<div class="input-row">
<label for="password" class="login">{{ 'customer.wholesale.password' | t }}</label>
<input type="password" value="" name="customer[password]" id="password" class="large password" size="30" />
</div>

<div class="input-row">
<label for="company" class="login">{{ 'customer.wholesale.company' | t }}</label>
<input type="text" value="" name="customer[note][Company]" id="company" class="large" size="30" />
</div>

<div class="input-row">
<label for="website" class="login">{{ 'customer.wholesale.website' | t }}</label>
<input type="text" value="" name="customer[note][Website]" id="website" class="large" size="30" />
</div>

<div class="input-row grouped_boxes">
<label for="tax_exempt" class="login">{{ 'customer.wholesale.tax_exempt' | t }}</label>
<input type="checkbox" value="Yes" name="customer[note][Are you tax exempt]" id="tax_exempt" class="large" />
<label for="tax_exempt" class="login">Yes</label>
<input type="checkbox" value="No" name="customer[note][Are you tax exempt]" id="tax_exempt" class="large" />
<label for="tax_exempt" class="login">No</label>
<input type="checkbox" value="Not sure" name="customer[note][Are you tax exempt]" id="tax_exempt" class="large" />
<label for="tax_exempt" class="login">Not sure</label>
</div>

<div class="input-row">
<label for="tax_code" class="login">{{ 'customer.wholesale.tax_code' | t }}</label>
<input type="text" value="" name="customer[note][Your tax code]" id="tax_code" class="large" size="6" />
</div>

<div class="input-row">
<label for="hear_about_us" class="login">{{ 'customer.wholesale.hear_about_us' | t }}</label>
<input type="text" value="" name="customer[note][Where did you hear about us]" id="hear_about_us" class="large" size="30" />
</div>

<div class="input-row">
<label for="social_accounts" class="login">{{ 'customer.wholesale.social_accounts' | t }}</label>
<input type="text" value="" name="customer[note][Your social accounts]" id="social_accounts" class="large" size="30" />
</div>

<div class="input-row grouped_boxes">
<label for="shop_type" class="login">{{ 'customer.wholesale.shop_type' | t }}</label>
<input type="checkbox" value="Toys" name="customer[note][What type of shop are you(1)]" id="shop_type" class="large" />
<label for="shop_type">Toys</label>
<input type="checkbox" value="Kids" name="customer[note][What type of shop are you(2)]" id="shop_type" class="large" />
<label for="shop_type">kids</label>
<input type="checkbox" value="Home/decor" name="customer[note][What type of shop are you(3)]" id="shop_type" class="large" />
<label for="shop_type">Home/decor</label>
<input type="checkbox" value="Books/gifts" name="customer[note][What type of shop are you(4)]" id="shop_type" class="large" />
<label for="shop_type">Books/gifts</label>
<input type="checkbox" value="Concept" name="customer[note][What type of shop are you(5)]" id="shop_type" class="large" />
<label for="shop_type">Concept</label>
<input type="checkbox" value="Department" name="customer[note][What type of shop are you(6)]" id="shop_type" class="large" />
<label for="shop_type">Department</label>
<input type="checkbox" value="Museum" name="customer[note][What type of shop are you(7)]" id="shop_type" class="large" />
<label for="shop_type">Museum</label>
<input type="checkbox" value="Other" name="customer[note][What type of shop are you(8)]" id="shop_type" class="large" />
<label for="shop_type">Other</label>
<input type="text" value="" name="customer[note][What type of shop are you (other)(9)]" id="shop_type_other" class="large" size="30" />
</div>

<div class="input-row">
<label for="tell_us_more" class="login">{{ 'customer.wholesale.tell_us_more' | t }}</label>
<textarea value="" name="customer[note][Tell us more about you]" id="tell_us_more" class="large" size="100" placeholder="{{ 'customer.wholesale.tell_us_more_placeholder' | t }}"></textarea>
</div>

<div class="action_bottom">
<input class="btn" type="submit" value="{{ 'customer.wholesale.submit' | t }}" />
<span class="note">
<a href="/account/login">{{ 'customer.register.log_in' | t }}</a>
{{ 'customer.general.or' | t }}
<a href="{{ shop.url }}">{{ 'customer.register.cancel' | t }}</a>
</span>
</div>
{% endform %}
</div><!-- /#create-customer -->
</div>
</div>
If helpful then please Like and Accept the Solution.
Want to modify or custom changes to the store Hire me.
- Feel free to contact me at syedwajahatattari@gmail.com regarding any help
Shopify Partner | facebook: /syedwajahatattari
Reply 1 (1)

Modi_Mayur
Shopify Partner
4 0 0

Hey,

I just test your code, it's working but have some codding error. So you need shopify expert help for the same. 

I'm can also help you with the same (chargeable), 

Thanks