This template allows the user to choose their shipping address during the checkout process
General Shipping references
Term | Data Type | Typical Output | Description |
---|---|---|---|
basket.is_domain | boolean | True / false | Determines if there are extra steps to make, Sagepay only |
form_select_countries | html | <select.. | HTML Form drop down for country |
form_select_reg_type | html | <select.. | HTML Form drop down for registration type for domain names |
address_list (array)
address_list contents can only be accessed via a loop. Each subarray contains the following references.
Term | Data Type | Typical Output | Description |
---|---|---|---|
title | varchar | Shipping to… | The address heading |
default_message | varchar | This is both your billing and shipping address.. | If the shipping module is set, this message will be displayed |
is_supported | boolean | true / false | Determines if the adress is supported by the shipping module |
address.address_firstname | varchar | Firstname | Address firstname |
address.address_lastname | varchar | Lastname | Address lastname |
address.address_company | varchar | My Company Inc | Company name |
address.address_line_1 | varchar | 1234 Westwood Blvd | Address line 1 |
address.address_line_2 | varchar | Optional | Address line 2 |
address.address_city | varchar | San Francisco | Address city |
address.address_postcode | varchar | CA 90000 | The plain text postcode / zipcode |
address.address_county | varchar | Calfornia | County or state |
address.address_country | varchar | USA | The country |
address.countries_id | int | 4 | The country id for this country |
address.address_book_id | int | 65 | The address book id for this address |
address.button_name | varchar | Ship to this CA 9000 | Text for ship to button |
reg_type | varchar | Individual | The registration type, used for Domain names only |
shipping.name | varchar | Courier Name / Service | The shipping name |
shipping.weight_kg | varchar | 6.4 | The shipping weight |
shipping.surcharge | varchar | $3.00 | Shipping surcharge formmated to currency used |
order.sub_total | varchar | $52.00 | Order sub total formmated to currency used |
shipping.total | varchar | $5.00 | Shipping total formmated to currency used |
order.tax | varchar | $3.00 | Order tax total formmated to currency used |
order.total | varchar | $55.00 | Order total formmated to currency used |
Usage
{% for address in address_list %} <tr><th colspan="2">{{ address.title|raw }} : {{ address.address.address_postcode }} {{ address.default_message|raw }}</th></tr> {% if address.is_supported %} <tr{% if address.is_default %} class="highlight"{% endif %}> <td class="clear" > <div class="address"> <strong>{{ address.address.address_firstname }} {{ address.address.address_lastname }}</strong><br /> {{ address.address.address_company }}<br /> {{ address.address.address_line_1 }}<br /> {{ address.address.address_line_2 }}<br /> {{ address.address.address_city }}<br /> <strong>{{ address.address.address_county }}</strong><br /> {{ address.address.address_postcode }}<br /> {{ address.address.address_country }}<br /><br /> </div></td> <td class="clear" > <div class="shipping_cost">' {% if basket.is_domain %} <strong>Reg Type:</strong>{{ address.reg_type }}<br /> {% if address.reg_type != "Individual" %} <strong>Company No:</strong>{{ address.address.address_company_no }}<br /> <strong>Company:</strong>{{ address.address.address_company }}<br /> {% endif %} <br /> {% else %} <strong>Shipping to: {{ address.address.address_postcode }}</strong> using <br /><strong>{{ address.shipping.name }}</strong><br /><br /> SubTotal: {{ address.order.sub_total|raw }}<br /> Weight: {{ address.shipping.weight_kg|raw }}kg<br /> Shipping: {{ address.shipping.total|raw }}<br /> {% if address.shipping.surcharge %} Surcharge: {{ address.shipping.surcharge|raw }} <br /> {% endif %} {% endif %} VAT @{{ tax_rate }}%: {{ address.order.tax|raw }}<br /><br /> Total: <strong>{{ address.order.total|raw }}</strong> </div></td> </tr><tr{% if is_default %} class="highlight"{% endif %}> <td align="left"> <form method="post" action="checkout_shipping.php"> {{ form_field_seed|raw }} <input type="hidden" value="set_shipping_address" id="action" name="action" /> <input type="hidden" value="{{ address.address.countries_id }}" id="action" name="shipping_country_id" /> <input type="hidden" value="{{ address.address.address_postcode }}" id="action" name="shipping_postcode" /> <input type="hidden" value="{{ address.address.address_book_id }}" id="action" name="shipping_address_id" /> <input type="submit" class="submit" value="{{ address.button_name }}" /> </form> </td> <td> <form method="post" action="checkout_shipping.php"> {{ form_field_seed|raw }} <input type="hidden" value="set_billing_address" id="action" name="action" /> <input type="hidden" value="{{ address.address.address_book_id }}" id="action" name="billing_address_id" /> <input type="submit" class="submit_green" value="Set as Billing Address" /></form> </td></tr> <tr> <td colspan="2"> </td> </tr> {% else %} <td colspan="2"><p>No Shipping is available to this address. Please add an alternative address, or contact us for guidance.</p></td> </tr> {% endif %} {% endfor %}
Comments
0 comments
Please sign in to leave a comment.