Welcome to the Tkinter Shopping Simplifier! This program fetches images from urls as per choices of clothes made by you and displays them in a Tk() window!
Made by @Adit Sinha, @Ekhnoor Grover, @Dhruv Rawal and @Ahaan Bohra.
- Silico Battles (2022-23): 2nd Prize (Hackathon) Note: This project, which previously only used data file handling, was merged with a separate project made at the hackathon which used database management.
EasyShop is a shopping interface we created for people who want to buy specific cloth wear and to provide shopkeepers with a shopping model that requires minimal labour. Such models are now in use in some enterprises such as Decathlon.
They start by logging into the interface, if it is their first time using it then they must register. When a user registers, an SQL table based on their unique username is created to store their cart. Returning users can directly access their cart and add more cloth articles to their cart. However, if the cart is empty, the user is requested to shop first. If the user has any queries there is a contact support page in which they can ask their query via Whatsapp or Mail. We provide certain choices through which they can get to what they want faster.
Using the ‘Tkinter’ module and ‘PIL’ module we managed to display images of the clothing options for the user. They can choose the clothes they would like to add to the cart. At the checkout page they can view the final summary and then checkout. We also allow the shopkeeper or administrator to view the last purchase made by a user using a MySQL table. It also details them on the date and time it was issued.
NOTE: All image links in the .txt files and the 'fashion carnival' image belong to https://www.myntra.com/. They are being used in our program for educational purposes only. Images used for buttons belong to http://shutterstock.com/. Other relevant images belong to their creators and have not been created by any party who programmed this project.
- Lists:
- User Defined Functions:
- Dictionaries:
- File Handling:
- Importing a function from a file:
- In built functions:
- ‘Tkinter’ module:
- ‘PIL’ module:
- ‘urllib’ module:
- ‘webbrowser’ module
- ‘datetime’ module
- MySQL
- MySQL-Python connectivity
We have utilized several python concepts and modules to make this project.
- The project utilizes basic python data structures such as lists and dictionaries to store organized data. It also uses these to organize the data we receive from the MySQL table.
- The code is also well organized with appropriate documentation. All the user created functions and variables featured also have appropriate names for the viewer/programmer's sake.
- We also made use of file handling, using it here so that we can combine the different aspects of the project into one as well as for the login interface to run smoothly.
- The ‘Tkinter’ module is a concept which we weren’t taught in school. It is a module to make a relatively simple general user interface, and we applied it to every part of our project to enhance the customer experience.
- We also experimented with the PIL and urllib module in python in order to get the image from the link and portray it in the Tk window.
- We’ve also used MySQL to create ‘cart’ and‘items’ tables that are used to store the user’s temporary cart and the web store’s current stock. The temporary cart maintains the user’s previous session and only gets updated/truncated when the user proceeds to pay.
- We’ve also added a ‘lastpurch’ table using MySQL which is used to store details about the user’s last purchase. It includes the name (primary key), price, date and time as its parameters. To record the date and time, we’ve used the ‘datetime’ module.
All the following steps must be completed to run the project:
- You must have pip installed.
- The program must be downloaded from the link provided as a zipped folder (.zip) and extracted.
- You must have Tkinter, pillow, urllib3 and mysql connector modules installed using the following commands:
$pip install tk
$pip install pillow
$pip install urllib3
$pip install pip install mysql-connector-python
- Create a Database 'dex' and run 'sqlLoader.py' to fill the data table for clothes.
- Run 'Login Interface.py' in the folder of the same name to start the program.
- All files (python and data) and images must be in the same directories as in the link to the project.
- The password and username for your MySQL client must be ‘root’. If this is not the case, this must be edited in the python programs.
Screen 1: First Screen, allows user to register a new user or go to Login page
Screen 2: Screen if user enters a username already present
Screen 3: Login Page; user logs into their EasyShop account
Screen 4: Screen if user’s login credentials are incorrect
Screen 5: If the login credentials are correct, the user is taken to the Home Page which allows user to contact support, continue shopping or proceed to cart.
Screen 6: Screen if user tries to proceed to cart without purchasing anything or having anything in the cart:
If the cart isn't empty, it displays the content put in the cart previously:
Screen 7: Contact Page (accessed if ‘Contact Support’ button pressed
Pressing ‘Back’ button takes them to screen 5
Screen 8 and 9: Screen to make choices for shopping
Screen 10: Screen if 'Continue' pressed without making all 3 choices
Screen 11: When the “Continue” button is pressed, it takes the user to the Shopping Page:
Screen 12 and 13: Shopping Page screen if list of clothes available finished
Screen 14: Shopping Page if item added to cart (thrice)
After the “Add to Cart” button is pressed, the clothing piece is added to the Cart SQL table. This table would contain information regarding the name, price, etc. of the clothing
When ‘Return to home’ button is pressed, goes back to Screen 5 When ‘Proceed to Cart’ button is pressed, goes to Screen 15
Screen 15: Checkout Page
Pressing ‘Shop More’ goes to screen 5 Pressing ‘Proceed to pay’ goes to screen 17
Moreover, the ‘lastpurch’ table does the following: If the user has never made a purchase before, the latest record is inserted into it:
However, if the user has made a purchase before, the latest record is updated accordingly (The user 'Adit' is updated):
Screen 16: Checkout Page after a user buys another item after making choice
Screen 17: Final Screen; Thank you Page
The future scope of this project is immense. There are many features that we have not yet added, due to reasons such as lack of time, inexperience in programming or lack of resources. Below we have listed down the limitations faced by us while doing this project along with its potential in the future: -
- We could add a delete button to the cart for users to delete items that they do not want to purchase. This could be easily done with SQL using a “delete’ query.
- Web Scraping and parsing could potentially be a very efficient and automated way to update our shop with newer clothes. We were unable to do this as we did not how to utilise modules like ‘BeautifulSoup’ and the ‘requests’ module properly.
- Another idea that we are planning to implement is a price estimate. Currently in our project we have rigid price ranges which do not have a lot of variability; however we are planning to implement an input to take the price and offer clothes around that price range to the user.
- Storing the user’s information on a web server would also be a beneficial alteration since it would allow the stock of the store to be updated in real time. This would also make it easier for our project to be set up in offline and online stores.
- We would like to add an update feature, which gives the user an option to change their username or password as it is currently not feasible due to our use of data file handling.
- https://www.geeksforgeeks.org/python-gui-tkinter/
- https://www.w3schools.in/python-tutorial/guiprogramming/
- https://smallbusiness.chron.com/
- https://linuxhint.com/
- https://docs.python.org/3/library/urllib.html
- https://www.geeksforgeeks.org/python-urllib-module/
- https://www.geeksforgeeks.org/python-launch-a-webbrowser-using-webbrowser-module/
- https://www.shutterstock.com/
- https://www.myntra.com/
- https://www.geeksforgeeks.org/python-datetimemodule/
Thank you for checking out our project! We really appreciate your time.