September 2018
Intermediate to advanced
398 pages
9h 43m
English
To update the quantity of a product in the cart, an HTML input text is used. As soon as the value is changed, we update the database with the new value. The onchange() event of the input text is used for this purpose.
It should come as no surprise that, in CartDiv, as we did previously, we delegate the call to UIManager, as shown in the following code:
private def changeQty() = () => UIManager.updateProduct(product)
The implementation of updateProduct is as follows:
def updateProduct(productCode: String): JQueryDeferred = {
putInCart(product.code, quantity(product.code))
}
We call the web service using the quantity set in inputText. The method to get the quantity is as follows:
private def quantity(productCode: String) ...
Read now
Unlock full access