code: func (ctrl Controller) UpdateCart(w http.ResponseWriter, req *http.Request) {
  	var (
  		input updateCartInput
  		tx    = utils.GetDB(req)
  	)
  
  	req.ParseForm()
  	decoder.Decode(&input, req.PostForm)
  
  	order := getCurrentOrder(w, req)
  
  	if input.Quantity > 0 {
  		tx.Where(&orders.OrderItem{OrderID: order.ID, SizeVariationID: input.SizeVariationID}).
  			Assign(&orders.OrderItem{Quantity: input.Quantity}).
  			FirstOrCreate(&orders.OrderItem{})
  	} else {
  		tx.Where(&orders.OrderItem{OrderID: order.ID, SizeVariationID: input.SizeVariationID}).
  			Delete(&orders.OrderItem{})
  	}
  
  	responder.With("html", func() {
  		http.Redirect(w, req, "/cart", http.StatusFound)
  	}).With([]string{"json", "xml"}, func() {
  		config.Render.JSON(w, http.StatusOK, map[string]string{"status": "ok"})
  	}).Respond(req)
  }
docs: // UpdateCart update shopping cart