wCart Tutorial part 9. Shopping Cart Quantity Functionality

  1. With cart.html open toggle App Connect Mode (1) , select the cell containing the quantity (2) and remove any text (3) inside the cell

  2. With the Cell (1) still selected, remove the Inner Text (2) that we created previously.

  3. With the cell still selected, right click the Cell (1), in the pop-up choose Forms (2) and Text Input (3)

4 Select the Text Input (1), assign an ID (2), a Name (3) and change the size to Small (4)

  1. With the Text Input (1) still selected, click on the Styles tab(2), enter the element.style (3) as width: 4em;. Click on App Structure (4) to return.

  2. With the Text Input (1) still selected, click on Dynamic Attributes (2)

  3. In the pop-up, select Value (1)

  4. With the Text Input (1) still selected, click the Value thunder bolt (2)

  5. In the pop-up, select qty (1) under Table Body and remove items. (2). Click Select (3) to apply the binding

  6. Withe the Text Input (1) still selected, click on Dynamic Events (2)

  7. In the pop-up, choose Keyboard (1) and Key Up (2)

  8. With the Text Input (1) still selected, click the Action button (2)

  9. In the pop-up, choose arrCart (1), Replace Item At (2), Add Column (3), click the Action item (4) and Index (5)

  10. Under Table Body (1) choose $index (2) and Select (3)

  11. For the New Value (1) enter the following:
    {product:product,price:price,qty:value}

  12. To replace the Subtotal value, under arrSubtotal (1), choose Replace Item At (2), Add Column (3) click the new action (4) and Index (5)

  13. Under Table Body (1), select $index (2) and Select (3)

  14. Select the New Value thunder bolt (1)

  15. Under Text Input (1), select value (2) and click the format button (3)

  16. Right click value (1) and choose Operation (2)

  17. Change the Operation (1) to a multiplication (2)

  18. Choose the arrow (1) and click the Value thunder bolt (2)

  19. Under Table Body (1), choose price (2) and remove items. (3). Click Select (4)

  20. Right click price (1), choose Conversion (2) and To Number (3)

  21. Choose Select (1)

  22. Choose Select (1)

  23. Choose Select (1)

  24. Choose the last Cell (1) and the Value thunderbolt (2)

  25. Under Table Body (1) choose the value (2) of the Text Input and click the format button (3)

  26. Right click inp_quantity (1) and select Operation (2)

  27. Change the Operation (1) to a multiplication (2)

  28. Select the arrow (1) and click the Value thunder bolt (2)

  29. Under Table Body (1), select price (2) and remove items. (3). Click Select (4)

  30. Right click price (1), select Conversion (2) and To Number (3)

  31. Right click To Number (1), select Numeric (2) and Format Currency (3)

  32. Format the Currency to suit and click Select (1)

  33. Click Select (1)

  34. Unfortunately, I just cannot get used to the more complicated bindings. We will have to do some manual work in Code view. In this case change
    inp_quantity.value * (price.toNumber().formatCurrency("$", ".", ",", "2"))
    to
    (inp_quantity.value * (price.toNumber())).formatCurrency("$", ".", ",", "2")

  35. Don’t forget to save your work.

Next Part

Community Page
Last updated: