Hide currency conversion after checkout (#343)
This commit is contained in:
parent
dbde2f3bff
commit
05758f56b8
2 changed files with 10 additions and 2 deletions
|
@ -88,6 +88,7 @@ func (fe *frontendServer) homeHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
"session_id": sessionID(r),
|
"session_id": sessionID(r),
|
||||||
"request_id": r.Context().Value(ctxKeyRequestID{}),
|
"request_id": r.Context().Value(ctxKeyRequestID{}),
|
||||||
"user_currency": currentCurrency(r),
|
"user_currency": currentCurrency(r),
|
||||||
|
"show_currency": true,
|
||||||
"currencies": currencies,
|
"currencies": currencies,
|
||||||
"products": ps,
|
"products": ps,
|
||||||
"cart_size": cartSize(cart),
|
"cart_size": cartSize(cart),
|
||||||
|
@ -165,6 +166,7 @@ func (fe *frontendServer) productHandler(w http.ResponseWriter, r *http.Request)
|
||||||
"request_id": r.Context().Value(ctxKeyRequestID{}),
|
"request_id": r.Context().Value(ctxKeyRequestID{}),
|
||||||
"ad": fe.chooseAd(r.Context(), p.Categories, log),
|
"ad": fe.chooseAd(r.Context(), p.Categories, log),
|
||||||
"user_currency": currentCurrency(r),
|
"user_currency": currentCurrency(r),
|
||||||
|
"show_currency": true,
|
||||||
"currencies": currencies,
|
"currencies": currencies,
|
||||||
"product": product,
|
"product": product,
|
||||||
"recommendations": recommendations,
|
"recommendations": recommendations,
|
||||||
|
@ -266,8 +268,6 @@ func (fe *frontendServer) viewCartHandler(w http.ResponseWriter, r *http.Request
|
||||||
}
|
}
|
||||||
totalPrice = money.Must(money.Sum(totalPrice, *shippingCost))
|
totalPrice = money.Must(money.Sum(totalPrice, *shippingCost))
|
||||||
|
|
||||||
log.Info("🌈 ITEMS: %v", items)
|
|
||||||
|
|
||||||
year := time.Now().Year()
|
year := time.Now().Year()
|
||||||
if err := templates.ExecuteTemplate(w, "cart", map[string]interface{}{
|
if err := templates.ExecuteTemplate(w, "cart", map[string]interface{}{
|
||||||
"session_id": sessionID(r),
|
"session_id": sessionID(r),
|
||||||
|
@ -277,6 +277,7 @@ func (fe *frontendServer) viewCartHandler(w http.ResponseWriter, r *http.Request
|
||||||
"recommendations": recommendations,
|
"recommendations": recommendations,
|
||||||
"cart_size": cartSize(cart),
|
"cart_size": cartSize(cart),
|
||||||
"shipping_cost": shippingCost,
|
"shipping_cost": shippingCost,
|
||||||
|
"show_currency": true,
|
||||||
"total_cost": totalPrice,
|
"total_cost": totalPrice,
|
||||||
"items": items,
|
"items": items,
|
||||||
"expiration_years": []int{year, year + 1, year + 2, year + 3, year + 4},
|
"expiration_years": []int{year, year + 1, year + 2, year + 3, year + 4},
|
||||||
|
@ -345,6 +346,7 @@ func (fe *frontendServer) placeOrderHandler(w http.ResponseWriter, r *http.Reque
|
||||||
"session_id": sessionID(r),
|
"session_id": sessionID(r),
|
||||||
"request_id": r.Context().Value(ctxKeyRequestID{}),
|
"request_id": r.Context().Value(ctxKeyRequestID{}),
|
||||||
"user_currency": currentCurrency(r),
|
"user_currency": currentCurrency(r),
|
||||||
|
"show_currency": false,
|
||||||
"currencies": currencies,
|
"currencies": currencies,
|
||||||
"order": order.GetOrder(),
|
"order": order.GetOrder(),
|
||||||
"total_paid": &totalPaid,
|
"total_paid": &totalPaid,
|
||||||
|
|
|
@ -21,6 +21,9 @@
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<div class="container d-flex justify-content-between">
|
<div class="container d-flex justify-content-between">
|
||||||
<div class="h-free-shipping">Free shipping with $75 purchase! </div>
|
<div class="h-free-shipping">Free shipping with $75 purchase! </div>
|
||||||
|
|
||||||
|
|
||||||
|
{{ if $.show_currency }}
|
||||||
<div class="h-controls">
|
<div class="h-controls">
|
||||||
<div class="h-control">
|
<div class="h-control">
|
||||||
<img src="/static/icons/Hipster_CurrencyIcon.svg" alt="icon" class="icon" />
|
<img src="/static/icons/Hipster_CurrencyIcon.svg" alt="icon" class="icon" />
|
||||||
|
@ -34,6 +37,8 @@
|
||||||
<img src="/static/icons/Hipster_DownArrow.svg" alt="icon" class="icon arrow" />
|
<img src="/static/icons/Hipster_DownArrow.svg" alt="icon" class="icon arrow" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar sub-navbar">
|
<div class="navbar sub-navbar">
|
||||||
|
@ -53,5 +58,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</header>
|
</header>
|
||||||
{{end}}
|
{{end}}
|
Loading…
Add table
Add a link
Reference in a new issue