Skip to content

Instantly share code, notes, and snippets.

@jasonvarga
Last active December 28, 2015 06:59
Show Gist options
  • Save jasonvarga/7461391 to your computer and use it in GitHub Desktop.
Save jasonvarga/7461391 to your computer and use it in GitHub Desktop.
Bison checkout form example
{{ bison:checkout_form_errors }}
{{ if missing }}
<p>You are missing the following fields.</p>
<ul>
{{ missing }}
<li>The {{ field_label }} field {{ message }}</li>
{{ /missing }}
</ul>
{{ endif }}
{{ if gateway }}
<p>Your payment couldn't be processed:</p>
<ul>
{{ gateway }}
<li><b>{{ field }}:</b> {{ message }}</li>
{{ /gateway }}
</ul>
{{ endif }}
{{ /bison:checkout_form_errors }}
{{ bison:checkout_form return="/cart/order-complete" }}
{{ if no_results }}
<p>You can't check out with an empty cart.</p>
{{ else }}
<fieldset>
<legend>Billing Details</legend>
<p>
<label>First Name</label><br />
<input type="text" name="first_name" value="{{ first_name }}" />
</p>
<p>
<label>Last Name</label><br />
<input type="text" name="last_name" value="{{ last_name }}" />
</p>
<p>
<label>Email</label><br />
<input type="text" name="email" value="{{ email }}" />
</p>
<p>
<label>Address</label><br />
<input type="text" name="billing_address_1" value="{{ billing_address_1 }}" />
</p>
<p>
<label>Address Line 2</label><br />
<input type="text" name="billing_address_2" value="{{ billing_address_2 }}" />
</p>
<p>
<label>City</label><br />
<input type="text" name="billing_city" value="{{ billing_city }}" />
</p>
<p>
<label>State</label><br />
<input type="text" name="billing_state" value="{{ billing_state }}" />
</p>
<p>
<label>Zip</label><br />
<input type="text" name="billing_zip" value="{{ billing_zip }}" />
</p>
<p>
<label>Country</label><br />
{{ bison:country_select name="billing_country" selected="{ billing_country }" }}
</p>
</fieldset>
<fieldset>
<legend>Shipping Details</legend>
<p>
<label>First Name</label><br />
<input type="text" name="shipping_first_name" value="{{ shipping_first_name }}" />
</p>
<p>
<label>Last Name</label><br />
<input type="text" name="shipping_last_name" value="{{ shipping_last_name }}" />
</p>
<p>
<label>Address</label><br />
<input type="text" name="shipping_address_1" value="{{ shipping_address_1 }}" />
</p>
<p>
<label>Address Line 2</label><br />
<input type="text" name="shipping_address_2" value="{{ shipping_address_2 }}" />
</p>
<p>
<label>City</label><br />
<input type="text" name="shipping_city" value="{{ shipping_city }}" />
</p>
<p>
<label>State</label><br />
<input type="text" name="shipping_state" value="{{ shipping_state }}" />
</p>
<p>
<label>Zip</label><br />
<input type="text" name="shipping_zip" value="{{ shipping_zip }}" />
</p>
<p>
<label>Country</label><br />
{{ bison:country_select name="shipping_country" selected="{ shipping_country }" }}
</p>
</fieldset>
<fieldset>
<legend>Payment Details</legend>
<p>
<label>Card Number</label><br />
<input type="text" name="number" />
</p>
<p>
<label>CVV</label><br />
<input type="text" name="cvc" />
</p>
<p>
<label>Expiration (MM/YYYY)</label><br />
<input type="text" size="2" name="expiry_month" />
<input type="text" size="4" name="expiry_year" />
</p>
</fieldset>
<p><input type="submit" value="Process Payment" /></p>
{{ endif }}
{{ /bison:checkout_form }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment