---
# System prepended metadata

title: Untitled

---

Ecommerce template offers a highly efficient and valuable services for online businesses. It guides your customers through buying products. This includes adding a product to cart,  updating product quantity, adding more more products, and proceeding to purchase. Post purchase, customers can track their order status. The template can handle common customer queries and helps connect with the support team if required. 

You can use our platform to build custom flows for your business use cases. For example, promote products, show store location, showcase products from your database, enable single sign-on from your ecommerce site, and more.


### Browse products 


The flow shows the list of product categories and products within each category and guides users through purchasing products.

<img src="https://i.imgur.com/WC6UXHT.png" alt="drawing" width="50%"/>

1. Starts with the intent *View available products*.

![](https://i.imgur.com/SOGbfgb.png)


2. **Verifies channel**: Applies the **Channel filter** to check if the user is from YellowMessenger or from other channel. 
3. Uses the **Function** node to fetch the list of product categories from the  **Database**.
    If the channel is WhatsApp, it shows the list of product categories using the **WhatsApp list** node. 
   4. On selecting the product category, it shows the list of products of that category.
   For WhatsApp channel, it uses Function, Variables, and Modifier nodes to display the list of products. 
![](https://i.imgur.com/SOGbfgb.png)


### 1. Add to cart 

When the bot user selects a product to be added in the cart, this flow gets triggered. These products are stored in the cart(database) and they can be ordered by the user at any point in the flow. 

<img src="https://i.imgur.com/AEjB5IR.png" alt="drawing" width="45%"/> <img src="https://i.imgur.com/R3pbJ69.png" alt="drawing" width="45%"/>




1. **Start trigger**: Triggered when the user selects Add to cart on the Browse porducts flow. 
2. **Select number of packs**: Each product is associated with the product ID, [condition node](https://docs.yellow.ai/docs/platform_concepts/studio/build/nodes/logic-nodes/#1-condition) identifies the product ID and displays option to select the number of packs (quantity) the user would like to order. These options are configured seperatly for WhatsApp and web(whatsapp list/quick replies). AddtoCart and FormatCartSummary functions update the Quantity value for that Product ID. 

![](https://i.imgur.com/uBkNFAg.png)

3. **Add to cart and display summary**: Verifies the number of packs and product ID and stores it in the user database(cart). Cart summary is displayed (Price associated with the Product ID * Number of packs = Total Price).

![](https://i.imgur.com/uncWUhL.png)

4. **Next action (Buy/Edit/Clear cart or Browse products)**: Cart summary is displayed with options(quick replies) to [Buy now](#linktotheflow), [Edit cart](#linktotheflow), [Clear cart](#linktotheflow) and [Add more products](#linktotheflow). Clicking on these buttons will trigger the respective flows. 


![](https://i.imgur.com/wW9pPJP.png)


### Edit cart

In this flow, user can edit the cart details (edit the number of packs added per item in the cart or remove the product from the cart).


<img src="https://i.imgur.com/mO9zNsv.png" alt="drawing" width="45%"/>
<img src="https://i.imgur.com/P6wiPjS.png" alt="drawing" width="45%"/>




1. **Start trigger**: Triggered when **Edit cart** is selected on the **Add to cart** flow. 
2. **Check the cart**: IsCartEmpty function and Conditional node are used to check if the cart is empty. If it is empty, the user will be directed to Browse products flow. If the cart is not empty, the cart details for that user will be displayed.
3. **Edit/Remove from cart**: Carousel node is used to display the summary of the existing cart (all the items with quantity and price) along with options to edit the quantity or remove the item (for each item with a unique product ID) present in the cart. Condition node is used to identify if the users clicked the text 'Edit item' /'Remove item' for items displayed on the carousel. 
4. **Edit item**: When Edit item is clicked, users can edit the Number of items (for that product ID) which is displayed using quick replies (and WhatsApp list). Using editcart function, the newly entered quantity value is stored in a variable and the database(user details) is updated. 
5. **Remove item**: Clicking remove item removes the item from the cart using the editcart function and the new cart summary is updated in the database(user details).
6. **Display quick replies**: After the cart is edited, the user can continue shopping by clicking on any of the quick replies that are linked to their respective flows [Buy now](#linktotheflow), [Clear cart](#linktotheflow) and [Add more products](#linktotheflow).

### 3. Clear cart

This flow is triggered when the Clear cart option is selected. The cart becomes empty, and all the item details (Product IDs and Quantity) stored in the user database are deleted. 

<img src="https://i.imgur.com/FYiCVND.png" alt="drawing" width="45%"/>

1. **Start trigger**: Triggered when the Clear cart option is selected on any flow. 
2. **Empty the cart**: As this flow is triggered, the Cart variable is assigned to [], which means the details present in the cart will become null. 
3. **Update user details**: The database(user details) is updated to empty the cart and a text node is displayed confirming to the user that the cart is empty followed by execution of [Browse products](#linktotheflow) flow. 
![](https://i.imgur.com/az875WU.png)

### Buy now

This flow generates the payment link using the cart details and sends payment link to the bot user.

![](https://i.imgur.com/RIIEaM4.png)


1. **Starts** the flow using the intent *buyNow*.
2. **Verifies if the cart is empty**: Uses the **Function** and **Condition** nodes to ensure the cart is not empty before proceeding to the payment.
3. If the cart is empty, it shows the *Browse products* option.
4. If the cart is not empty, it captures the following information required for the order to process.
   a. Name and phone number using the respective prompt nodes.
   
   b. Address using the **Location** node and converts it using the `addressConverter` function. User can just share the location from the device.
   
![](https://i.imgur.com/Q1wIO3u.png)

5. **Generates the payment link**: Passes these details in the `paymentlinksinput` along with the amount (variable) to  the **Razorpay** node to generate payment link.

   * Captures the `paymentId` (Variables) and updates two  database tables:
   *  `order_details` with information userId, phone number, cart details, order ID, order value, order status, shipping address, and payment ID.
   * `user_details` table with information cart details, name, phone number, and address.

> * Customise the fields that you want to capture. You can modify column names, add more columns or update existing columns.
> * Use APIs to fetch or update details from an external database.

   * Generates the payment link and sends it to the user.





### Queries and Concerns

With this flow, users can ask the bot FAQs or choose to chat with the support team. 

<img src="https://i.imgur.com/1KSSMut.png" alt="drawing" width="45%"/> <img src="https://i.imgur.com/CnKnqCQ.png" alt="drawing" width="45%"/>

1. **Starts**: Triggeres from the Home flow when the *Queries and Concerns* option is selected from quick replies. 
2. **Select FAQ or Support**: Quick replies are displayed to select FAQ or Chat with support. 
3. **FAQs**: FAQs are displayed through the **Quick replies** node. When the user types a question or selects from the options, the response is fetched from the trained [FAQs](https://docs.yellow.ai/docs/platform_concepts/studio/train/add-faqs). 

>You can add more such questions as quick reply options or directly train them on the FAQ page. 

6. **Chat with support**: When chat with support is selected, [prompt nodes](https://docs.yellow.ai/docs/platform_concepts/studio/build/nodes/prompt-nodes) are used to fetch user data and with [Raise ticket](https://docs.yellow.ai/docs/platform_concepts/studio/build/nodes/action-nodes#17-raise-ticket) node, this ticket is assigned to an Inbox agent. The chat is handled by [Inbox module](https://docs.yellow.ai/docs/platform_concepts/inbox/inbox#4-try-live-agent-module). 

![](https://i.imgur.com/eNr7vI0.png)
