checkout
Page for completing an order
Checkout Page Overview
This page is ordered to process an order on the platform. Users can use the checkout page if they have one or more items in their Cart. Non-logged in users can access the checkout page, but will be asked to sign up or log in before processing a payment. This page used several Do when...
workflows to appropriately navigate the user through the checkout form.
Key Workflows
Button Place Order is clicked
Initiates the payment attempt by running the Charge a user using saved CC action
If the payment is successful, the workflow will create a new
Order
instance and run thePayment success
custom workflowWhen creating the new Order, we refer directly to the payment action to grab a field fields -
Charge Id
andAmount charged
All
Orders
should havePaid?
set to yes and thePayment date
field populatedAddress fields are saved to populate the order confirmation reusable and to pre-populate the address for future checkouts
CC fields are saved to populate the order confirmation reusable
Button Remove Line Item is clicked
Deletes the
Line item
from the user'sCart
If the user's
Cart
contains no Line items after this one is deleted, theCart
will be deleted and the user will be redirected from the checkout page
[Custom] Payment success
This is triggered following a successful payment for the order
Updates the
Cart
'sPaid?
to yes as well as populates a few other price fieldsUpdating the
Cart
'sPaid?
field is important - as thisCart
will no longer be used for future functionality
Deletes all unpaid Carts (
Paid?
set to no) linked to the userThe application should only save paid
Carts,
as these are used for reference purposes on the user's settings page
Updates the
Cart
'sLine items
Updates the
Cart
'sProducts
Total in stock
andTold sold
fieldsSends an order confirmation email to both the customer and app admins
[Custom] Payment failure
Triggered when
Button Place Order has an error running a workflow
Notifies the user of the payment error
Page is loaded and Current User isn’t logged in
Sets the
temp cart
state to the user's current cartThis used to store the relevant
Cart
for logged out usersWhen a user logs in or signs up - on either step 1 or step 2 - we run the
Transfer cart
custom workflow, which utilizes thetemp cart
User is logged in and progressbar Main’s step # is 1 and checkout’s temp cart is not empty
Triggered when the user logs in during the initial step of the checkout process
Triggers the
Transfer cart
custom workflow
User is logged in and progressbar Main’s step # is 2
Triggered when the user signs up or logs in using the form on step 2 of the checkout process
Triggers the
Transfer cart
custom workflowAdvances to the next step of the checkout process
User is logged out and Search for Carts:first item is empty
Triggered if no
Cart
has been created for the current logged out userRedirects the user to the index page
Do when Search for Carts:first item is empty and checkout’s temp cart is empty and Group Tab 4’s Order is empty
Triggered when there is no
Cart
active for the current userRedirects the user to the index page
[Custom] Transfer cart
Used to transfer the
Cart
from the logged out user to the logged in userDeletes every
Cart
besides thetemp cart
for the current user (these are no longer necessary)
Key Elements
var - cart subtotal
Used in the calculations for the payment workflows
Calculated by taking the sum of each
Line item
'sQuantity
multiplied by itsProduct
'sPrice
var - shipping cost
Used in the calculations for the payment workflows
Pulls the
App fee (shipping)
value from theWebsite
object
RepeatingGroup Line Items (Cart)
Contains every
Line item
for the current user'sCart
Last updated