-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCheckout.cshtml
232 lines (220 loc) · 11 KB
/
Checkout.cshtml
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
@using Foundation.Features.Checkout.ViewModels
@model CheckoutViewModel
@{
var errorMessages = ViewBag.ErrorMessages != null ? (string)ViewBag.ErrorMessages : string.Empty;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.min.js" integrity="sha512-nhY06wKras39lb9lRO76J4397CH1XpRSLfLJSftTeo3+q2vP7PaebILH9TqH+GRpnOhfAGjuYMVmVTOZJ+682w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="/js/common/Klarna.Payments.js"></script>
<script src="https://x.klarnacdn.net/kp/lib/v1/api.js" async></script>
<div class="col-12">
<h3 class="checkout-title">SECURE CHECKOUT</h3>
</div>
@if (!string.IsNullOrEmpty(errorMessages))
{
<div class="col-12 error">
<p>@errorMessages</p>
</div>
}
@using (Html.BeginForm("PlaceOrder", "Checkout", FormMethod.Post, new { @class = "row jsCheckoutForm", id = "jsCheckoutForm", novalidate = "novalidate" }))
{
@Html.AntiForgeryToken()
@Html.HiddenFor(x => x.AuthorizationToken)
<div class="col-md-8 col-xs-12">
<div class="card items border-radius-none">
<div class="card-body flex-between">
@if (Context.Request.Headers["UrlReferrer"].ToString() != null)
{
<a class="button-white" href="@Context.Request.Headers["UrlReferrer"].ToString()">Back</a>
}
@if (Context.User.Identity.IsAuthenticated)
{
<button class="button-black" type="button" data-bs-toggle="modal" data-bs-target="#newAddressModal">Add New Address</button>
}
</div>
</div>
<br />
@await Html.PartialAsync("ShippingInformation", Model)
<div class="card items border-radius-none">
<div class="card-body">
@await Html.PartialAsync("BillingInformation", Model)
</div>
</div>
<br />
<div class="card items border-radius-none">
<div class="card-body">
@await Html.PartialAsync("Subscription", Model)
</div>
</div>
</div>
<div class="col-md-4 col-xs-12">
<div class="card summary border-radius-none">
<div class="card-body">
@await Html.PartialAsync("_Coupon", Model)
<div class="row">
<div class="col-12 jsOrderSummary">
@await Html.PartialAsync("_OrderSummary", Model.OrderSummary)
</div>
</div>
<div class="row">
<div class="col-12">
<button type="submit" class="button-black full-width">Place Order</button>
</div>
</div>
</div>
</div>
</div>
}
<div class="modal fade" id="shipmentListing" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content square-box">
<div class="modal-header">
<h5 class="modal-title">Select shipment</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body user-menu">
<input type="hidden" id="lineItemInfomation" data-url="@Url.Action("SeparateShipment")" data-code="" data-shipmentid="" data-qty="" data-store="delivery" data-selectedstore="" />
@for (var i = 0; i < Model.Shipments.Count; i++)
{
<div class="row">
<div class="col-12">
<a href="#" class="button-white full-width jsSelectShipment" data-shipmentid="@Model.Shipments[i].ShipmentId">Shipment @(i + 1)</a>
</div>
</div>
<br />
}
<div class="row">
<div class="col-12">
<a href="#" class="button-white full-width jsSelectShipment" data-shipmentid="0">New Shipment</a>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="button-black full-width" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="newAddressModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
@using (Html.BeginForm("AddAddress", "Checkout", FormMethod.Post, new { @class = "jsFormNewAddress" }))
{
@Html.AntiForgeryToken()
@Html.Hidden("AddressReturnUrl", Url.Action("Index", "Checkout"), new { @class = "jsAddressReturnUrl" })
<div class="modal-content square-box">
<div class="modal-header">
<h5 class="modal-title">New Address</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body user-menu">
<ul class="style-list-none">
<li>
<div class="row">
<div class="col-12 jsAddressError">
</div>
</div>
</li>
<li>
<div class="row">
<div class="form-group col-12">
@Html.Label("Name")
@Html.TextBox("Name", "", new { @class = "textbox", autofocus = "autofocus" })
</div>
</div>
</li>
<li>
<div class="row">
<div class="form-group col-xs-12 col-md-6">
@Html.Label("FirstName")
@Html.TextBox("FirstName", "", new { @class = "textbox" })
</div>
<div class="form-group col-xs-12 col-md-6">
@Html.Label("LastName")
@Html.TextBox("LastName", "", new { @class = "textbox" })
</div>
</div>
</li>
<li>
<div class="row">
<div class="form-group col-xs-12 col-md-6">
@Html.Label("Email")
@Html.TextBox("Email", "", new { @class = "textbox" })
</div>
<div class="form-group col-xs-12 col-md-6">
@Html.Label("Organization")
@Html.TextBox("Organization", "", new { @class = "textbox" })
</div>
</div>
</li>
<li>
<div class="row">
<div class="form-group col-xs-12 col-md-6">
@Html.Label("Line1")
@Html.TextBox("Line1", "", new { @class = "textbox" })
</div>
<div class="form-group col-xs-12 col-md-6">
@Html.Label("Line2")
@Html.TextBox("Line2", "", new { @class = "textbox" })
</div>
</div>
</li>
<li>
<div class="row">
<div class="form-group col-xs-12 col-md-6">
@Html.Label("City")
@Html.TextBox("City", "", new { @class = "textbox" })
</div>
<div class="form-group col-xs-12 col-md-6">
@Html.Label("PostalCode")
@Html.TextBox("PostalCode", "", new { @class = "textbox" })
</div>
</div>
</li>
<li>
<div class="row">
<div class="form-group col-xs-12 col-md-6 jsCountryRegionContainer">
<label>Country/Region</label>
<input type="hidden" class="jsRegionName" value="CountryRegion.Region" )" />
@{
var regionValues = new List<KeyValuePair<string, string>>();
foreach (var a in Model.BillingAddress.CountryRegion.RegionOptions)
{
regionValues.Add(new KeyValuePair<string, string>(a, a));
}
}
@(await Component.InvokeAsync("Dropdown", new { list = regionValues,
selectedValue = "",
selectorClassItem = "jsRegionSelectionContainer",
name = "CountryRegion.Region"
}))
</div>
<div class="form-group col-xs-12 col-md-6 jsCountrySelectionContainer">
<label>Country</label>
@{
var countryValues = new List<KeyValuePair<string, string>>();
foreach (var a in Model.BillingAddress.CountryOptions)
{
countryValues.Add(new KeyValuePair<string, string>(a.Name, a.Code));
}
}
@(await Component.InvokeAsync("Dropdown", new { list = countryValues,
selectedValue = "",
selectorClassItem = "",
name = "CountryCode"
}))
</div>
</div>
</li>
</ul>
</div>
<div class="modal-footer flex-between">
<button type="button" class="button-black jsSaveAddress">Save</button>
<button type="button" class="button-white" data-dismiss="modal">Close</button>
</div>
</div>
}
</div>
</div>