package templates import ( "fmt" "git.ma-al.com/goc_marek/ps_shop/internal/viewmodel" ) templ CartPage(data viewmodel.CartPageData, cssPath string, jsPath string) { @Layout("Cart", cssPath, jsPath, data.Menu, data.Locale, data.Cart.TotalItems) {

Cart overview

Everything ready for checkout.

Review quantities, adjust variants, and keep the final order state visible before handing off checkout to PrestaShop.

Line items

{ fmt.Sprintf("%d", len(data.Cart.Items)) }

Units total

{ fmt.Sprintf("%d", data.Cart.TotalItems) }

if data.Customer != nil { { fmt.Sprintf("%s %s", data.Customer.FirstName, data.Customer.LastName) } } else { Guest session } { "Subtotal " + moneyWithCurrency(data.Cart.SubtotalTaxIncl, cartCurrencySign(data), cartCurrencyCode(data)) }
if len(data.Cart.Items) == 0 {

Empty

Your cart is empty.

Browse categories or return to a product page to add items and build a full order before checkout.

} else {
for _, item := range data.Cart.Items {
if item.ImageURL != "" {
{
}

Product

if cartItemAttributeLabel(item) != "" { { cartItemAttributeLabel(item) } }
if item.URL != "" { { item.Name } } else {

{ item.Name }

}
{ fmt.Sprintf("Qty %d", item.Quantity) } { "Net " + moneyWithCurrency(item.UnitPrice, item.CurrencySign, item.CurrencyCode) } { taxLabel(item.TaxRate) }
if cartItemAttributeLabel(item) != "" {

{ cartItemAttributeLabel(item) }

}

Line total

{ moneyWithCurrency(item.LineTotalTaxIncl, item.CurrencySign, item.CurrencyCode) }

{ conversionRateLabel(item.ConversionRate, item.CurrencyCode) }

}
}
} }