O'Reilly logo

Isomorphic Go by Kamesh Balasubramanian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing the shopping cart templates

We will use the shopping cart page template in order to render the shopping cart on the server side. Here are the contents of the shopping cart page template, as defined in the shared/templates/shopping_cart_page.tmpl source file:

{{ define "pagecontent" }}{{template "shopping_cart_content" . }}{{end}}{{template "layouts/webpage_layout" . }}

As you may have noticed, the shopping cart page template calls a shopping_cart_content subtemplate, which is responsible for rendering the shopping cart itself.

Here are the contents of the shopping cart content template, as defined in the shared/templates/shopping_cart_content.tmpl source file:

<h1>Shopping Cart</h1>{{if .Products }}{{range .Products}} ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required