Last active
September 7, 2022 20:43
-
-
Save andreibabor/088bed48ee222e06b4bcb4ece771ca15 to your computer and use it in GitHub Desktop.
Shopify: Wholesale + redirect on other page after submit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% assign header_title = page.title %} | |
{% include 'page_header' with header_title %} | |
<div class="wrapper wrapper--margins wrapper__article"> | |
<div class="rte"> | |
<div class="text-center"> | |
{{ page.content }} | |
</div> | |
{% comment %}begin form{% endcomment %} | |
{% capture header_title %} {{ 'customer.register.title' | t }} {% endcapture %} | |
<div class="wrapper wrapper--center"> | |
<div class="form--customer"> | |
{% form 'create_customer' %} | |
<input type="hidden" id="customer_tags" name="customer[tags]" value="Wholesaler"/> | |
{{ form.errors | default_errors }} | |
<div class="form__row"> | |
<div class="form__column half"> | |
<label for="CompanyName">Company Legal Name<span>*</span></label> | |
<input type="text" name="customer[note][Company Legal Name]" id="CompanyName" required class="input-full" autocapitalize="words" autofocus> | |
</div> | |
<div class="form__column half"> | |
<label for="DbaName">DBA Name<span>*</span></label> | |
<input type="text" name="customer[note][DBA Name]" id="DbaName" required class="input-full" autocapitalize="words" autofocus> | |
</div> | |
<div class="form__column third"> | |
<label for="FirstName">{{ 'customer.register.first_name' | t }}<span>*</span></label> | |
<input type="text" name="customer[first_name]" id="FirstName" class="input-full" required {% if form.first_name %}value="{{ form.first_name }}"{% endif %} autocapitalize="words" autofocus> | |
</div> | |
<div class="form__column third"> | |
<label for="LastName">{{ 'customer.register.last_name' | t }}<span>*</span></label> | |
<input type="text" name="customer[last_name]" id="LastName" class="input-full" required {% if form.last_name %}value="{{ form.last_name }}"{% endif %} autocapitalize="words"> | |
</div> | |
<div class="form__column third"> | |
<label for="CreatePassword">{{ 'customer.register.password' | t }}<span>*</span></label> | |
<input type="password" name="customer[password]" required id="CreatePassword" class="input-full{% if form.errors contains 'password' %} error{% endif %}"> | |
</div> | |
</div> | |
<div class="form__row"> | |
<div class="form__column half"> | |
<label for="Title">Title</label> | |
<input type="text" name="customer[note][Title]" id="Title" class="input-full" autocapitalize="words"> | |
</div> | |
<div class="form__column half"> | |
<label for="Phone">Phone Number<span>*</span></label> | |
<input type="text" name="customer[note][Phone]" required id="Phone" class="input-full" autocapitalize="words"> | |
</div> | |
<div class="form__column third"> | |
<label for="Email">{{ 'customer.register.email' | t }}<span>*</span></label> | |
<input type="email" name="customer[email]" required id="Email" class="input-full{% if form.errors contains 'email' %} error{% endif %}" {% if form.email %} value="{{ form.email }}"{% endif %} autocorrect="off" autocapitalize="off"> | |
</div> | |
<div class="form__column third"> | |
<label for="BusinessType">Business Type<span>*</span></label> | |
<!-- <input type="text" name="customer[note][Business Type]" id="BusinessType" class="input-full" autocapitalize="words"> --> | |
<select id="BusinessType" required name="customer[note][Business Type]"> | |
<option>Please Select</option> | |
<option>Physician</option> | |
<option>Home Medical Equipment</option> | |
<option>Home Health Agency</option> | |
<option>Pharmacy</option> | |
<option>Chiropractor</option> | |
<option>Wellness Clinic</option> | |
<option>Other</option> | |
</select> | |
</div> | |
<div class="form__column third"> | |
<label for="Intent">Intent<span>*</span></label> | |
<select id="Intent" required name="customer[note][Intent]"> | |
<option>Please Select</option> | |
<option>eCommerce</option> | |
<option>Brick & Mortar Location</option> | |
<option>Both</option> | |
</select> | |
{% comment %} <input type="radio" id="CustomerFormTea" class="input-full" name="customer[note][Intent]" value="eCommerce" /> eCommerce | |
<input type="radio" id="CustomerFormBrick" class="input-full" name="customer[note][Intent]" value="Brick & Mortar Location" /> Brick & Mortar Location | |
<input type="radio" id="CustomerFormBoth" class="input-full" name="customer[note][Intent]" value="Both" /> Both{% endcomment %} | |
</div> | |
</div> | |
<div class="form__row"> | |
<div class="form__column third"> | |
<label for="Website">Website URL<span>*</span></label> | |
<input type="text" required name="customer[note][Website URL]" id="Website" placeholder="http://mywebsite.com" class="input-full" autocapitalize="words"> | |
</div> | |
<div class="form__column third"> | |
<label for="Shipping">Shipping Address<span>*</span></label> | |
<input type="text" required name="customer[note][Street Address 1]" id="Shipping" placeholder="Street Address Line 1" class="input-full" autocapitalize="words"> | |
</div> | |
<div class="form__column third"> | |
<label for="Shipping"> </label> | |
<input type="text" name="customer[note][Street Address 2]" id="Shipping" placeholder="Street Address Line 2" class="input-full" autocapitalize="words"> | |
</div> | |
</div> | |
<div class="form__row"> | |
<div class="form__column half"> | |
<label for="City">City</label> | |
<input type="text" name="customer[note][City]" id="City" class="input-full" autocapitalize="words"> | |
</div> | |
<div class="form__column half"> | |
<label for="State">State / Province</label> | |
<input type="text" name="customer[note][State / Province]" id="State" class="input-full" autocapitalize="words"> | |
</div> | |
<div class="form__column half"> | |
<label for="Postal">Postal / Zip Code</label> | |
<input type="text" name="customer[note][Postal / Zip Code]" id="Postal" class="input-full" autocapitalize="words"> | |
</div> | |
<div class="form__column half"> | |
<label for="Country">Country</label> | |
<input type="text" name="customer[note][Country]" id="Country" class="input-full" autocapitalize="words"> | |
</div> | |
<div class="form__column half"> | |
<label for="Message">Message</label> | |
<textarea rows="3" id="Message" class="input-full" name="customer[note][Message]"></textarea> | |
</div> | |
<div class="form__column half"> | |
<label for="certificate">Sales Tax Certificate</label> | |
<input type="text" name="customer[note][Sales Tax Certificate]" id="certificate" class="input-full" autocapitalize="words"> | |
</div> | |
</div> | |
<div class="form__row"> | |
<div class="form__column"> | |
<label for="ResellerTerms"><a target="_blank" href="/pages/reseller-terms-conditions">Reseller Terms & Conditions</a></label> | |
<input type="checkbox" required id="ResellerTerms" name="customer[note][Reseller Terms & Conditions]" value="Yes, accept!" /> Yes, accept! | |
</div> | |
<div class="form__column third"> | |
<label for="MAPPolicy"><a target="_blank" href="/pages/map-policy">MAP Policy</a></label> | |
<input type="checkbox" required id="MAPPolicy" name="customer[note][MAP Policy]" value="Yes, accept!" /> Yes, accept! | |
</div> | |
</div> | |
<div class="form__column half"> | |
<div class="text-center"> | |
<input type="submit" value="{{ 'customer.register.submit' | t }}" class="btn btn--regular btn--color btn--fill"> | |
</div> | |
</div> | |
<!--begin redirect to other page --> | |
<script> | |
(function($){ | |
var whereToRedirectAfterRegistering ='/pages/registration-is-completed'; | |
var registerForm = jQuery('form[action$="/account"][method="post"]'); | |
var formElement = $('<input type="hidden" name="return_to">'); | |
formElement.attr('value', whereToRedirectAfterRegistering); | |
registerForm.append("<input type='hidden' name='return_to' value='/pages/registration-is-completed'/>"); | |
}(jQuery)); | |
</script> | |
<!--end redirect to other page --> | |
{% endform %} | |
</div> | |
</div> | |
</div> | |
</div> |
Author
andreibabor
commented
Apr 16, 2019
•
- take default account form and modify
- create the wholesaler-account page
- added here the code
- using script (line152) redirected on other page after the form is completed
- this line 22 -> represent added tag in wholesaler account
- install this app Wholesale Club https://apps.shopify.com/wholesale-club
- create same tags like customers
- for minimum orders -> need to go on Advanced minimums https://cl.ly/a2618183f473
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment