You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: templates/ecommerce/README.md
+24-2Lines changed: 24 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,14 +119,24 @@ Basic access control is setup to limit access to various content based based on
119
119
-`carts`: Customers can access their own saved cart, guest users can access any unclaimed cart by ID.
120
120
-`addresses`: Customers can access their own addresses for record keeping.
121
121
-`transactions`: Only admins can access these as they're meant for internal tracking.
122
-
-`orders`: Only admins and users who own the orders can access these.
122
+
-`orders`: Only admins and users who own the orders can access these. Guests require a valid `accessToken` (sent via email) along with the order's email to view order details.
123
123
124
124
For more details on how to extend this functionality, see the [Payload Access Control](https://payloadcms.com/docs/access-control/overview#access-control) docs.
125
125
126
126
## User accounts
127
127
128
+
Registered users can log in to view their order history, manage saved addresses, and track ongoing orders directly from their account dashboard.
129
+
128
130
## Guests
129
131
132
+
Guest checkout allows users to complete purchases without creating an account. When a guest places an order:
133
+
134
+
1. The order is associated with their email address
135
+
2. A unique `accessToken` is generated for secure order lookup
136
+
3. An order confirmation email is sent containing a secure link to view the order
137
+
138
+
To look up an order as a guest, users visit `/find-order`, enter their email and order ID, and receive an email with a secure access link. This prevents order enumeration attacks where malicious users could iterate through sequential order IDs to access other customers' order information.
139
+
130
140
## Layout Builder
131
141
132
142
Create unique page layouts for any type of content using a powerful layout builder. This template comes pre-configured with the following layout building blocks:
@@ -173,7 +183,19 @@ This template comes with SSR search features can easily be implemented into Next
173
183
174
184
Transactions are intended for keeping a record of any payment made, as such it will contain information regarding an order or billing address used or the payment method used and amount. Only admins can access transactions.
175
185
176
-
An order is created only once a transaction is successfully completed. This is a record that the user who completed the transaction has access so they can keep track of their history. Guests can also access their own orders by providing an order ID and the email associated with that order.
186
+
An order is created only once a transaction is successfully completed. This is a record that the user who completed the transaction has access so they can keep track of their history.
187
+
188
+
### Guest Order Access
189
+
190
+
Guest users can securely access their orders through the `/find-order` page:
191
+
192
+
1. Guest enters their email address and order ID
193
+
2. If the order exists and matches the email, an access link is sent to their email
194
+
3. The link contains a secure `accessToken` that grants temporary access to view the order
195
+
196
+
This email verification flow prevents unauthorized access to order details. The `accessToken` is a unique UUID generated when the order is created and is required (along with the email) to view order details as a guest.
197
+
198
+
**Security note:** Order confirmation emails should include the order ID so guests can use the "Find Order" feature. The access token is only sent via the verification email to prevent enumeration attacks.
0 commit comments