forked from FoxyCart/2.0-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
address.receipt.inc.twig
119 lines (113 loc) · 5.67 KB
/
address.receipt.inc.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
{% set show_first_name = true %}
{% set show_last_name = true %}
{% set show_address1 = true %}
{% set show_address2 = true %}
{% set show_city = true %}
{% set show_region = true %}
{% set show_postal_code = true %}
{% set show_country = true %}
{% if address.type == 'billing' %}
{% if config.template_config.custom_checkout_field_requirements['billing_first_name'] == 'hidden' %}
{% set show_first_name = false %}
{% endif %}
{% if config.template_config.custom_checkout_field_requirements['billing_last_name'] == 'hidden' %}
{% set show_last_name = false %}
{% endif %}
{% if config.template_config.custom_checkout_field_requirements['billing_address1'] == 'hidden' %}
{% set show_address1 = false %}
{% endif %}
{% if config.template_config.custom_checkout_field_requirements['billing_address2'] == 'hidden' %}
{% set show_address2 = false %}
{% endif %}
{% if config.template_config.custom_checkout_field_requirements['billing_city'] == 'hidden' %}
{% set show_city = false %}
{% endif %}
{% if config.template_config.custom_checkout_field_requirements['billing_region'] == 'hidden' %}
{% set show_region = false %}
{% endif %}
{% if config.template_config.custom_checkout_field_requirements['billing_postal_code'] == 'hidden' %}
{% set show_postal_code = false %}
{% endif %}
{% if config.template_config.custom_checkout_field_requirements['billing_country'] == 'hidden' %}
{% set show_country = false %}
{% endif %}
{% endif %}
{% set show_tax_id = false %}
{% if config.template_config.custom_checkout_field_requirements['billing_tax_id'] != 'hidden' %}
{% set show_tax_id = true %}
{% endif %}
{% if (show_first_name or show_last_name) and (address.first_name or address.last_name) %}
<div class="fc-form-group fc-form-group--static fc-form-group--receipt--name">
<label class="fc-form-label fc-container__grid--static-label--name">{{ config.lang.checkout_name|raw }}</label>
<div class="fc-container__grid--static-input--name">
<p class="fc-form-control--static">{{ address.first_name }} {{ address.last_name }}</p>
</div>
</div>
{% endif %}
{% if address.company %}
<div class="fc-form-group fc-form-group--static fc-form-group--receipt--company">
<label class="fc-form-label fc-container__grid--static-label--company">{{ config.lang.checkout_company|raw }}</label>
<div class="fc-container__grid--static-input--company">
<p class="fc-form-control--static">{{ address.company }}</p>
</div>
</div>
{% endif %}
{% if show_tax_id and address.tax_id %}
<div class="fc-form-group fc-form-group--static fc-form-group--receipt--tax-id">
<label class="fc-form-label fc-container__grid--static-label--tax-id">{{ config.lang.checkout_tax_id }}</label>
<div class="fc-container__grid--static-input--tax-id">
<p class="fc-form-control--static">{{ address.tax_id }}</p>
</div>
</div>
{% endif %}
{% if (show_address1 or show_address2 or show_city or show_region or show_postal_code) and (address.city or address.region or address.postal_code or address.address1 or address.address2) %}
<div class="fc-form-group fc-form-group--static fc-form-group--receipt--address">
<label class="fc-form-label fc-container__grid--static-label--address">{{ config.lang.checkout_address|raw }}</label>
{% if (show_address1 or show_address2) and (address.address1 or address.address2) %}
<div class="fc-container__grid--static-input--address">
<p class="fc-form-control--static">
{% if show_address1 and address.address1 %}{{ address.address1 }}{% endif %}
{% if show_address2 and address.address2 %}<br />{{ address.address2 }}{% endif %}
</p>
</div>
{% endif %}
</div>
{% endif %}
{% if (show_city or show_region or show_postal_code) and (address.city or address.region or address.postal_code) %}
<div class="fc-form-group fc-form-group--static fc-form-group--receipt--city-state-postcode">
<div class="fc-container__grid--static-input--city-state-postcode">
<p class="fc-form-control--static">
{% if address.country_name == 'United States' %}
{% if address.city and show_city %}{{ address.city }}{% endif %}{% if address.region and show_region %}{% if address.city and show_city %}, {% endif %}{{ address.region }}{% endif %}{% if address.postal_code and show_postal_code %} {{ address.postal_code }}{% endif %}
{% else %}
{% if address.city_and_region and show_city and show_region %}
{{ address.city_and_region }}
{% elseif address.city and show_city %}
{{ address.city }}
{% elseif address.region and show_region %}
{{ address.region }}
{% endif %}
{% if address.postal_code and show_postal_code %}
{{ address.postal_code }}
{% endif %}
{% endif %}
</p>
</div>
</div>
{% endif %}
{% if show_country %}
<div class="fc-form-group fc-form-group--static fc-form-group--receipt--country">
<label class="fc-form-label fc-container__grid--static-label--country">{{ config.lang.checkout_country|raw }}</label>
<div class="fc-container__grid--static-input--country">
<p class="fc-form-control--static">{{ address.country_name }}</p>
</div>
</div>
{% endif %}
{% if address.phone %}
<div class="fc-form-group fc-form-group--static fc-form-group--receipt--phone">
<label class="fc-form-label fc-container__grid--static-label--phone">{{ config.lang.checkout_phone|raw }}</label>
<div class="fc-container__grid--static-input--phone">
<p class="fc-form-control--static">{{ address.phone }}</p>
</div>
</div>
{% endif %}