From 05758f56b859b733d54728edab354c00fbe712f6 Mon Sep 17 00:00:00 2001 From: Megan O'Keefe <3137106+askmeegs@users.noreply.github.com> Date: Wed, 6 May 2020 09:22:02 -0400 Subject: [PATCH] Hide currency conversion after checkout (#343) --- src/frontend/handlers.go | 6 ++++-- src/frontend/templates/header.html | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/frontend/handlers.go b/src/frontend/handlers.go index b6bd93d..f76fad5 100644 --- a/src/frontend/handlers.go +++ b/src/frontend/handlers.go @@ -88,6 +88,7 @@ func (fe *frontendServer) homeHandler(w http.ResponseWriter, r *http.Request) { "session_id": sessionID(r), "request_id": r.Context().Value(ctxKeyRequestID{}), "user_currency": currentCurrency(r), + "show_currency": true, "currencies": currencies, "products": ps, "cart_size": cartSize(cart), @@ -165,6 +166,7 @@ func (fe *frontendServer) productHandler(w http.ResponseWriter, r *http.Request) "request_id": r.Context().Value(ctxKeyRequestID{}), "ad": fe.chooseAd(r.Context(), p.Categories, log), "user_currency": currentCurrency(r), + "show_currency": true, "currencies": currencies, "product": product, "recommendations": recommendations, @@ -266,8 +268,6 @@ func (fe *frontendServer) viewCartHandler(w http.ResponseWriter, r *http.Request } totalPrice = money.Must(money.Sum(totalPrice, *shippingCost)) - log.Info("🌈 ITEMS: %v", items) - year := time.Now().Year() if err := templates.ExecuteTemplate(w, "cart", map[string]interface{}{ "session_id": sessionID(r), @@ -277,6 +277,7 @@ func (fe *frontendServer) viewCartHandler(w http.ResponseWriter, r *http.Request "recommendations": recommendations, "cart_size": cartSize(cart), "shipping_cost": shippingCost, + "show_currency": true, "total_cost": totalPrice, "items": items, "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), "request_id": r.Context().Value(ctxKeyRequestID{}), "user_currency": currentCurrency(r), + "show_currency": false, "currencies": currencies, "order": order.GetOrder(), "total_paid": &totalPaid, diff --git a/src/frontend/templates/header.html b/src/frontend/templates/header.html index bf68d31..83bc31e 100755 --- a/src/frontend/templates/header.html +++ b/src/frontend/templates/header.html @@ -21,6 +21,9 @@ + {{end}} \ No newline at end of file