This commit is contained in:
Aritra Banik 2024-03-11 21:28:25 +05:30
parent 391a47d4eb
commit 5a1ec3c3ee
4 changed files with 4 additions and 5 deletions

Binary file not shown.

BIN
src/a3

Binary file not shown.

View File

@ -129,13 +129,13 @@ proc sendPhone*(phone: string, input: Validity): string =
</div>
"""
proc sendCheckOut*(val: Table[string, Validity], total: string): string =
proc sendCheckOut*(val: Table[string, Validity], total: string, productName: string, quantity: int): string =
result = fmt"""
<div class="container" id="change">
<div class="row mb-5">
<div class="col-md-12">
<div class="border p-4 rounded" role="alert">
Returning customer? <a href="/login?prod={{productName}}&quantity={{quantity}}" onclick="login()">Click here</a> to login
Returning customer? <a href="/login?prod={productName}&quantity={quantity}" onclick="login()">Click here</a> to login
</div>
</div>
</div>

View File

@ -22,7 +22,6 @@ proc validationCheckOut*(ctx: Context) =
productName = form.getOrDefault("prod", "")
quantity = parseInt(form.getOrDefault("quantity", "0"))
var
country = form["c_country"]
firstName = form["c_fname"]
lastName = form["c_lname"]
@ -107,7 +106,7 @@ proc validationCheckOut*(ctx: Context) =
products.add(product)
cart.add(ca)
ctx.send(sendCheckOut(validity, totalPriceHTML(products, cart)))
ctx.send(sendCheckOut(validity, totalPriceHTML(products, cart), productName, quantity))
proc validationLName*(ctx: Context) =
var lname = ctx.urlForm["c_lname"]