Online Clothing Store
Online Clothing Store
1
1. INTRODUCTION
store on the Internet where customers can browse the catalog and
is feedback.
3
3. DATA MODEL DESCRIPTION
List of Tables:
1. Login
2. Customers
3. Products
4. Category
5. Cart
6. Order details
7. Payment
8. Feedback
4
Tables:
Admin Table
Customer Table
5
Products Table
Category Table
6
Cart Table
7
Payment Table
Feedback Table
8
Main Description of the module:
All the above mentioned data are stored in the backend and can be
time. The user can purchase items from the website but does have
ER-Diagram:
identified.
9
ER-Diagram
10
4. DATA FLOW DIAGRAM
system.
: Data Flow
: Process
: Entity
: Data Store
11
0 Level Data Flow Diagram
make up a system and the relations they have with each other.
The 0 Level DFD describe the all user module who operate the
system. Below data flow diagram of online shopping site shows the
two user can operate the system Admin and Member user.
0 Level DFD
12
1st Level Admin Side Data Flow Diagram
of the website. Admin can first add category of item, data stores of
all category
all customer
all shipping
13
1st Level Admin Side Data Flow Diagram
14
2nd Level Admin Side Data Flow Diagram
15
1st Level User Side Data Flow Diagram
The user is all people who operate or visit our website. User is a
customer of a website. User can first select product but user must
16
2nd Level User Side Data Flow Diagram
further sub-processes.
17
5. REPORT GENERATION
o Customer Name
o E-mail
the
shop.
18
frame.
19
6. HARDWARE AND SOFTWARE REQUIRED
Hardware Required:
Ram : 2 GB or Above
Software Required:
Programming Languages:
11
0
7. SCOPE OF THE PROJECT
E-commerce had bloomed over the years and is one of the fastest-
growing domains in the online world. Though it took some time for
at its launch, but over years people tend to have started trusting e-
having to visit the physical store. The payment features that are
20
8. BIBLIOGRAPHY
21
Project Report
22
1.INTRODUCTION AND OBJECTIVES
Introduction
processing of
information using computer. One can easily get the type of required
desired location.
24
of activities, including online retail, electronic payments, internet
e-commerce is the most visible business use of the world wide web.
a GUI based automated system, which will cover all the information
related to the Books purchase which is used in our daily life. For
example – Course books, Self help books, Novels and many more
25
other books. So by this GUI based automated system if a user
and
and
industry
advancements.
Project Category
27
exchange of business information using electronic data
interchange,
28
electronic mail electronic fund transfer & other networked based
technologies.
selling products
User can choose any category ‘Novels’, ‘Self help books’ etc.
29
Technologies used in Project Development
HTML
CSS
JavaScript
JavaScript.
Node.js
MySQL
21
0
Hardware and Software Requirements
At Developer Side:
2 GB RAM or Above
21
1
20 GB Hard Disk Space
Chrome, Edge)
About Technology
HTML
publishing
language used by the World wide web is HTML (Hyper Text Markup
Language).
of a button
31
HTML 5.0
JavaScript
programs right in your Web pages and run these programs using
<BODY> element.
Example:
<HTML>
<HEAD>
32
<TITLE></TITLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE=”JavaScript”><SCRIPT>
</BODY>
</HTML>
JavaScript Objects
Using this object, you have access to the HTML of the page
page.
33
Frame: Refers to a frame in the browser’s window.
JavaScript Events
JavaScript Function
Declaration of function
34
……..
……..
Classification of Database
1. Hierarchical Database
35
2. Network Database
Manipulation Language).
3. Relational Database
36
MySQL
reliability, and ease of use, MySQL has become the preferred choice
for Web, Web 2.0, Saas, ISV, Telecom companies and forward-
37
The SQL Language
how to do it.
Features of SQL
38
Node.js
39
Asynchronous programming is crucial for building
requests.
Cross-Platform
macOS.
40
Easy to Learn: If you already know JavaScript for front-end
41
2.SYSTEM DESIGN
Preliminary Design
important
Automation boundary
Report layouts
Menu
feasible.
43
System design: It defines the overall structure,
Economic Feasibility
44
benefits outweigh the
45
costs; we take a decision to design and implement the new
system development costs are usually one-time costs that will not
recur after the project has been completed. For calculating the
Personal costs
Computer usage
Operational Feasibility
46
UML (Unified Modify Language)
important part of
Goals of UML
meaningful models.
components.
1. USE CASE
relationship among users and use cases. The two main components
48
The user will interact with the system we are modelling. A use case
49
Sale
41
0
Service
50
3. SYSTEM ANALYSIS
used to
may model the data and their relationships and the state transition
Context diagram
51
Data dictionary for the flow and stores on the DFDs
52
4. SYSTEM DESIGN
sketch".
remove otherwise.
goal of SDS is not only to produce a correct design but the best
and the physical and social environment in which the system will
operate.
53
System design involves transformation of the user implementation
Database scheme
Structure charts
Module Description
List of Tables:
Login
Customers
Products
54
Category
Cart
Order details
Payment
Feedback
Manage Shipments/Payments
55
Adding shipment and payment details
Manage orders
Shopping Experience
56
Edit the Exiting Customer
Listing of all
Customer Manage
Products
Add Products
Company/Manufacturer
Filter
manufacturer Manage
Orders
57
Listing of the Orders
58
Manage Shipments
Shopping
59
ER Diagram
Entities
Relations
Attributes
51
0
The symbols used in ER Diagrams are:
Symbols Purpose
Represents attributes
51
1
ER DIAGRAM
60
Activity Diagram
performed.
parallel.
61
Flowchart
62
flowchart, except DFDs show the flow of data throughout the
system.
: Data Flow
: Process
: Entity
: Data Store
Levels of DFD
63
organisation is shown by the way of context analysis diagram.
The input and output data shown should be consistent from one
inputs to and outputs from the system and major processes. This
A level-1 DFD describes the next level of details within the system,
whole.
64
LEVEL-2 : File Level Detail Data Flow
All the projects are feasible given unlimited resources and infinite
make up a system and the relations they have with each other.
65
1st Level Admin Side Data Flow Diagram
of the website. Admin can first add category of item, data stores of
all category
all customer
all shipping
66
1st Level Admin Side Data Flow Diagram
67
2nd Level Admin Side Data Flow Diagram
68
1st Level User Side Data Flow Diagram
The user is all people who operate or visit our website. User is a
customer of a website. User can first select product but user must
69
2nd Level User Side Data Flow Diagram
further sub-processes.
70
Level – 0 DFD
For Registration
For Login
71
For Buying Product
72
5. DATABASE DESIGN
Data
73
Overview of Database
74
User Management
75
Product Management
76
Shopping Process
77
MySQL Database
78
User Table
Purchase Table
79
6. TESTING
Testing Objectives:
error.
80
These above objectives imply a dramatic change in view port.
Testing cannot show the absence of defects, it can only show that
Structural Testing
81
and have not been executed. Problems with flow graph derived
testing:
Functional Testing
integrating
Test Plan, you can also create a Test Plan that runs these
83
Interface Testing
global variable). One places data there and the other retrieves
it.
architectures.
84
Three common kinds of interface errors:
"Race conditions".
one is checking for invalid data (failure to check return status) and
units.
Testing Process
85
chunks. Once each lowest level unit has been tested, units are
86
combined with related I units and retested in combination. These
as a whole.
bespoke systems)
use and provide feedback. In, this project, Beta testing has been
87
7. CODE
Login Page
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device- width, initial-
scale=1.0">
<title>Book Store - Login</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<h1>Book Store</h1>
<form id="loginForm">
<input type="text"
id="username"
placeholder="Username" required>
<input type="password"
id="password" placeholder="Password"
required>
<button type="submit">Login</button>
88
</form>
<div class="links">
89
<a href="#"
id="forgotPassword">Forgot Password?</a>
<a href="#" id="signUp">Sign Up</a>
</div>
</div>
<script src="script.js"></script>
</body>
</html>
CSS
body {
font-family: Arial, sans-
serif; margin: 0;
padding: 0;
display: flex;
justify-content:
center; align-items:
center; height:
100vh;
background-color: #f0f0f0;
}
.container {
81
0
text-align: center;
81
1
}
h1 {
margin-bottom: 30px;
}
form {
margin-bottom: 20px;
}
input[type="text"],
input[type="password"],
button {
padding: 10px;
margin-bottom:
10px; width: 100%;
box-sizing: border-box;
}
button {
background-color:
#4CAF50; color: white;
border: none;
81
2
cursor: pointer;
}
button:hover {
background-color: #45a049;
}
.links a {
margin-right: 10px;
text-decoration:
none; color:
#007bff;
}
.links a:hover {
text-decoration: underline;
}
JAVASCRIPT
document.getElementById('loginForm').addEventList
en er('submit', function(event) {
event.preventDefault(); // Prevent
form submission
// Here you can add your login logic,
e.g., sending the data to a server
81
3
// For demonstration, let's just log
the credentials to the console
const username =
document.getElementById('username').value;
const password =
document.getElementById('password').value;
console.log("Username:",
username);
console.log("Password:",
password);
});
document.getElementById('forgotPassword').addEven
tL istener('click', function(event) {
event.preventDefault();
alert("Forgot password functionality
not implemented yet!");
});
document.getElementById('signUp').addEventListene
r( 'click', function(event) {
event.preventDefault();
alert("Sign up functionality not
implemented yet!");
});
90
Home Page
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device- width, initial-
scale=1.0">
<meta http-equiv="X-UA-
Compatible" content="ie=edge">
<!-- <link rel="stylesheet" href="/style.css">
-->
<title> Online Book Store</title>
<!-- favicon -->
<link rel="icon"
href="https://yt3.ggpht.com/a/AGF-
l78km1YyNXmF0r3- 0CycCA0HLA_i6zYn_8NZEg=s900-c-
k-c0xffffffff-no-rj- mo" type="image/gif"
sizes="16x16">
<!-- header links -->
<script
src="https://kit.fontawesome.com/4a3b1f73a2.js
"></s cript>
<link
href="https://fonts.googleapis.com/css?
family=Lato& display=swap" rel="stylesheet">
<!-- slider links -->
<!-- <script
src="http://code.jquery.com/jquery-
3.4.1.min.js" integrity="sha256-
91
CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo
=" crossorigin="anonymous"></script> -->
92
<script src="js/jQuery3.4.1.js"></script>
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/s
lick- carousel/1.9.0/slick.min.css">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/s
lick- carousel/1.9.0/slick-theme.min.css">
</head>
<body>
<!-- HEADER -->
<div id="1"></div>
<script>
load("header.html"
); function
load(url)
{
req = new XMLHttpRequest();
req.open("GET", url, false);
req.send(null);
document.getElementById(1).innerHT
ML =
req.responseTex
t;
}
</script>
<!-- SLIDER -->
<div id="2"></div>
<script>
load("slider.html"
); function
load(url)
{
93
req = new
XMLHttpRequest();
req.open("GET", url,
false); req.send(null);
94
document.getElementById(2).innerHT
ML = req.responseText;
}
</script>
96
</body>
</html>
CSS
body
{
margin: 0;
97
font-family: 'Lato', sans-serif;
}
h1
{
width: 90%;
margin: auto;
padding: 50px
0;
letter-spacing:
2px; font-weight:
700;
text-transform: capitalize;
}
#containerClothing, #containerAccessories
{
display: grid;
grid-gap: 70px 20px;
grid-template-columns: repeat(5,
1fr); width: 90%;
margin: auto;
padding-bottom: 40px;
}
#bo
x
{ width: 100%;
background-color:
white; align-content:
center; border-
radius: 10px;
box-shadow: 1px 2px 6px 2px rgb(219, 219, 219);
}
#box:hover
{
98
box-shadow: 1px 6px 3px 0 rgb(185, 185, 185);
}
99
#containerClothing img
{
width: 100%;
border-top-left-radius:
10px; border-top-right-
radius: 10px;
}
#containerAccessories img
{
width: 100%;
border-top-left-radius:
10px; border-top-right-
radius: 10px;
}
#details
{
padding: 0 15px;
text-transform: capitalize;
}
#box a
{
text-decoration:
none; color: rgb(29,
29, 29);
}
h3
{
font-size: 16px;
}
h4
{
font-weight: 100;
}
91
0
h2
{
91
1
color: rgb(3, 94, 94);
}
/* MEDIA QUERY
*/
@media(max-width: 1070px)
{
h1
{
font-size: 25px;
}
#containerClothing, #containerAccessories
{
width: 95%;
grid-gap:
10px;
}
}
@media(max-width: 850px)
{
h1
{
width: 80%;
}
#containerBook, #containerAccessories
{
display: grid;
grid-gap: 70px 20px;
grid-template-columns: repeat(3,
1fr); width: 80%;
}
}
91
2
@media(max-width: 650px)
{
h1
{
font-size: 20px;
}
h1
{
width: 90%;
}
#containerClothing, #containerAccessories
{
width: 90%;
}
}
@media(max-width: 600px)
{
h1
{
width: 70%;
}
#containerClothing, #containerAccessories
{
width: 70%;
}
}
@media(max-width: 505px)
{
h1
{
width: 80%;
}
91
3
#containerBook, #containerAccessories
{
width: 80%;
grid-template-columns: repeat(2, 1fr);
}
}
JAVASCRIPT
//
console.clear();
let contentTitle;
console.log(document.cookie);
function
dynamicClothingSection(ob) {
let boxDiv =
document.createElement("div");
boxDiv.id = "box";
91
4
let detailsDiv =
document.createElement("div");
detailsDiv.id = "details";
let h3 = document.createElement("h3");
91
5
let h3Text =
document.createTextNode(ob.name);
h3.appendChild(h3Text);
let h4 = document.createElement("h4");
let h4Text =
document.createTextNode(ob.brand);
h4.appendChild(h4Text);
let h2 = document.createElement("h2");
let h2Text = document.createTextNode("rs " +
ob.price);
h2.appendChild(h2Text);
boxDiv.appendChild(boxLink);
boxLink.appendChild(imgTag);
boxLink.appendChild(detailsDiv);
detailsDiv.appendChild(h3);
detailsDiv.appendChild(h4);
detailsDiv.appendChild(h2);
return boxDiv;
}
//
console.log(boxDiv)
let mainContainer =
document.getElementById("mainContaine
100
r"); let containerClothing =
document.getElementById("containerClothing");
100
let containerAccessories =
document.getElementById("containerAccessori
es");
//
mainContainer.appendChild(dynamicClothingSectio
n('h ello world!!'))
// BACKEND CALLING
httpRequest.onreadystatechange =
function() {
if (this.readyState === 4) {
if (this.status == 200) {
// console.log('call successful');
contentTitle =
JSON.parse(this.responseText); if
(document.cookie.indexOf(",counter=") >=
0) {
var counter =
document.cookie.split(",")[1].split("=")[1];
document.getElementById("badge").inner
HTML
= counter;
}
for (let i = 0; i < contentTitle.length; i++)
{
if (contentTitle[i].isAccessory) {
console.log(contentTitle[i]);
containerAccessories.appendChild(
dynamicBookSection(contentTitle[i])
101
);
} else {
console.log(contentTitle[i]
);
containerBook.appendChild
(
101
bookSection(contentTitle[i])
);
}
}
} else {
console.log("call failed!");
}
}
};
httpRequest.ope
n( "GET",
"https://5d76bf96515d1a0014085cf9.mockapi.io/
prod uct",
true
);
httpRequest.send();
Product Page
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device- width, initial-
scale=1.0">
<meta http-equiv="X-UA-
Compatible" content="ie=edge">
<title> CONTENT DETAILS | E-COMMERCE WEBSITE BY
EDYODA </title>
102
<!-- favicon -->
<link rel="icon"
href="https://yt3.ggpht.com/a/AGF-
l78km1YyNXmF0r3- 0CycCA0HLA_i6zYn_8NZEg=s900-c-
k-c0xffffffff-no-rj- mo" type="image/gif"
sizes="16x16">
<!-- <link rel="stylesheet" href="/box1.css"> -
->
<link rel="stylesheet"
href="css/contetDetails.css">
<link
href="https://fonts.googleapis.com/css?
family=Lato& display=swap" rel="stylesheet">
<!-- header links -->
<script
src="https://kit.fontawesome.com/4a3b1f73a2.js
"></s cript>
<link
href="https://fonts.googleapis.com/css?
family=Lato& display=swap" rel="stylesheet">
</head>
<body>
<!-- HEADER -->
<div id="1"></div>
<script>
load("header.html"
); function
load(url)
{
req = new
XMLHttpRequest();
103
req.open("GET", url,
false); req.send(null);
103
document.getElementById(1).innerHT
ML = req.responseText;
}
</
script>
<div id="containerProduct">
<!-- JS rendered code -->
</div>
<script src="/contentDetails.js"></script>
CSS
104
body
{
margin: 0;
104
text-transform: capitalize;
font-family: 'Lato', sans-
serif; font-weight: 100;
}
#containerProduct
{
padding-top: 80px;
}
#containerD
{
width: 90%;
margin: auto;
display: grid;
grid-template-columns: 1fr
2fr; padding: 80px 40px;
}
#imageSection
{
width: 80%;
margin: auto;
}
#imageSection img
{
width: 100%;
float: right;
border-radius: 10px;
box-shadow: 1px 2px 6px 2px rgb(219, 219, 219);
}
#imageSection img:hover
{
box-shadow: 1px 0px 9px 1px rgb(3, 122, 122);
105
}
#productDetails
{
width: 100%;
}
h1
{
font-size: 35px;
letter-spacing:
1px; word-spacing:
2px;
}
h4
{
font-size: 15px;
font-weight:
bold;
color: rgb(3, 122,
122); letter-spacing:
1px; word-spacing:
2px;
}
#productPreview
{
padding-bottom: 10px;
}
#productPreview > img
{
width: 50px;
padding: 10px
10px; border-
106
radius: 15px;
cursor: pointer;
}
106
p
{
font-size: 15px;
word-spacing: 2px;
letter-spacing:
1px; line-height:
25px;
}
button
{
padding: 10px
15px; color:
white;
background-color: rgb(3, 122,
122); border: none;
border-radius:
5px; cursor:
pointer; font-
size: 20px;
}
button a
{
text-decoration:
none; font-size:
18px;
}
button:hover
{
background-color: rgb(3, 94, 94);
}
button a:focus
{
outline: none;
107
}
107
/* MEDIA QUERY
*/
@media(max-width: 1300px)
{
h1
{
font-size: 28px;
}
#productPreview > img
{
width: 40px;
padding: 10px
10px;
padding-bottom: 30px;
}
button
{
padding: 8px 13px;
background-color: rgb(3, 122,
122); border: none;
border-radius:
5px; cursor:
pointer;
}
}
@media(max-width: 1170px)
{
h1
{
font-size: 22px;
}
108
#productPreview > img
108
{
width: 40px;
padding: 10px
10px;
padding-bottom: 30px;
}
button a
{
font-size: 15px;
}
h4, p
{
font-size: 13px;
}
h3
{
font-size: 15px;
}
@media(max-width: 900px)
{
/* #containerProduct
*/ #containerD
{
width: 60%;
margin: auto;
display: grid;
grid-template-columns: 1fr;
}
#imageSection
109
{
width: 100%;
text-align: center;
}
#imageSection img
{
text-align:
center; width:
70%;
float: none;
}
#productDetails
{
width: 100%;
}
#button
{
text-align: center;
}
}
@media(max-width: 650px)
{
#containerD
{
width: 80%;
}
}
JAVASCRIPT
console.clear()
let id = location.search.split('?')[1]
110
console.log(id)
if(document.cookie.indexOf(',counter=')>=0)
{
let counter =
document.cookie.split(',')
[1].split('=')[1]
document.getElementById("badge").innerHT
ML = counter
}
function dynamicContentDetails(ob)
{
let mainContainer =
document.createElement('di
v')
mainContainer.id = 'containerD'
document.getElementById('containerProduct')
.app
endChild(mainContainer);
let imageSectionDiv =
document.createElement('di
v')
imageSectionDiv.id = 'imageSection'
let imgTag =
document.createElement('img')
imgTag.id = 'imgDetails'
//imgTag.id =
ob.photos imgTag.src
= ob.preview
111
imageSectionDiv.appendChild(imgT
112
// console.log(productDetailsDiv);
let h1 = document.createElement('h1')
let h1Text =
document.createTextNode(ob.name)
h1.appendChild(h1Text)
let h4 = document.createElement('h4')
let h4Text =
document.createTextNode(ob.brand)
h4.appendChild(h4Text)
console.log(h4);
let detailsDiv =
document.createElement('div')
detailsDiv.id = 'details'
let h3DetailsDiv =
document.createElement('h3') let
h3DetailsText = document.createTextNode('Rs
' + ob.price)
h3DetailsDiv.appendChild(h3DetailsText)
let h3 =
document.createElement('h3') let
h3Text =
document.createTextNode('Descripti
on') h3.appendChild(h3Text)
let para =
document.createElement('p') let
paraText =
113
document.createTextNode(ob.descript
ion) para.appendChild(paraText)
let productPreviewDiv
=
document.createElement('di
v')
114
productPreviewDiv.id = 'productPreview'
let
h3ProductPreviewDiv =
document.createElement('h3
')
let h3ProductPreviewText =
document.createTextNode('Product
Preview')
h3ProductPreviewDiv.appendChild(h3ProductPrev
ie wText)
productPreviewDiv.appendChild(h3ProductPreviewD
iv)
let i;
for(i=0; i<ob.photos.length; i++)
{
let
imgTagProductPreviewDiv =
document.createElement('img')
imgTagProductPreviewDiv.id =
'previewImg'
imgTagProductPreviewDiv.src =
ob.photos[i]
imgTagProductPreviewDiv.onclick =
function(event)
{
console.log("clicked" + this.src)
imgTag.src = ob.photos[i]
document.getElementById("imgDetails
").s
rc = this.src
115
}
productPreviewDiv.appendChild(imgTagProdu
ct PreviewDiv)
}
116
buttonDiv.id = 'button'
let buttonTag =
document.createElement('butto
n')
buttonDiv.appendChild(buttonTag)
buttonText =
document.createTextNode('Add to Cart')
buttonTag.onclick = function()
{
let order = id+"
" let counter =
1
if(document.cookie.indexOf(',counter=')>=0)
{
order = id + " " +
document.cookie.split(',')
[0].split('=')[1]
counter =
Number(document.cookie.split(',')[1].split('=')
[1])
+ 1
}
document.cookie = "orderId=" +
order + ",counter=" + counter
document.getElementById("badge").innerHTML
= counter
console.log(document.cookie)
}
buttonTag.appendChild(buttonText)
117
console.log(mainContainer.appendChild(imageSe
ct ionDiv));
mainContainer.appendChild(imageSectionDiv)
118
mainContainer.appendChild(productDetailsDi
v) productDetailsDiv.appendChild(h1)
productDetailsDiv.appendChild(h4)
productDetailsDiv.appendChild(detailsDiv)
detailsDiv.appendChild(h3DetailsDiv)
detailsDiv.appendChild(h3)
detailsDiv.appendChild(para)
productDetailsDiv.appendChild(productPreviewD
iv
)
productDetailsDiv.appendChild(buttonDiv)
return mainContainer
}
// BACKEND CALLING
httpRequest.open('GET',
'https://5d76bf96515d1a0014085cf9.mockapi.io/prod
uc t/'+id, true)
httpRequest.send()
Shopping Cart
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device- width, initial-
scale=1.0">
<meta http-equiv="X-UA-
Compatible" content="ie=edge">
120
<title> Cart | E-COMMERCE WEBSITE BY EDYODA
</title>
<link rel="stylesheet" href="css/cart.css">
<!-- favicon -->
<link rel="icon"
href="https://yt3.ggpht.com/a/AGF-
l78km1YyNXmF0r3- 0CycCA0HLA_i6zYn_8NZEg=s900-c-
k-c0xffffffff-no-rj- mo" type="image/gif"
sizes="16x16">
<!-- header links -->
<script
src="https://kit.fontawesome.com/4a3b1f73a2.js
"></s cript>
<link
href="https://fonts.googleapis.com/css?
family=Lato& display=swap" rel="stylesheet">
</head>
<body>
<!-- HEADER -->
<div id="1"></div>
<script>
load("header.html"
); function
load(url)
{
req = new XMLHttpRequest();
req.open("GET", url, false);
req.send(null);
document.getElementById(1).innerHT
ML =
req.responseTex
t;
121
}
</script>
122
<!-- CART CONTAINER -->
<div id="cartMainContainer">
<h1> Checkout </h1>
<h3 id="totalItem"> Total Items: 0 </h3>
<div id="cartContainer">
<!-- JS rendered code -->
</div>
</div>
</body>
<!-- FOOTER -->
<div id="4"></div>
<script>
load("footer.html"
); function
load(url)
{
req = new XMLHttpRequest();
req.open("GET", url, false);
req.send(null);
document.getElementById(4).innerHT
ML =
req.responseTex
t;
}
</script>
<script src="/cart.js"></script>
</html>
123
CSS
body
124
{
margin: 0;
font-family: 'Lato', sans-serif;
}
#cartMainContainer
{
padding: 90px 50px;
}
#cartContainer
{
display: grid;
grid-template-columns: 1fr
1fr; grid-gap: 20px;
}
im
g
{ width:
80px;
float:
left;
border-radius:
} 10px; margin-
right: 50px;
#boxContainer
{
{
}
#bo
x
125
d ding: 20px;
i width: 100%;
s /* float: left; */
p
l
a
y background-color: white;
:
g
r
i
d
;
g
r
i
d
-
g
a
p
:
2
0
p
x
;
p
a
d
126
box-shadow: 1px 2px 2px rgb(219 219, 219)
6px , ;
border-radius: 10px;
width: 100%;
/* margin: auto */
padding: 20px 10px;
}
#box:hover
{
box-shadow: 0px 1px 3px 2px rgb(185, 185, 185);
}
#totalContainer
{
width: 50%;
padding:
20px;
margin:
auto;
background-color:
white; border-radius:
10px;
box-shadow: 1px 2px 6px 2px rgb(219, 219, 219);
}
#totalContainer:hover
{
box-shadow: 0px 1px 3px 2px rgb(185, 185, 185);
}
button
{
padding: 8px 12px;
background-color: rgb(3, 122,
122); border: none;
127
border-radius:
5px; cursor:
pointer;
}
button a
128
{
text-decoration:
none; color: white;
font-size: 15px;
}
button:hover
{
background-color: rgb(3, 94, 94);
}
button a:focus
{
outline: none;
}
/* MEDIA QUERY
*/
@media(max-width: 800px)
{
im
g
{ width: 60px;
margin-right: 20px;
}
h3, h4
{
font-size: 14px;
}
h2
{
font-size: 18px;
}
129
#cartMainContainer
{
padding: 90px 20px;
}
}
@media(max-width: 555px)
{
#cartContainer
{
display: grid;
grid-template-columns: 1fr;
}
#boxContainer
{
padding:
20px; width:
80%;
}
}
JAVASCRIPT
console.clear();
if(document.cookie.indexOf(',counter=')>=0)
{
let counter =
document.cookie.split(',')
[1].split('=')[1]
document.getElementById("badge").innerHT
ML = counter
130
}
131
let cartContainer =
document.getElementById('cartContain
er')
let boxContainerDiv =
document.createElement('div')
boxContainerDiv.id = 'boxContainer'
let boxImg =
document.createElement('img')
boxImg.src = ob.preview
boxDiv.appendChild(boxImg)
le boxh3 = document.createElement('h3')
t
le h3Text = +
t document.createTextNode(ob.name
' × ' itemCounter)
+
// let h3Text =
document.createTextNode(ob.name)
boxh3.appendChild(h3Te
xt)
boxDiv.appendChild(box
h3)
132
let boxh4 = document.createElement('h4')
let h4Text =
document.createTextNode('Amount: Rs' +
ob.price)
boxh4.appendChild(h4Te
xt)
boxDiv.appendChild(box
h4)
133
// console.log(boxContainerDiv);
buttonLink.appendChild(buttonText)
cartContainer.appendChild(boxContainerDiv)
cartContainer.appendChild(totalContainerDiv)
// let cartMain = document.createElement('div')
// cartmain.id = 'cartMainContainer'
// cartMain.appendChild(totalContainerDiv)
return cartContainer
}
let totalContainerDiv =
document.createElement('div')
totalContainerDiv.id =
'totalContainer'
let totalDiv =
document.createElement('div')
totalDiv.id = 'total'
totalContainerDiv.appendChild(totalDiv)
let totalh2 =
document.createElement('h2') let h2Text
= document.createTextNode('Total
Amount')
totalh2.appendChild(h2Text)
totalDiv.appendChild(totalh2)
135
let totalh4Text =
document.createTextNode('Amount: Rs ' +
amount)
totalh4Text.id = 'toth4'
totalh4.appendChild(totalh4Text)
totalDiv.appendChild(totalh4)
totalDiv.appendChild(buttonDiv)
console.log(totalh4);
}
let buttonDiv =
document.createElement('div')
buttonDiv.id = 'button'
totalDiv.appendChild(buttonDiv)
let buttonTag =
document.createElement('button')
buttonDiv.appendChild(buttonTag)
let buttonLink =
document.createElement('a')
buttonLink.href = '/orderPlaced.html?'
buttonTag.appendChild(buttonLink)
buttonText = document.createTextNode('Place
Order') buttonTag.onclick = function()
{
console.log("clicked")
}
//dynamicCartSection()
// console.log(dynamicCartSection());
136
// BACKEND CALL
let httpRequest = new
XMLHttpRequest() let totalAmount =
0
137
httpRequest.onreadystatechange = function()
{
if(this.readyState === 4)
{
if(this.status == 200)
{
// console.log('call
successful'); contentTitle =
JSON.parse(this.responseText)
let counter =
Number(document.cookie.split(',')
[1].split('=')[1])
document.getElementById("totalItem"
).in nerHTML = ('Total Items: ' + counter)
let item =
document.cookie.split(',')[0].split('=')
[1].split(" ")
console.log(counte
r)
console.log(item)
let i;
let totalAmount = 0
for(i=0; i<counter; i+
+)
{
let itemCounter = 1
for(let j = i+1; j<counter; j++)
{
)
Number(item[i])
138
if(Number(item[j])
==
{
itemCounter
+=1;
139
}
}
totalAmount +=
Number(contentTitle[item[i]-1].price) * itemCounter
dynamicCartSection(contentTitle[i
te m[i]-1],itemCounter)
i += (itemCounter-1)
}
amountUpdate(totalAmount)
}
}
els
e
{ console.log('call failed!');
}
}
httpRequest.open('GET',
'https://5d76bf96515d1a0014085cf9.mockapi.io/prod
uc t', true)
httpRequest.send()
140
8. OUTPUT OF SCREEN
Login Page
141
Home Page
142
Product Page
143
Shopping Cart
144
9. IMPLEMENTATION OF SECURITY
and maintain the trust of your customers. Here are some key
security implementations:
factor
145
site
146
Cross-Site Request Forgery (CSRF) Protection: Implemented
ensure
measures.
of a
147
effectiveness.
148
10. LIMITATIONS OF PROJECT
advanced
platforms.
149
Performance Limitations: Your project may experience
contact
150
11. FUTURE SCOPE OF PROJECT
E-commerce had bloomed over the years and is one of the fastest-
growing domains in the online world. Though it took some time for
where the majority of the people love to shop online. There were
for all their shopping needs. In India, people prefer shopping online
these days rather than having to visit the physical store. The
payment features that are smart and secure as well as the cash
151
learning algorithms to provide personalized
book recommendations.
security
audits.
152
12. CONCLUSION
processes.
This project Online Shopping System is very helpful for where the
153
the descriptions selecting their required brands and on
154
confirmation they can add to their shopping cart and buy. The
buyer can choose the mode of payment and can easily pay for the
bought products.
content.
155
13. BIBLIOGRAPHY
reference book
https://www.w3schools.com/html
JavaScript
https://www.w3schools.com/javascript
www.google.com
156