Professional Documents
Culture Documents
1. Create Profile
2. Profile Home
3. Menu Page – Gridview (Backend query)
4. Product Details
5. Checkout page
1. Click
2. Select MenuItems collection
3. Click Add Document button
4. Type in:
a. Name: Espresso
b. Description: a Colombian blend with hints of chocolate
c. Price: 250
d. productPhoto: add a URL for a photo, choose most appropriate one
e. Leave the rest blank – then click Add Document
f. Name: Tea
g. Description: calming green tea and honey
h. Price: 150
i. productPhoto: add a URL for a photo, choose most appropriate one
j. Leave the rest blank – then click Add Document
CONNECTING DATABASE TO UI
(Step 5 is to make sure that the item from this cart will be attributed to the user who logged in)
6. Set all the necessary display to describe this item to be connected to the database
(productSelection parameter).
7. ADD ACTION
8. Select Add To Cart button, open the action editor.
9. First action: Backend Call – Create Document; Collection: itemDetail
10. Set fields:
a. name: From Variable – productSelection; Document Properties: name
b. description: From Variable – productSelection; Document Properties: description
c. price: From Variable – productSelection; Document Properties: price
d. quantity: From Variable – Widget State-#CountController
e. cartRef: UNSET-Carts Document – Reference (Carts ref)
f. menuitemRef: UNSET-productSelection; Document Properties: Reference
g. modifiers: List Update Type: Set Value
i. UNSET: Widget state – modifiers
ii. CONFIRM
h. modifiers_1: List Update Type: Set Value
i. UNSET: Widget state – modifiers_2
ii. CONFIRMS
i. menuitemPhot: Type Image Path – Field: menuitemPhoto
i. From Variable:
ii. UNSET: - productSelection
iii. Document Properties: productPhoto
11. ADD ACTION
12. Backend Call – Update Document
13. UNSET: Carts Document – Reference (Carts ref)
14. Click add fields to populate necessary fields to be updated
a. itemCount:
i. Value Source: Update (Increment, Delete, etc)
ii. Firestore Field Value: Increment
iii. Increment Value-Value Source: From Variable
iv. UNSET: widget state - #CountController
b. cartActive:
i. Value Source: Specific Value
ii. Value: True
c. subtotal: (will be changed later)
i. Value Source: Update (Increment, Delete, etc)
ii. Firestore Field Value: Increment
iii. Value Source: From Variable
iv. UNSET: productSelection
v. Document Properties: price
vi. CONFIRM
d. Go back to your first action “Action 1 – Backend Call – Create Document”
i. Action Output Variable Name: type iteminCart
e. Go to your second action “ Action 2 – Backend Call – Update Document”
f. cartItems:
i. List Update Type: Add to Set
ii. Click UNSET
iii. Action Outputs: iteminCart
iv. Chose: Reference
15. ADD ACTION
16. Navigate to: Check out page
17. Set up your back icon/button – to navigate back
ii.
iii. Change Variable from “Parameter: productSelection” to Custom Function
1. Click Create New Function
2.
10. Type
a. return quantity * price;
11. If you want to test it, click on Test Tab
12. Input value to quantity and price then click Run button to test if your
function is working properly.
13. If YES, click SAVE button
14. You have to change this
k.
l. Click Save
m.
n. Set subtotal
i. Value Source: From Variable
ii. UNSET: Carts Document – subtotal
o. Set tax
i. Value Source: Specific Value
ii. Value: 1.8
p. Set shipping
i. Value Source: Specific Value
ii. Value: 4.99
iii. CONFIRM
9. You can now try and test your app.