From 0cac12b9b51b56efdbe179b7c1c091af1dd908c4 Mon Sep 17 00:00:00 2001 From: Megan O'Keefe Date: Thu, 23 Apr 2020 10:54:43 -0400 Subject: [PATCH] attempt to fix breaking build --- src/frontend/handlers.go | 4 ++-- src/frontend/templates/cart.html | 19 ++++++++++--------- src/frontend/templates/home.html | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/frontend/handlers.go b/src/frontend/handlers.go index 8c9dc4b..065bdb8 100644 --- a/src/frontend/handlers.go +++ b/src/frontend/handlers.go @@ -266,6 +266,8 @@ 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), @@ -276,8 +278,6 @@ 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, diff --git a/src/frontend/templates/cart.html b/src/frontend/templates/cart.html index 4b67cf1..e7fa724 100755 --- a/src/frontend/templates/cart.html +++ b/src/frontend/templates/cart.html @@ -28,8 +28,8 @@ -
+

Begin range items

{{ range $.items }}
@@ -38,20 +38,21 @@ src="{{.Item.Picture}}" />
-

{{.Item.Name}}

-

SKU: #{{.Item.Id}}

+

{{ .Item.Name }}

+

SKU: #{{ .Item.Id }}

- Quantity: {{.Quantity}}
+ Quantity: {{ .Quantity }}
- {{ renderMoney .Price}} + {{ renderMoney .Price }}
- {{ end }} - + {{ end }} +

End range items

+

Begin checkout

Shipping Cost: {{ renderMoney .shipping_cost }}

@@ -59,7 +60,6 @@
-

Checkout

@@ -140,7 +140,7 @@
-
@@ -150,6 +150,7 @@ +

End checkout, if items

{{ end }} diff --git a/src/frontend/templates/home.html b/src/frontend/templates/home.html index 022ac05..1461ec2 100755 --- a/src/frontend/templates/home.html +++ b/src/frontend/templates/home.html @@ -32,7 +32,7 @@
- - {{ renderMoney .Price }} - + {{ renderMoney .Price }}