OOPS PROJECT ON
ONLINE SHOPPING MANAGEMENT SYSTEM
GALGOTIAS UNIVERSITY, COMPUTER SCIENCE ENGINEERING
Project Title: ONLINE SHOPPING MANAGEMENT SYSTEM
WEBSITE BY USING C LANGUAGE
Submitted by:
Name: Himanshu Kaushal , Minvesh Kumar
Roll no: 23SCEC1012451, 23SCSE1088888
Section: 59
Submitted to:
Priyanka Shukla
Online Shopping Management Project in Python language
Objective of the Project:
The system helps in buying of products online by choosing the listed products from website(E-Commerce site).
Technology:
The programming language that will be used in coding this work is C programming language.
Introduction:
This application provides an ease to buy some products and do some sort of operations like create account, adding
more quantity of products, deleting of product from cart, completing payment and accessing the stock information of
the shopping mart.
The main menu which is made up of:
CATEGORY: When we choose one or two options then we can buy the available products with the quantities we are
required with
DISPLAY: When we choose option three then we can view our cart, i.e. what we have bought and we can also delete
the item from cart if required, once we proceed to purchase cart will be empty.
ORDER: This allows you to purchase items that you added in cart.
ACCOUNT This allows you to create account for admin and user. Admin can see available stocks and can update amount
of it.
EXIT: If the user want to go for break or is a closing time for the day work then this module will allows the user to quit
from the system and close.
The functionality of the Shopping Cart:
Although online Shopping has many functionalities we can’t include all of them. So, a few Functionalities of the
shopping cart can use are mentioned below:
1.Signup
2.Login
3.Search items
4.Bill
Approach and Functionality:
Signup Functionality:
This is the main function for a signup, Here we will check whether the account exists or not if not we will create
a new account Following are the functionalities: Inputs are username, age, email, password, confirm the
password, and mobile number.
Validate the inputs input data should be valid otherwise account will not create. After successful signup, you
will be directly redirected to the login page
Login:
This function implements the login features of our project. While login in, the Email, and Password are validated and checked
whether it is already signed up. After the successful login, there is an option to choose either Search_by_items or search by shops.
Order by Shop:
In this functionality, the item is placed after selecting any shop. Once the shop is selected the list of items is displayed with their
respective costs. Once the item is selected, you need to go to the option Select Cart for the successful ordering of the items.
Cart:
This function will show you the Total cost of your order.
Data Input Conditions:
Conditions for the data to be input on Sign up page are mentioned below:
Name: must contain the alphabet.
Age: must be greater than and not equal to 0.
Email: must contain @, a comma, and length should be greater than 5.
Passwords: must contain lengths between 8 to 12 with at least one uppercase, lowercase, number, and special character. Both
password and confirm password should be the same.
Mobile numbers: should contain numbers and exactly 10 digits.
Login Page
The login page asks about the data before we can enter the main home page where we can shop. The data to be inserted are
Email and Password. Both email and password should be matching with the data entry or the process to log in will fail.
Online-Shopping-System-using-python
Online shopping cart
Modules:
Login/Logout
Display Menu
Add/Remove item
Total goods available
Income/Loss
Place order
Cancel order
CODE: print("5.Income and Loss")
# Online Shopping System print("6.Logout")
print("*********************")
# Define the initial inventory of items
# Function to display the inventory menu
dress=[{"id":1001,"Name":"Tops","Available":10,"Price":250,"Original_Price":200},
def adminDisplayMenu():
{"id":1002,"Name":"Pants","Available":12,"Price":500,"Original_Price":450},
print("Id\tName\tAvailable\tPrice\tOriginal Price")
{"id":1003,"Name":"Sarees","Available":100,"Price":750,"Original_Price":700},
print("***************************************************")
{"id":1004,"Name":"Shorts","Available":20,"Price":350,"Original_Price":300},
for d in dress:
{"id":1005,"Name":"Kurtas","Available":15,"Price":400,"Original_Price":300}] print(f'{d["id"]}\t{d["Name"]}\t{d["Available"]}\t\t{d["Price"]}\t{d["Original_Price"]}’)
# Create a copy of the inventory for reference # Function to add items to the inventory
dress1=dress def addItem():
n=int(input("Enter the no.of.items need to be added : "))
for i in range(n):
# Temporary list for operations like removing items
new_id=int(input("Enter id : "))
temp=[]
new_Name=input("Enter Name : ")
# Variable to hold the order details
new_Available=int(input("Enter Available : "))
order="“
new_Price=int(input("Enter Price : "))
# Function for admin login and menu
new_original=int(input("Enter the original price : "))
def adminLogin(): d=[{"id":new_id,"Name":new_Name,"Available":new_Available,"Price":new_Price,"Original_P
rice":new_original}]
print("*********************")
dress.extend(d)
print("1.Display Menu") adminDisplayMenu()
print("2.Add item")
print("3.Remove item") # Function to remove items from the inventory
print("4.Total goods available") def removeItem():
dressId=int(input("Enter the id need to be deleted : ")) for d in dress:
found=False print(f'{d["Name"]} = {d["Available"]}')
for d in dress1: Total+=(d["Available"])
found=d["id"]==dressId print("\nTotal available goods is : ",Total)
if found !=True: # Function to calculate income or loss
temp.append(d) def incomeLoss():
continue total=0
if found==True: for d in dress:
d["Available"]-=1 total+=((d["Available"]*d["Price"])-(d["Available"]*d["Original_Price"]))
print("Deleting item....") print("\nTotal income or loss is : ",total)
if len(temp)==d: def logout():
print(f"{dressId} not found") login()
else: # Function to handle admin choices
print(f"{dressId}'s one available is removed from the list") def adminChoice():
adminDisplayMenu() choice=int(input("Please enter user choice : "))
# Function to display the total available goods if choice==1:
def goods(): adminDisplayMenu()
Total=0 print("\n***************************************************\n")
print("\n")
adminLogin() goods()
print("\n***************************************************\n") print("\n***************************************************\n")
adminChoice() adminLogin()
elif choice==2: print("\n***************************************************\n")
adminDisplayMenu() adminChoice()
print("\n***************************************************\n") elif choice==5:
addItem() incomeLoss()
print("\n***************************************************\n") print("\n***************************************************\n")
adminLogin() adminLogin()
print("\n***************************************************\n") print("\n***************************************************\n")
adminChoice() adminChoice()
elif choice==3: elif choice==6:
adminDisplayMenu() logout()
print("\n***************************************************\n") else:
removeItem() print("\nInvalid Choice. Please enter valid choice")
print("\n***************************************************\n") print("\n***************************************************\n")
adminLogin() adminLogin()
print("\n***************************************************\n") print("\n***************************************************\n")
adminChoice() adminChoice()
elif choice==4:
# Function for user login
for d in dress:
def userLogin():
if d["id"]==p_id:
print("*********************\n")
print("\nId\tName\tAvailable\tPrice")
print("1.Display Menu")
print("***************************************************")
print("2.Place order")
print(f'{d["id"]}\t{d["Name"]}\t{d["Available"]}\t\t{d["Price"]}')
print("3.Cancel order")
order='{d["id"]}\t{d["Name"]}\t{d["Available"]}\t\t{d["Price"]}'
print("4.Logout")
conform=input("\nDo you want to place an order on the above shown
print("\n*********************") product : Y/N ")
# Function to display the inventory menu for users
def userDisplayMenu(): if conform=='Y' or conform=='y':
print("Id\tName\tAvailable\tPrice") print("\nSuccessfully placed the order on the product {}
{}".format(d["id"],d["Name"]))
print("***************************************************")
order_number+=1
for d in dress:
print("Your order number is : ",order_number)
print(f'{d["id"]}\t{d["Name"]}\t{d["Available"]}\t\t{d["Price"]}')
d["Available"]-=1
def user_id():
break
userDisplayMenu()
elif conform=='N' or conform=='n' :
p_id=int(input("\nEnter the id : "))
print("The order is not placed. You can carry on with you purchase. Happy
# Function to handle placing orders shopping!!!!")
def placeOrder(): break
order_number=10
userDisplayMenu()
p_id=int(input("\nEnter the id : "))
else: if len(temp)==d:
print("\nYou have entered wrong option. Please enter again\n") print(f'{order_id} is not found')
conform=input("\nDo you want to place an order on the above shown else:
product : Y/N ")
print(f'{order_id} is removed from the placed order’)
break
# Function to handle user choices
def userChoice():
if d["id"]!=p_id:
choice=int(input("Please enter user choice : "))
print("\nYou have entered invalid id. Please enter valid id\n")
if choice==1:
user_id()
userDisplayMenu()
print("\nAvailable products : \n")
userDisplayMenu() print("\n***************************************************\n")
userLogin()
# Function to cancel orders print("\n***************************************************\n")
def cancelOrder(): userChoice()
found=False elif choice==2:
temp=[] placeOrder()
order_id=input("Enter the order id : ") print("\n***************************************************\n")
for d in dress: userLogin()
found=d["id"]==order_id print("\n***************************************************\n")
if found!=True: userChoice()
temp.append(d)
elif choice==3: else:
cancelOrder() print("Invalid password. Please enter valid password")
print("\n***************************************************\n")
userLogin() elif tp=='U' or tp=='u':
print("\n***************************************************\n") password=input("Enter the password : ")
userChoice() if(password=="123"):
elif choice==4: userLogin()
logout() userChoice()
else: else:
print("Invalid Choice. Please enter valid choice") print("Invalid password. Please enter valid password")
else:
# Function for user authentication print("Invalid user type. Enter valid user type")
def login():
tp=input("Admin/User [A/U] : ") # Start the application by calling the login function
if tp=='A' or tp=='a' : login()
password=input("Enter the password : ")
if password=="abc":
adminLogin()
adminChoice()
Start
|
|--- Login Process (Admin/User)
Flow Chart: |
|
|
|-- Admin:
| | |
| | |-- Admin Login
| | |
| | |-- Admin Menu Options
| | |
| | |--- Admin Choice (Display Menu, Add Item, Remove Item, Total Goods, Income/Loss, Logout)
| |
| |-- User:
| |
| |-- User Login
| |
| |-- User Menu Options
| |
| |--- User Choice (Display Menu, Place Order, Cancel Order, Logout)
|
|--- Admin Functions:
| |
| |-- Display Menu
| |
| |-- Add Item
| |
| |-- Remove Item
| |
| |-- Total Goods Available
| |
| |-- Income and Loss
|
|--- User Functions:
| |
| |-- Display Menu
| |
| |-- Place Order
| |
| |-- Cancel Order
|
End
References for the Online Shopping System code:
1.Python Documentation: Official documentation for the Python programming language.
Available at https://docs.python.org/
2.Flask Documentation: Official documentation for the Flask web framework used in the code.
Available at https://flask.palletsprojects.com/.
3.Stack Overflow: A popular online community for programmers to ask and answer questions.
Various threads on Flask, Python, and general programming concepts were likely referenced.
4.TutorialsPoint: Online tutorials and resources for learning programming languages and
frameworks. The Flask tutorial may have been referenced for specific implementation details.
5.Real Python: Online tutorials and articles for Python developers. Real Python provides in-depth
guides and tutorials on various Python-related topics, including web development with Flask.
6.GitHub Gists: Online repository for sharing code snippets. The code may have been inspired by
or referenced from similar projects or examples found on GitHub Gists.
7.Official Python and Flask documentation, as well as reputable online tutorials and forums, are
typically the most reliable sources for learning and referencing code implementations.