diff --git a/src/frontend/handlers.go b/src/frontend/handlers.go index 8d40327..8c9dc4b 100644 --- a/src/frontend/handlers.go +++ b/src/frontend/handlers.go @@ -276,6 +276,8 @@ func (fe *frontendServer) viewCartHandler(w http.ResponseWriter, r *http.Request "cart_size": cartSize(cart), "shipping_cost": shippingCost, "total_cost": totalPrice, + "banner_color": os.Getenv("BANNER_COLOR"), // illustrates canary deployments + "ad": fe.chooseAd(r.Context(), []string{}, log), "items": items, "expiration_years": []int{year, year + 1, year + 2, year + 3, year + 4}, "platform_css": plat.css, @@ -333,10 +335,17 @@ func (fe *frontendServer) placeOrderHandler(w http.ResponseWriter, r *http.Reque totalPaid = money.Must(money.Sum(totalPaid, *v.GetCost())) } + currencies, err := fe.getCurrencies(r.Context()) + if err != nil { + renderHTTPError(log, r, w, errors.Wrap(err, "could not retrieve currencies"), http.StatusInternalServerError) + return + } + if err := templates.ExecuteTemplate(w, "order", map[string]interface{}{ "session_id": sessionID(r), "request_id": r.Context().Value(ctxKeyRequestID{}), "user_currency": currentCurrency(r), + "currencies": currencies, "order": order.GetOrder(), "total_paid": &totalPaid, "recommendations": recommendations, diff --git a/src/frontend/templates/cart.html b/src/frontend/templates/cart.html index 49c6e19..4b67cf1 100755 --- a/src/frontend/templates/cart.html +++ b/src/frontend/templates/cart.html @@ -50,6 +50,8 @@ {{ end }} + +
Shipping Cost: {{ renderMoney .shipping_cost }}