Become King Of Hell

Make A Shop in Telegram with payment

Joined
Dec 29, 2021
Messages
29
Hellcoins
♆711
Let's start creating a "Chat-Bot-Shop in Telegram" with the development of a technical task, without using any templates, but in a simple way, for ourselves.

First of all, let's decide what we want to get as a result. I imagine this as a product catalog, where the user can view the product card, add the product to the cart, and complete the purchase without leaving the messenger.

This will be a bot with the minimum required set of functions, for informational purposes, in the future you can expand the functionality of the bot to suit your needs.

We will fill the content through the bot itself, for this we will need to make an administration system, and also organize access rights to the admin chat.

Let's make it possible to add categories and product cards. We will not edit the product and categories; if necessary, this can be finalized outside the scope of the articles. Adding and editing information in the Help section.

Bot sections:

  1. Personal account
  2. Catalog
  3. Basket
  4. Help

Now more…​

Personal Area.
The user's account will store personal data necessary for making a purchase. Filling in the data must be made available both when making a purchase, and simply in the Personal Account section.

Data:

  1. First Name Last Name
  2. Telephone
  3. Delivery address
Catalog
Navigation through the catalog should be convenient and intuitive. It is necessary to implement the ability to move not only deep into the directory, but also one step back. This should also work in any other section of the bot.

  1. Category
    1. Card Product
      1. Name
      2. Picture (1 piece, if desired, can be expanded)
      3. Description including specifications
      4. Price
      5. unit of measurement
Shopping
cart The shopping cart allows you to add the goods of interest to it and complete the purchase. The basket must contain management tools:

  1. Remove item from cart
  2. View all items in the cart
  3. Increase / decrease the quantity of goods
  4. Checkout
    1. Delivery address
    2. Telephone
    3. Last name First name
    4. Payment
      1. Online (let's try Yandex.Checkout or QIWI)
      2. Upon receipt of the goods
  5. Purchase Preview
Help
In this section, you can place information about the store, support service, feedback methods and more.

As we move forward, we will either supplement or exclude something in the TOR. We will write the code in our already known index.php file (this is the file that we have webHook configured for ), get acquainted with PDO


Database tables

Personal Area

  1. id - unique identifier
  2. user_id - user id in Telegram
  3. first_name - username
  4. last_name - last name of the user
  5. phone - user's phone
  6. adress - delivery address
Catalog

  1. Categories
    1. id - unique identifier
    2. name - directory name
  2. Card Product
    1. id - unique identifier
    2. parent - parent category
    3. name - product name
    4. description – product description
    5. image_tgr - product image in the telegram database
    6. image - product image on a non-third-party server
    7. price - item price
    8. unit - unit of measure
Basket

  1. id - unique identifier
  2. product_id - product id
  3. product_count - product quantity
  4. user_id - user id
Help

  1. description – section description
Structure of tables in SQL format
You must reply before you can see the hidden data contained here.
There will also be at least one table for an intermediate record of the user's steps, that is, we need to understand for what purpose the information came from the user, whether it is a text for editing a surname, or for the Help section.

Ok, that's enough for today. In the next article, we will go straight to practice.
You must reply before you can see the hidden data contained here.
 
Top