Selling Products

There are actions in the page structure that we call the user to sell products. After directing the user to the product selling screen, we register the user's Stripe account with the "Register as a seller" action if the user has not sold any products before. Thus, we can quickly transfer the money earned by the user to the user.
Image without caption
After then, the user chooses the type of product. There are two types of products in this template. These are; 1- Directly downloadable files (ETC. ebook, PDFs) 2- Coupon code (ETC. software, course)
Image without caption
Suppose the user selects the "Directly downloadable file" option after entering the product information. In that case, users must upload a file or provide a link to access the file so that they can download the product.
Image without caption
If the user selects the "Code to redeem" option, after entering the product information, they have to upload a ".csv" file containing the coupon codes of the product. The ".csv" sample file is on the screen where the user will load the ".csv" file. The user can bulk upload their code with a suitable example.
Image without caption
The ".csv" file uploaded by the user is converted to JSON output with the action of the "CSV file to JSON" plugin and stored in the database in "text" format.
Image without caption
Also, the total number of product codes is stored in the database. Each time the product is purchased, the first coupon code is defined for the purchasing user, and this code is subtracted from the existing coupon codes of the product, and the code counter decreases.
When the "Code counter" number of the product reaches "0", the product becomes unpurchasable and is shown to the user as "Sold out" on the product's page.
Image without caption
When the codes of a product are exhausted (that can be done before it is sold out), the user must upload the bulk code if the seller wants to continue selling the product.
The user goes to the dashboard and opens the "edit" window for the relevant product.
Image without caption
Image without caption
After the user uploads the coupon codes, again can purchase the product.
Share