You are on page 1of 93

A

Project Report
On
E-COMMERCE WEBSITE USING WORDPRESS
Submitted in partial fulfillment of
The requirements for the award of the Degree of

BACHELOR OF TECHNOLOGY
IN
Information Technology

By
MUKUL CHAND GUPTA
1101210429
Under the esteemed guidance of

Prof. Dr. G.S.S.Rao


HOD of IT Deptt.

DEPARTMMENT OF INFORMATION TECHNOLOGY

GANDHI INSTITUTE OF ENGINEERING AND TECHNOLOGY


GUNUPUR 765022
2014-2015

E-commerce Website
Project Documentation

DECLARATION
I hereby declare that the project entitled E-COMMERCE WEBSITE USING
WORDPRESS submitted for the B.Tech. Degree is my original work and the project has not
formed the basis for the award of any degree, associateship, fellowship or any other similar titles.

Signature of the Student:


Place:
Date:

Gandhi Institute Of Engineering and Technology

Page 2

E-commerce Website
Project Documentation

Gandhi Institute of
Engineering & Technology

ISO 9001:2000
Certified Institute

GUNUPUR 765 022, Dist: Rayagada (Odisha), India

(Approved by AICTE, Govt. of Orissa and Affiliated to Biju Patnaik University of Technology)

: 06857 250172(Office), 251156(Principal), 250232(Fax),


e-mail: gandhi_giet@yahoo.com visit us at www.giet.org

Department of Information Technology


CERTIFICATE
This is to certify that the project entitled ECOMMERCE WEBSITE USING WORPDRESS is the
bonafide work carried out by Mr Mukul Chand Gupta,
University Regd. No-1101210429students of B. Tech
(IT),

Gandhi

Institute

of

Engineering

and

Technology, Gunupur during the academic year 201115 in partial fulfillment of the requirements for the award
of

the

Degree

of

Bachelor

of

Technology

in

Information Technology.

Prof. Dr. G.S.S.Rao


Project Guide

Gandhi Institute Of Engineering and Technology

Prof. Dr. G.S.S.Rao


HOD (IT)

Page 3

E-commerce Website
Project Documentation
HOD in Department of IT,
G.I.E.T., Gunupur

G.I.E.T., Gunupur

ACKNOWLEDGEMENT
My sincere thanks to Prof Dr G.S.S.RAO, Head of the Department of
Information Technology, Gandhi Institute of Engineering and Technology
Gunupur for his encouragement and valuable suggestions during period of my
project work.
No words would suffice to express my regard and gratitude to all the faculty
members of Department Information Technology GIET, Gunupur for his inspiring
guidance, constant encouragement, immense support and help during the course of
the project.
I express my heartfelt gratitude to Principal, GIET, Gunupur for permitting
me to carry out this project work.

MUKUL CHAND GUPTA

Gandhi Institute Of Engineering and Technology

Page 4

E-commerce Website
Project Documentation

ABSTRACT
E-commerce is the most visible business use of the World Wide Web. The
primarygoal of an e-commerce site is to sell goods and services online.This project
deals with developing an e-commerce website for Online store where business
houses can create their own business portfolio of their product and services.It
provides the user with a catalog of different product and services. It facilitates
theuser to get information of different business houses and about their products
andservices before making purchasing decisions. The system is implemented using
a 3-tier approach, with a backend database, a middle tier of apache and PHP, and a
web browser as the front end client. In order to develop an e-commerce website, a
number of Technologies must be studied and understood. These include multitiered architecture, server and client side scripting techniques, implementation
technologies such as Wordpress is Content Management system and PHP,
programming language relational databases (such as MySQL).This is a project
with the objective to develop a basic website where a business houses can create
their own account of their products and services. With this website no other
business needs to create their own websites and bear its cost

Gandhi Institute Of Engineering and Technology

Page 5

E-commerce Website
Project Documentation

TABLE OF CONTENTS
Page No.
Title page
Declaration by the Student
Certificate by the Guide
Acknowledgement
Abstract
List of Figures
Chapter 1
Introduction......9
1.1 What is E-commerce.10
1.2 Types of E-commerce...11

Chapter 2
System Analysis & Implementation.15
2.1. Requirements Analysis15
2.1.1 Product Perspective................................................15
2.1.1 User Interface..............................................................15
Gandhi Institute Of Engineering and Technology

Page 6

E-commerce Website
Project Documentation
2.1.1 Hardware Interface......................................................16
2.1.1 Software Interface.................................................. ...17

Chapter 3
System Design & Specification..21
3.1 Data Model ...21
2.2 E-R Diagram.22
3.3 DFD..23
3.4 Use case Diagram..33
3.5 Database Design....34
3.6 Data Dictionary.35
3.7 Implementation Overview.44
Chapter 4
Software Code......51
Chapter 5
Testing..77
Chapter 6
Advantages and Applications.............84
Chapter 7
Conclusion and future work.......................87

Gandhi Institute Of Engineering and Technology

Page 7

E-commerce Website
Project Documentation

Gandhi Institute Of Engineering and Technology

Page 8

E-commerce Website
Project Documentation

List of Figures

Process of E-commerce:-..1.1.1
Business-to-business (B2B):- ...1.2.1
Business-to-consumer (B2C):- .1.2.2
Business-to-government(B2G):- ..1.2.3
Consumer-to- consumer (C2C):- ..1.2.4
Government-to- consumer (G2C):- ..1.2.5
Government-to- business (G2B):- ....1.2.6
Xamp server..2.2.1
Wordpress Dashboard...2.2.2
Xamp server..2.2.3
E-R-diagram..3.2.1
DFD context level.3.3.1
First level DFD..3.3.2
Second level DFD.3.3.3
Use Case Diagram (USER)...3.4.1
Use Case Diagram(ADMIN).....3.4.2
Database Design....3.5.1
Home Page....3.6.1
User Login.3.6.2
Add Cart3.6.3
Product..3.6.4
Sub product Man/Women.3.6.8

Chapter-1

Introduction
It is known globally that, in todays market, it is extremely difficult to start a new
smallscale business and its sustenance with competition from the well-established
and settled/brand owners. Most often, even if the quality of the product is really
Gandhi Institute Of Engineering and Technology

Page 9

E-commerce Website
Project Documentation
good, due to a lack of advertisement or business at the small scale, it just becomes
another face in the sea, and the product does not reach a larger group of customers.
In fast paced life of today when everyone is squeezed for time, the majority of
people are finicky when it comes to doing physical shopping. Logistically, a
consumer finds a product more interesting and attractive when they find it on the
website of a retailer directly and are able to see items details online. The
customers of today are not only attracted because online shopping is very
convenient, but also because they have broader selections, highly competitive
prices, better information about the product (including peoples reviews) and
extremely simplified navigation for searching regarding the product. Moreover,
business owners often offer online shopping options at low rates because the
overhead expenses in opening and running a physical store are higher. Further,
with online shopping, their products have access to a worldwide market, which
increases the number of customers from different ethnic groups, adds customer
value, and overall sustainable in the marketing. Online web stores, such as Amazon
and eBay, have gained huge popularity over the years because one can buy almost
everything at these stores. These web stores also give an opportunity to a lot of
small-scale companies and manufactures to reach the global market and to directly
sell their products to people without involving different other companies or
middlemen before their product can reach the shelves of a physical store.
1.1 What is E-commerce:Electronic commerce or ecommerce is a term for any type of
business, or commercial transaction, that involves the transfer of information
across the Internet. It covers a range of different types of businesses, from
consumer based retail sites, through auction or music sites, to business exchanges

Gandhi Institute Of Engineering and Technology

Page 10

E-commerce Website
Project Documentation
TRADING goods and services between corporations. It is currently one of the
most important aspects of the Internet to emerge.
Working of E-commerce:- The consumer moves through the internet to the
merchant's web site. From there, he decides that he wants to purchase something,
so he is moved to the online transaction server, where all of the information he
gives is encrypted. Once he has placed his order, the information moves through a
private gateway to a Processing Network, where the issuing and acquiring banks
complete or deny the transaction. This generally takes place in no more than 57seconds.

There are many different payment systems available to accommodate the varied
processing needs of merchants, from those who have a few orders a day to those
who process thousands of transactions daily.With the addition of Secure Layer
Technology-commerce is also a very safe way to complete transactions.

Gandhi Institute Of Engineering and Technology

Page 11

E-commerce Website
Project Documentation

1.2 Type of E-commerce:

Business-to-business (B2B)
Business-to-Consumer (B2C)
Business-to-government (B2G)
Consumer-to-consumer (C2C)
Government to consumer (G2C)
Government-to-business (G2B)

Business-to-business (B2B):B2B e-commerce is simply defined as ecommerce between


companies. About 80% of e-commerce is of this type.
Examples: Heinz selling ketchup to Mc Donalds
Intell selling microprocessor to Dell

Figure 1.2.1
Business-to-Consumer (B2C):(B2C)Business-to-consumer e-commerce, or commerce between
companies and consumers, involves customers gathering information; purchasing
physical goods or receiving products over an electronic network.
Examples:-

Gandhi Institute Of Engineering and Technology

Page 12

E-commerce Website
Project Documentation
Dell selling me a laptop.

Figure 1.2.2
Business-to government (B2G):Business-to-government e-commerce or B2G is generally defined as
commerce between companies and the public sector. It refers to the use of the
Internet for public procurement, licensing procedures, and other governmentrelated operations.
Examples: Business pay taxes, file reports, or sell goods and services to
Govt. agencies.
.

Gandhi Institute Of Engineering and Technology

Page 13

E-commerce Website
Project Documentation

Figure 1.2.3

Consumer-to-consumer (C2C):Consumer-to-consumer e-commerce or C2C is simply commerce


between private individuals or consumers.
Examples: Mary buying an iPod from Tom on eBay
Me selling a car to my neighbor.

Figure 1.2.4

Gandhi Institute Of Engineering and Technology

Page 14

E-commerce Website
Project Documentation

Government to consumer (G2C):This Model is also a part of e-governance. The objective of this model is to
provide good and effective services to each citizen. The Government provides the
following facilities to the citizens through website. Information of all government
departments, Different welfare schemes, Different application forms to be used by
the citizens.

Figure 1.2.5

Government to business (G2B):Government-to-business (G2B) is a business model that refers to


government providing services or information to

business organization.

Government uses B2G model website to approach business organizations. Such


websites support auctions, tenders and application submission functionalities.

Figure 1.2.6

Gandhi Institute Of Engineering and Technology

Page 15

E-commerce Website
Project Documentation

Chapter-2

System Analysis & Implementation


2.1 Recruitments Analysis:2.2.1 Product Perspective:The online shopping-cart application is a web-based system. It can be
accessed using Internet Explorer 8.0 and above, Mozilla Firefox 2.0, and Google
Chrome.
2.2.2 User Interface:The two interface types found in the online shopping-cart application
are as follows:
1. User Interface: Users are able to view the home page of the shopping-cart
application, browse the different categories, browse and add any number of items
from any categories in the shopping cart, look for information about each product,
delete the items in the shopping cart, save the cart for later viewing, check out or
continue shopping after adding the item to the cart, and check out the items by
completing the required information in the order form.
2. Admin Interface: The administrator is able to view the users information that
was entered during checkout in the database, can update the information, price,
shipping costs of the items, add or remove items from the main display

Gandhi Institute Of Engineering and Technology

Page 16

E-commerce Website
Project Documentation

2.1.3.. Hardware Interface:


The online shopping-cart application shall provide minimum
hardware requirements. The following hardware configurations are required for a
PC using the online shopping-cart application:
Pentium processor10
32 MB of free hard-drive space
128 MB of RAM
2.2.4Software Interface:This section lists the requirements that are needed to run the system
efficiently. The operating system needed for the system to run effectively, the
interface to run the application follow:
Adobe Dreamviwer CS6
Xamp Server
Adobe Dreamviwer CS6:-

Adobe Dreamweaver is a software program for designing web pages,


essentially a more fully featured HTML web and programming editor. The
program provides a what-you-see-is-what-you-get (WYSIWYG) interface for users
to create and edit web pages in a more user-friendly environment.
Dreamweaver supports multiple web and programming languages including
HTML, C#, Visual Basic (VB), Cascading Style Sheets (CSS), Active Server Pages
(ASP), Extensible Markup Language(XML) and others.

Gandhi Institute Of Engineering and Technology

Page 17

E-commerce Website
Project Documentation
The program is also available in a number of languages, including English,
Spanish, French, German, Japanese, Chinese (both Simplified and Traditional),
Italian, Russian, and more.
Dreamweaver was originally developed and published by Macromedia in
1997. Adobe purchased Macromedia (which included the rights to Dreamweaver)

in 2005 and continued the development of the program. The many features of
Dreamweaver make it a versatile web editing tool, where it be for creating
complex or very simples sites.
Xamp Server:-

It is a free open source cross-platform web server package.

2.1.1 Figure Xamp server


2.2 Platform Requirements: Wordpress
Woo Commerce Pluguins
Wordpress:-

An open source blogging tool and publishing platform that can be customized into
a content management system (CMS).Other words we can say WordPress is web
Gandhi Institute Of Engineering and Technology

Page 18

E-commerce Website
Project Documentation
software you can use to create a beautiful website or blog. We like to say that
WordPress is both free and priceless at the same time
Examples wordpress websites: CNN
Time Magazine
TechCrunch

Figure 2.2.2 Wordpress Dashboard

What is CMS(content management system):-

Gandhi Institute Of Engineering and Technology

Page 19

E-commerce Website
Project Documentation
A content management system (CMS) is a system used to manage the content of a
Web site. Typically, a CMS consists of two elements: the content management
application (CMA) and the content delivery application (CDA). The CMA element
allows the content manager or author, who may not know Hypertext Markup
Language (HTML), to manage the creation, modification, and removal of content
from a Web site without needing the expertise of a Webmaster. The CDA element
uses and compiles that information to update the Web site. The features of a CMS
system vary, but most include Web-based publishing, format management, revision
control, and indexing, search, and retrieval.

How to install Wordpress in web server:-

Download the Wordpress through internet site:www.wordpress.org


Download it and Unpack files
Paste extract files to the physical path of the server C:\XAMPP\htdocs
Rename the file wp-config-sample to wp-config and save it
Open the file and set databasename, username, password

Gandhi Institute Of Engineering and Technology

Page 20

E-commerce Website
Project Documentation

Figure 2.2.3 Install Wordpress


Database setup with XAMPP in Wordpress

To access database WP will need Mysql-database which has a name SQLUsername the appropriate password
the database host is localhost
With XAMPP username and password are root to create a database use
PhpMyAdmin
http://localhost/XAMPP
Login the Wordpress
Before you can make any changes to your site, you will need to log in. The
login for your site is
typically found at the following URL - http://your-wordpress-site.com/wpadmin. Obviously, replace your-wordpress-site.com with your actual domain
name.
Woo Commerce Pluguins:-

Woo Commerce is the most popular open source e-commerce plug-in for
Wordpress. It is designed for small to large-sized online merchants using
Wordpress. Launched on September 27, 2011, the plug-in quickly became famous
for its simplicity to install and customization and being free in nature

Gandhi Institute Of Engineering and Technology

Page 21

E-commerce Website
Project Documentation

Chapter-3

System Design & Specification


In order to design a web site, the relational database must be designed first.
Conceptual design can be divided into two parts: The data model and the process
model. The data model focuses on what data should be stored in the database while
the process model deals with how the data is processed. To put this in the context
of the relational database, the data model is used to design the relational tables. The
process model is used to design the queries that will access and perform operations
on those tables.
3.1 Data Model:A data model is a conceptual representation of the data structures that are
required by a database. The first step in designing a database is to develop an
Gandhi Institute Of Engineering and Technology

Page 22

E-commerce Website
Project Documentation
Entity-Relation Diagram (ERD). The ERD serves as a blue print from which a
relational database maybe deduced. Figure 3.1.1 shows the ERD for the project and
later we will show the transformation from ERD to the Relational model.
Entity A matches exactly one record in entity B and every record in B matches
exactly one record in A. One to many means that every record in A matches zero or
more records in B and every record in B matches exactly one record in A. If there
is a one to many relationships between two entities, then these entities are
represented as Associative Entities. In the Relational Database model, each of the
entities will be transformed into a table. The tables are shown below along with the
attributes.

3.2 E-R-Diagram:-

Gandhi Institute Of Engineering and Technology

Page 23

E-commerce Website
Project Documentation

Figure 3.2.1 E-R-Diagram

3.3. Data Flow Diagram (DFD):-

Gandhi Institute Of Engineering and Technology

Page 24

E-commerce Website
Project Documentation
Data Flow Diagrams show the flow of data from external entities into the
system, and from one process to another within the system.
There are four symbols for drawing a DFD:
Rectangles representing external entities, which are sources or
destinations of data.
Ellipses representing processes, which take data as input,
validate and process it and output it.
Arrows representing the data flows, which can either, be
electronic data or physical items.
Open-ended rectangles or a Disk symbol representing data
stores, including electronic stores such as databases or XML
files and physical stores such as filing cabinets or stacks of
paper.
Each process within the system is first shown as a Context Level DFD and later as
a Detailed DFD. The Context Level DFD provides a conceptual view of the
process and its surrounding input, output and data stores. The Detailed DFD
provides a more detailed and comprehensive view of the interaction among the
sub-processes within the system.

Gandhi Institute Of Engineering and Technology

Page 25

E-commerce Website
Project Documentation

Figure 3.3.1 Context Level Diagram

Figure 3.3.2 First Level DFD

Gandhi Institute Of Engineering and Technology

Page 26

E-commerce Website
Project Documentation

Figure 3.3.3 First Level DFD

Gandhi Institute Of Engineering and Technology

Page 27

E-commerce Website
Project Documentation

Figure 3.3.4 Customer DFD

Gandhi Institute Of Engineering and Technology

Page 28

E-commerce Website
Project Documentation

Gandhi Institute Of Engineering and Technology

Page 29

E-commerce Website
Project Documentation
Figure 3.3.5 Customer Shopping cart DFD

Gandhi Institute Of Engineering and Technology

Page 30

E-commerce Website
Project Documentation
Figure 3.3.6 Customer Authentication DFD

Gandhi Institute Of Engineering and Technology

Page 31

E-commerce Website
Project Documentation

Figure 3.3.7 Customer Authentication User DFD

Gandhi Institute Of Engineering and Technology

Page 32

E-commerce Website
Project Documentation

Gandhi Institute Of Engineering and Technology

Page 33

E-commerce Website
Project Documentation
Figure 3.3.9 Customer New Registration DFD

3.4 Use Case DiagramUML Diagram of USER

Gandhi Institute Of Engineering and Technology

Page 34

E-commerce Website
Project Documentation

Figure 3.4.1 UML Diagram of USER

UML Diagram of ADMIN

Gandhi Institute Of Engineering and Technology

Page 35

E-commerce Website
Project Documentation

Figure 3.4.2 UML Diagram of ADMIN


3.5 Database Design-

Gandhi Institute Of Engineering and Technology

Page 36

E-commerce Website
Project Documentation

Figure 3.5.1 Database Design

Gandhi Institute Of Engineering and Technology

Page 37

E-commerce Website
Project Documentation
3.5 Data Dictionary
1. Wp_commentmeta
COLUMN NAME
meta id
comment_id
meta_key

DATA TYPE
bigint(20)
bigint(20)
varchar(255)

DESCRIPTION
Use to store commentmeta id.
Use to store comment
Use to store meta key

meta_value

longtext

Use to store meta value

DATA TYPE
bigint(20)
bigint(20)
tinytext
varchar(100)
varchar(100)
varchar(100)
datetime
datetime
text
int(11)
varchar(20)
varchar(255)
varchar(20)
bigint(20)
bigint(20)

DESCRIPTION
Use to store comment id
Use to store comment post id
Use to store comment author
Use to store comment author email
Use to store author url
Use to store author ip
Use to store comment date
Use to store comment date gmt
Use to store comment content
Use to store comment karma
Use to store comment approved
Use to store comment agent
Use to store comment type
Use to store comment parent
Use to store comment user id

2. Wp_comments
COLUMN NAME
comment_ID
comment_post_ID
comment_author
comment_author_email
comment_author_url
comment_author_IP
comment_date
comment_date_gmt
comment_content
comment_karma
comment_approved
comment_agent
comment_type
comment_parent
user_id
3.Wp_links
COLUMN NAME

DATA TYPE

DESCRIPTION

link_id
link_url

bigint(20)
varchar(255)

Use to store link id


Use to store link url

link_name

varchar(255)

Use to store link name

link_image

varchar(255)

Use to store link image

Gandhi Institute Of Engineering and Technology

Page 38

E-commerce Website
Project Documentation
link_target

varchar(25)

Use to store link target

link_description

varchar(255)

Use to store link description

link_visible

varchar(20)

Use to store link visible

link_owner

bigint(20)

Use to store link owner

link_rating

int(11)

Use to store link rating

link_updated

datetime

Use to store link update

link_rel

varchar(255)

Use to store link rel

link_notes

mediumtext

Use to store link notes

link_rss

varchar(255)

Use to store link rss

COLUMN NAME

DATA TYPE

DESCRIPTION

term_id

bigint(20)

Use to store term id

name

varchar(200)

Use to store name

slug

varchar(200)

Use to store slug

term_group

bigint(10)

Use to store term group

COLUMN NAME

DATA TYPE

DESCRIPTION

option_id

bigint(20)

Use to store id

option_name

varchar(64)

Use to store name

option_value

longtext

Use to store value

autoload

varchar(20)

Use to store autoload

5.Wp_terms

5.Wp_options

Gandhi Institute Of Engineering and Technology

Page 39

E-commerce Website
Project Documentation
6.Wp_term_relationships
COLUMN NAME

DATA TYPE

DESCRIPTION

object_id

bigint(20)

Use to store object id

term_taxonomy_id

bigint(20)

Use to store taxonomy id

term_order

int(11)

Use to store term order

6.Wp_postmeta
COLUMN NAME

DATA TYPE

DESCRIPTION

meta_id

bigint(20)

Use to store meta id

post_id

bigint(20)

Use to store post id

meta_key

varchar(255)

Use store meta key

meta_value

longtext

Use to store meta value

COLUMN NAME

DATA TYPE

DESCRIPTION

ID

bigint(20)

Use to store id

post_author

bigint(20)

Use to store post author

post_date

datetime

Use to store post date

post_date_gmt

datetime

Use to store post date gmt

post_content

longtext

Use to store content

post_title

text

Use to store title

post_expert

text

Use to store expert

8.Wp_posts

Gandhi Institute Of Engineering and Technology

Page 40

E-commerce Website
Project Documentation
post_status

varchar(20)

Use to store status

comment_status

varchar(20)

Use to store comment status

ping_status

varchar(20)

Use to store ping status

post_password

varchar(20)

Use to store post password

post_name

varchar(200)

Use to store post name

to_ping

text

Use to store ping

pinged

text

Use to store pinged

post_modified

datetime

Use to store post modified

post_modified_gmt

datetime

Use to store post modified gmt

post_content_filtered

longtext

Use to store content filterd

post_parent

bigint(20)

Use to store post parent

guid

varchar(255)

Use to store guid

menu_order

int(11)

Use to store menu order

post_type

varchar(20)

Use to store post type

post_mime_type

varchar(100)

Use to store post mime type

comment_count

bigint(20)

Use to store comment count

9.Wp_term_taxonomy
COLUMN NAME

DATA TYPE

DESCRIPTION

term_taxonomy_id

bigint(20)

Use to store taxonomy id

term_id

bigint(20)

Use to store term id

taxonomy

varchar(32)

Use to store taxonomy

description

longtext

Use to store description

parent

bigint(20)

Use to store parent

count

bigint(20)

Use to store count

Gandhi Institute Of Engineering and Technology

Page 41

E-commerce Website
Project Documentation

10.Wp_usermeta
COLUMN NAME

DATA TYPE

DESCRIPTION

umeta_id

bigint(20)

Use to store umeta id

user_id

bigint(20)

Use to store user id

meta_key

varchar(255)

Use to store meta key

meta_value

longtext

Use to store meta value

12.Wp_woocommerce_attribute_taxonomies
COLUMN NAME

DATA TYPE

DESCRIPTION

attribute_id

bigint(20)

Use to store woocommerce id

attribute_name

varchar(200)

Use to store woocommerce name

attribute_label

longtext

Use to store woocommerce label

attribute_type

varchar(200)

Use to store woocommerce type

attribute_orderby

varchar(200)

Use to store woocommerce orderby

attribute_public

int(1)

Use to store woocommerce public

16.Wp_ woocommerce_tax_rate_locations
COLUMN NAME

DATA TYPE

DESCRIPTION

tax_rate_id

bigint(20)

Use to store woocommerce tax id

tax_rate_country

varchar(200)

Use to store woocommerce tax

tax_rate_state

varchar(200)

country
Use to store woocommerce tax state

tax_rate

varchar(200)

Use to store woocommerce tax rate

tax_rate_name

varchar(200)

Use to store woocommerce tax name

Gandhi Institute Of Engineering and Technology

Page 42

E-commerce Website
Project Documentation
tax_rate_priority

bigint(20)

Use to store woocommerce tax

int(1)

priority
Use to store woocommerce tax

int(1)

compound
Use to store woocommerce tax

tax_rate_order

bigint(20)

shipping
Use to store woocommerce tax order

tax_rate_class

varchar(200)

Use to store woocommerce tax class

tax_rate_compound
tax_rate_shipping

14.Wp_ woocommerce_order_itemmeta
COLUMN NAME

DATA TYPE

DESCRIPTION

meta_id

bigint(20)

Use to store meta id

order_item_id

bigint(20)

Use to store order item id

meta_key

varchar(255)

Use to store meta key

meta_value

longtext

Use to store meta value

COLUMN NAME

DATA TYPE

DESCRIPTION

ID

bigint(20)

Use to store id

user_login

varchar(60)

Use to store user login

user_pass

varchar(64)

Use to store user pass

user_nicename

varchar(50)

Use to store user nickname

user_email

varchar(100)

Use to store user email

user_url

varchar(100)

Use to store user url

user_registered

datetime

Use to store user register

11.Wp_users

Gandhi Institute Of Engineering and Technology

Page 43

E-commerce Website
Project Documentation
user_activation_key

varchar(60)

Use to store user activation key

user_status

int(11)

Use to store user status

display_name

varchar(250)

Use to store user display name

18.Wp_termmeta
COLUMN NAME

DATA TYPE

DESCRIPTION

meta_id

bigint(20)

Use to store term meta id

woocommerce_term_i

bigint(20)

Use to store term term id

d
meta_key

varchar(255)

Use to store term meta key

meta_value

longtext

Use to store term meta value

13.Wp_ woocommerce_tax_rates
COLUMN NAME

DATA TYPE

DESCRIPTION

tax_rate_id

bigint(20)

Use to store tax rate id

tax_rate_country

varchar(200)

Use to store tax rate country

tax_rate_state

varchar(200)

Use to store tax rate state

tax_rate

varchar(200)

Use to store tax rate

tax_rate_name

varchar(200)

Use to store tax rate name

tax_rate_priority

bigint(20)

Use to store tax rate prirority

tax_rate_compound

int(1)

Use to store tax rate compound

tax_rate_shipping

int(1)

Use to store tax rate shipping

Gandhi Institute Of Engineering and Technology

Page 44

E-commerce Website
Project Documentation
tax_rate_order

bigint(20)

Use to store tax rate order

tax_rate_class

varchar(200)

Use to store tax rate class

15.Wp_ woocommerce_order_item
COLUMN NAME

DATA TYPE

DESCRIPTION

order_item_id

bigint(20)

Use to store order item id

order_item_name

longtext

Use to store order item name

order_item_type

varchar(200)

Use to store order item type

order_id

bigint(20)

Use to store order item order id

17.Wp _woocommerce_downlodable_product_permission
COLUMN NAME

DATA TYPE

DESCRIPTION

permission_id

bigint(20)

Use to store permission id

download_id

varchar(32)

Use to store download id

product_id

bigint(20)

Use to store product id

order_id

bigint(20)

Use to store order id

order_key

varchar(200)

Use to store order key

user_email

varchar(200)

Use to store user email

user_id

bigint(20)

Use to store user id

downloads_remaining varchar(9)

Use to store downloads remaining

access_granted

datetime

Use to store acces granted

access_expires

datetime

Use to store access expriess

Gandhi Institute Of Engineering and Technology

Page 45

E-commerce Website
Project Documentation
download_count

Use to store download count

bigint(20)

3.6 Implementation Overview


Home Page

Gandhi Institute Of Engineering and Technology

Page 46

E-commerce Website
Project Documentation

3.6.1 Figure Home Page

User Login Page

Gandhi Institute Of Engineering and Technology

Page 47

E-commerce Website
Project Documentation

3.6.2 Figure User Login Page

Add Cart Page

Gandhi Institute Of Engineering and Technology

Page 48

E-commerce Website
Project Documentation

3.6.3 Figure Add Cart Page


Shop Categories

Gandhi Institute Of Engineering and Technology

Page 49

E-commerce Website
Project Documentation

3.6.4 Figure Categories


Product Screen shot

Gandhi Institute Of Engineering and Technology

Page 50

E-commerce Website
Project Documentation

3.6.5 Figure Product Page


Man Categories

Gandhi Institute Of Engineering and Technology

Page 51

E-commerce Website
Project Documentation

3.6.6 Figure Sub Categories Man

Women Categories

Gandhi Institute Of Engineering and Technology

Page 52

E-commerce Website
Project Documentation

3.6.7Figure Sub Categories Women

Gandhi Institute Of Engineering and Technology

Page 53

E-commerce Website
Project Documentation

Chapter-4

Software Coding
Wordpress Database Config:<?php
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'shopcart');
/** MySQL database username */
define('DB_USER', 'root');
/** MySQL database password */
define('DB_PASSWORD', '');
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
/**#@+
* Authentication Unique Keys and Salts.
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secretkey/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This
will force all users to have to log in again.
Gandhi Institute Of Engineering and Technology

Page 54

E-commerce Website
Project Documentation
*/
define('AUTH_KEY',

'put your unique phrase here');

define('SECURE_AUTH_KEY', 'put your unique phrase here');


define('LOGGED_IN_KEY',
define('NONCE_KEY',
define('AUTH_SALT',

'put your unique phrase here');

'put your unique phrase here');


'put your unique phrase here');

define('SECURE_AUTH_SALT', 'put your unique phrase here');


define('LOGGED_IN_SALT', 'put your unique phrase here');
define('NONCE_SALT',

'put your unique phrase here');

* You can have multiple installations in one database if you give each a unique
* prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';
/**
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*/
define('WP_DEBUG', false);
/* That's all, stop editing! Happy blogging. */
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

Gandhi Institute Of Engineering and Technology

Page 55

E-commerce Website
Project Documentation

index.php
<?php get_header(); ?>
<div id="main-content">
<div class="container">
<div id="content-area" class="clearfix">
<div id="left-area">
<?php
if ( have_posts() ) :
while ( have_posts() ) : the_post();
$post_format = get_post_format(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'et_pb_post' ); ?>>
<?php
$thumb = '';
$width = (int) apply_filters( 'et_pb_index_blog_image_width', 1080 );
$height = (int) apply_filters( 'et_pb_index_blog_image_height', 675 );
$classtext = 'et_pb_post_main_image';
$titletext = get_the_title();
$thumbnail = get_thumbnail( $width, $height, $classtext, $titletext,
$titletext, false, 'Blogimage' );
$thumb = $thumbnail["thumb"];
et_divi_post_format_content();
if ( ! in_array( $post_format, array( 'link', 'audio', 'quote' ) ) ) {

Gandhi Institute Of Engineering and Technology

Page 56

E-commerce Website
Project Documentation
if ( 'video' === $post_format && false !== ( $first_video =
et_get_first_video() ) ) :
printf('<div class="et_main_video_container">%1$s</div>',$first_video);
elseif ( 'gallery' === $post_format ) :
et_gallery_images();
elseif ( 'on' == et_get_option( 'divi_thumbnails_index', 'on' ) && '' !==
$thumb ) :
?>
<a href="<?php the_permalink(); ?>">
<?php print_thumbnail( $thumb, $thumbnail["use_timthumb"], $titletext, $width,
$height ); ?>
</a>
<?php
endif;
}
?>
<?php if ( ! in_array( $post_format, array( 'link', 'audio', 'quote', 'gallery' ) ) ) : ?>
<?php if ( ! in_array( $post_format, array( 'link', 'audio' ) ) ) : ?>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php endif; ?>
<?php
et_divi_post_meta();
if ( 'on' !== et_get_option( 'divi_blog_style', 'false' ) || ( is_search() && ( 'on'
=== get_post_meta( get_the_ID(), '_et_pb_use_builder', true ) ) ) )
truncate_post( 270 );

Gandhi Institute Of Engineering and Technology

Page 57

E-commerce Website
Project Documentation
else
the_content();
?>
<?php endif; ?>
</article> <!-- .et_pb_post -->
<?php
endwhile;
if ( function_exists( 'wp_pagenavi' ) )
wp_pagenavi();
else
get_template_part( 'includes/navigation', 'index' );
else :
get_template_part( 'includes/no-results', 'index' );
endif;
?>
</div> <!-- #left-area -->
<?php get_sidebar(); ?>
</div> <!-- #content-area -->
</div> <!-- .container -->
</div> <!-- #main-content -->
<?php get_footer(); ?>

Gandhi Institute Of Engineering and Technology

Page 58

E-commerce Website
Project Documentation

Header.php:<?php if ( ! isset( $_SESSION ) ) session_start(); ?>


<!DOCTYPE html>
<!--[if IE 6]>
<html id="ie6" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 7]>
<html id="ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html id="ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 6) | !(IE 7) | !(IE 8) ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<title><?php elegant_titles(); ?></title>
<?php elegant_description(); ?>
<?php elegant_keywords(); ?>
<?php elegant_canonical(); ?>
<?php do_action( 'et_head_meta' ); ?>
Gandhi Institute Of Engineering and Technology

Page 59

E-commerce Website
Project Documentation
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php $template_directory_uri = get_template_directory_uri(); ?>
<!--[if lt IE 9]>
<script src="<?php echo esc_url( $template_directory_uri . '/js/html5.js"' ); ?>"
type="text/javascript"></script>
<![endif]-->
<script type="text/javascript">
document.documentElement.className = 'js';
</script>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="page-container">
<?php
if ( is_page_template( 'page-template-blank.php' ) ) {
return;
}
$et_secondary_nav_items = et_divi_get_top_nav_items();
$et_phone_number = $et_secondary_nav_items->phone_number;
$et_email = $et_secondary_nav_items->email;
$et_contact_info_defined = $et_secondary_nav_items->contact_info_defined;
$show_header_social_icons = $et_secondary_nav_items
>show_header_social_icons;
$et_secondary_nav = $et_secondary_nav_items->secondary_nav;
$primary_nav_class = 'et_nav_text_color_' .
et_get_option( 'primary_nav_text_color', 'dark' );

Gandhi Institute Of Engineering and Technology

Page 60

E-commerce Website
Project Documentation
$secondary_nav_class = 'et_nav_text_color_' .
et_get_option( 'secondary_nav_text_color', 'light' );
$et_top_info_defined = $et_secondary_nav_items->top_info_defined;
?>
<?php if ( $et_top_info_defined ) : ?>
<div id="top-header" class="<?php echo esc_attr( $secondary_nav_class ); ?>">
<div class="container clearfix">
<?php if ( $et_contact_info_defined ) : ?>
<div id="et-info">
<?php if ( '' !== ( $et_phone_number = et_get_option( 'phone_number' ) ) ) : ?>
<span id="et-info-phone"><?php echo esc_html( $et_phone_number ); ?></span>
<?php endif; ?>
<?php if ( '' !== ( $et_email = et_get_option( 'header_email' ) ) ) : ?>
<a href="<?php echo esc_attr( 'mailto:' . $et_email ); ?>"><span id="et-infoemail"><?php echo esc_html( $et_email ); ?></span></a>
<?php endif; ?>
<?php
if ( true === $show_header_social_icons ) {
get_template_part( 'includes/social_icons', 'header' );
} ?>
</div> <!-- #et-info -->
<?php endif; // true === $et_contact_info_defined ?>
<div id="et-secondary-menu">
<?php
if ( ! $et_contact_info_defined && true === $show_header_social_icons ) {
get_template_part( 'includes/social_icons', 'header' );

Gandhi Institute Of Engineering and Technology

Page 61

E-commerce Website
Project Documentation
} else if ( $et_contact_info_defined && true === $show_header_social_icons ) {
ob_start();
get_template_part( 'includes/social_icons', 'header' );
$duplicate_social_icons = ob_get_contents();
ob_end_clean();
printf(
'<div class="et_duplicate_social_icons">
%1$s
</div>',
$duplicate_social_icons
);
}
if ( '' !== $et_secondary_nav ) {
echo $et_secondary_nav;
}
et_show_cart_total();
?>
</div> <!-- #et-secondary-menu -->
</div> <!-- .container -->
</div> <!-- #top-header -->
<?php endif; // true ==== $et_top_info_defined ?>
<header id="main-header" class="<?php echo esc_attr( $primary_nav_class ); ?
>">
<div class="container clearfix">
<?php

Gandhi Institute Of Engineering and Technology

Page 62

E-commerce Website
Project Documentation
$logo = ( $user_logo = et_get_option( 'divi_logo' ) ) && '' != $user_logo
? $user_logo
: $template_directory_uri . '/images/logo.png';
?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
<img src="<?php echo esc_attr( $logo ); ?>" alt="<?php echo
esc_attr( get_bloginfo( 'name' ) ); ?>" id="logo" />
</a>
<div id="et-top-navigation">
<nav id="top-menu-nav">
<?php
$menuClass = 'nav';
if ( 'on' == et_get_option( 'divi_disable_toptier' ) ) $menuClass .= '
et_disable_top_tier';
$primaryNav = '';
$primaryNav = wp_nav_menu( array( 'theme_location' => 'primary-menu',
'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => 'topmenu', 'echo' => false ) );
if ( '' == $primaryNav ) :
?>
<ul id="top-menu" class="<?php echo esc_attr( $menuClass ); ?>">
<?php if ( 'on' == et_get_option( 'divi_home_link' ) ) { ?>
<li <?php if ( is_home() ) echo( 'class="current_page_item"' ); ?>><a href="<?php
echo esc_url( home_url( '/' ) ); ?>"><?php esc_html_e( 'Home', 'Divi' ); ?
></a></li>
<?php }; ?>

Gandhi Institute Of Engineering and Technology

Page 63

E-commerce Website
Project Documentation
<?php show_page_menu( $menuClass, false, false ); ?>
<?php show_categories_menu( $menuClass, false ); ?>
</ul>
<?php
else :
echo( $primaryNav );
endif;
?>
</nav>
<?php
if ( ! $et_top_info_defined ) {
et_show_cart_total( array(
'no_text' => true,
) );
}
?>
<?php if ( false !== et_get_option( 'show_search_icon', true ) ) : ?>
<div id="et_top_search">
<span id="et_search_icon"></span>
<form role="search" method="get" class="et-search-form et-hidden" action="<?
php echo esc_url( home_url( '/' ) ); ?>">
<?php
printf( '<input type="search" class="et-search-field" placeholder="%1$s"
value="%2$s" name="s" title="%3$s" />',
esc_attr_x( 'Search &hellip;', 'placeholder', 'Divi' ),
get_search_query(),
esc_attr_x( 'Search for:', 'label', 'Divi' )
);
?>
Gandhi Institute Of Engineering and Technology

Page 64

E-commerce Website
Project Documentation
</form>
</div>
<?php endif; // true === et_get_option( 'show_search_icon', false ) ?>
<?php do_action( 'et_header_top' ); ?>
</div> <!-- #et-top-navigation -->
</div> <!-- .container -->
</header> <!-- #main-header -->
<div id="et-main-area">

Gandhi Institute Of Engineering and Technology

Page 65

E-commerce Website
Project Documentation

woocommerce.php:
<?php
/**
* Plugin Name: WooCommerce
* Plugin URI: http://www.woothemes.com/woocommerce/
* Description: An e-commerce toolkit that helps you sell anything. Beautifully.
* Version: 2.3.5
* Author: WooThemes
* Author URI: http://woothemes.com
* Requires at least: 4.0
* Tested up to: 4.1
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
if ( ! class_exists( 'WooCommerce' ) ) :
/**
* Main WooCommerce Class
*/
final class WooCommerce {
/**
* @var string
*/
public $version = '2.3.5';
/**
* @var WooCommerce The single instance of the class
* @since 2.1
*/
protected static $_instance = null;
/**
* @var WC_Session session
*/
public $session = null;
Gandhi Institute Of Engineering and Technology

Page 66

E-commerce Website
Project Documentation
/**
* @var WC_Query $query
*/
public $query = null;
/**
* @var WC_Product_Factory $product_factory
*/
public $product_factory = null;
/**
* @var WC_Countries $countries
*/
public $countries = null;
/**
* @var WC_Integrations $integrations
*/
public $integrations = null;
/**
* @var WC_Cart $cart
*/
public $cart = null;
/**
* @var WC_Customer $customer
*/
public $customer = null;
/**
* @var WC_Order_Factory $order_factory
*/
public $order_factory = null;
/**
* Main WooCommerce Instance
*
Gandhi Institute Of Engineering and Technology

Page 67

E-commerce Website
Project Documentation
* Ensures only one instance of WooCommerce is loaded or can be loaded.
*
* @since 2.1
* @static
* @see WC()
* @return WooCommerce - Main instance
*/
public static function instance() {
if ( is_null( self::$_instance ) ) {
self::$_instance = new self();
}
return self::$_instance;
}
/**
* Cloning is forbidden.
* @since 2.1
*/
public function __clone() {
_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?',
'woocommerce' ), '2.1' );
}
/**
* Unserializing instances of this class is forbidden.
* @since 2.1
*/
public function __wakeup() {
_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?',
'woocommerce' ), '2.1' );
}
/**
* Auto-load in-accessible properties on demand.
* @param mixed $key
* @return mixed
*/
public function __get( $key ) {

Gandhi Institute Of Engineering and Technology

Page 68

E-commerce Website
Project Documentation
if ( in_array( $key, array( 'payment_gateways', 'shipping', 'mailer',
'checkout' ) ) ) {
return $this->$key();
}
}
/**
* WooCommerce Constructor.
*/
public function __construct() {
$this->define_constants();
$this->includes();
$this->init_hooks();
do_action( 'woocommerce_loaded' );
}
/**
* Hook into actions and filters
* @since 2.3
*/
private function init_hooks() {
register_activation_hook( __FILE__, array( 'WC_Install', 'install' ) );
add_action( 'after_setup_theme', array( $this, 'setup_environment' ) );
add_action( 'after_setup_theme', array( $this,
'include_template_functions' ), 11 );
add_action( 'init', array( $this, 'init' ), 0 );
add_action( 'init', array( 'WC_Shortcodes', 'init' ) );
add_action( 'init', array( 'WC_Emails', 'init_transactional_emails' ) );
}
/**
* Define WC Constants
*/
private function define_constants() {
$upload_dir = wp_upload_dir();
$this->define( 'WC_PLUGIN_FILE', __FILE__ );

Gandhi Institute Of Engineering and Technology

Page 69

E-commerce Website
Project Documentation
$this->define( 'WC_PLUGIN_BASENAME',
plugin_basename( __FILE__ ) );
$this->define( 'WC_VERSION', $this->version );
$this->define( 'WOOCOMMERCE_VERSION', $this->version );
$this->define( 'WC_ROUNDING_PRECISION', 4 );
$this->define( 'WC_TAX_ROUNDING_MODE', 'yes' ===
get_option( 'woocommerce_prices_include_tax', 'no' ) ? 2 : 1 );
$this->define( 'WC_DELIMITER', '|' );
$this->define( 'WC_LOG_DIR', $upload_dir['basedir'] . '/wc-logs/' );
}
/**
* Define constant if not already set
* @param string $name
* @param string|bool $value
*/
private function define( $name, $value ) {
if ( ! defined( $name ) ) {
define( $name, $value );
}
}
/**
* What type of request is this?
* string $type ajax, frontend or admin
* @return bool
*/
private function is_request( $type ) {
switch ( $type ) {
case 'admin' :
return is_admin();
case 'ajax' :
return defined( 'DOING_AJAX' );
case 'cron' :
return defined( 'DOING_CRON' );
case 'frontend' :
return ( ! is_admin() || defined( 'DOING_AJAX' ) ) && !
defined( 'DOING_CRON' );
}
Gandhi Institute Of Engineering and Technology

Page 70

E-commerce Website
Project Documentation
}
/**
* Include required core files used in admin and on the frontend.
*/
public function includes() {
include_once( 'includes/class-wc-autoloader.php' );
include_once( 'includes/wc-core-functions.php' );
include_once( 'includes/wc-widget-functions.php' );
include_once( 'includes/wc-webhook-functions.php' );
include_once( 'includes/class-wc-install.php' );
include_once( 'includes/class-wc-geolocation.php' );
include_once( 'includes/class-wc-download-handler.php' );
include_once( 'includes/class-wc-comments.php' );
include_once( 'includes/class-wc-post-data.php' );
if ( $this->is_request( 'admin' ) ) {
include_once( 'includes/admin/class-wc-admin.php' );
}
if ( $this->is_request( 'ajax' ) ) {
$this->ajax_includes();
}
if ( $this->is_request( 'frontend' ) ) {
$this->frontend_includes();
}
if ( $this->is_request( 'cron' ) && 'yes' ===
get_option( 'woocommerce_allow_tracking', 'no' ) ) {
include_once( 'includes/class-wc-tracker.php' );
}
$this->query = include( 'includes/class-wc-query.php' );
The main query class
$this->api = include( 'includes/class-wc-api.php' );
Class

Gandhi Institute Of Engineering and Technology

//
// API

Page 71

E-commerce Website
Project Documentation
include_once( 'includes/class-wc-post-types.php' );
//
Registers post types
include_once( 'includes/abstracts/abstract-wc-product.php' );
//
Products
include_once( 'includes/abstracts/abstract-wc-order.php' );
//
Orders
include_once( 'includes/abstracts/abstract-wc-settings-api.php' );
//
Settings API (for gateways, shipping, and integrations)
include_once( 'includes/abstracts/abstract-wc-shipping-method.php' );
// A Shipping method
include_once( 'includes/abstracts/abstract-wc-payment-gateway.php' );
// A Payment gateway
include_once( 'includes/abstracts/abstract-wc-integration.php' );
//
An integration with a service
include_once( 'includes/class-wc-product-factory.php' );
//
Product factory
include_once( 'includes/class-wc-countries.php' );
//
Defines countries and states
include_once( 'includes/class-wc-integrations.php' );
//
Loads integrations
include_once( 'includes/class-wc-cache-helper.php' );
//
Cache Helper
include_once( 'includes/class-wc-language-packupgrader.php' );
// Download/update languages
}
/**
* Include required ajax files.
*/
public function ajax_includes() {
include_once( 'includes/class-wc-ajax.php' );
functions for admin and the front-end
}

// Ajax

/**
* Include required frontend files.
*/
public function frontend_includes() {
include_once( 'includes/wc-cart-functions.php' );
Gandhi Institute Of Engineering and Technology

Page 72

E-commerce Website
Project Documentation
include_once( 'includes/wc-notice-functions.php' );
include_once( 'includes/abstracts/abstract-wc-session.php' );
include_once( 'includes/class-wc-session-handler.php' );
include_once( 'includes/wc-template-hooks.php' );
include_once( 'includes/class-wc-template-loader.php' );
//
Template Loader
include_once( 'includes/class-wc-frontend-scripts.php' );
//
Frontend Scripts
include_once( 'includes/class-wc-form-handler.php' );
//
Form Handlers
include_once( 'includes/class-wc-cart.php' );
// The
main cart class
include_once( 'includes/class-wc-tax.php' );
// Tax
class
include_once( 'includes/class-wc-customer.php' );
//
Customer class
include_once( 'includes/class-wc-shortcodes.php' );
//
Shortcodes class
include_once( 'includes/class-wc-https.php' );
// https
Helper
}
/**
* Function used to Init WooCommerce Template Functions - This makes
them pluggable by plugins and themes.
*/
public function include_template_functions() {
if ( $this->is_request( 'frontend' ) ) {
include_once( 'includes/wc-template-functions.php' );
}
}
/**
* Init WooCommerce when WordPress Initialises.
*/
public function init() {
// Before init action
do_action( 'before_woocommerce_init' );

Gandhi Institute Of Engineering and Technology

Page 73

E-commerce Website
Project Documentation
// Set up localisation
$this->load_plugin_textdomain();
// Load class instances
$this->product_factory = new WC_Product_Factory();
Product Factory to create new product instances
$this->order_factory = new WC_Order_Factory();
Order Factory to create new order instances
$this->countries
= new WC_Countries();
Countries class
$this->integrations = new WC_Integrations();
Integrations class

//
//
//
//

// Classes/actions loaded for the frontend and for ajax requests


if ( $this->is_request( 'frontend' ) ) {
// Session class, handles session data for users - can be
overwritten if custom handler is needed
$session_class =
apply_filters( 'woocommerce_session_handler', 'WC_Session_Handler' );
// Class instances
$this->session = new $session_class();
$this->cart = new WC_Cart();
class, stores the cart contents
$this->customer = new WC_Customer();
Customer class, handles data such as customer location
}

// Cart
//

$this->load_webhooks();
// Init action
do_action( 'woocommerce_init' );
}
/**
* Load Localisation files.
*
* Note: the first-loaded translation file overrides any following ones if the
same translation is present.
Gandhi Institute Of Engineering and Technology

Page 74

E-commerce Website
Project Documentation
*
* Admin Locales are found in:
*
- WP_LANG_DIR/woocommerce/woocommerce-adminLOCALE.mo
*
- WP_LANG_DIR/plugins/woocommerce-admin-LOCALE.mo
*
* Frontend/global Locales found in:
*
- WP_LANG_DIR/woocommerce/woocommerce-LOCALE.mo
*
- woocommerce/i18n/languages/woocommerce-LOCALE.mo
(which if not found falls back to:)
*
- WP_LANG_DIR/plugins/woocommerce-LOCALE.mo
*/
public function load_plugin_textdomain() {
$locale = apply_filters( 'plugin_locale', get_locale(), 'woocommerce' );
if ( $this->is_request( 'admin' ) ) {
load_textdomain( 'woocommerce', WP_LANG_DIR .
'/woocommerce/woocommerce-admin-' . $locale . '.mo' );
load_textdomain( 'woocommerce', WP_LANG_DIR .
'/plugins/woocommerce-admin-' . $locale . '.mo' );
}
load_textdomain( 'woocommerce', WP_LANG_DIR .
'/woocommerce/woocommerce-' . $locale . '.mo' );
load_plugin_textdomain( 'woocommerce', false,
plugin_basename( dirname( __FILE__ ) ) . "/i18n/languages" );
}
/**
* Ensure theme and server variable compatibility and setup image sizes.
*/
public function setup_environment() {
/**
* @deprecated 2.2 Use WC()->template_path()
*/
$this->define( 'WC_TEMPLATE_PATH', $this->template_path() );
$this->add_thumbnail_support();
$this->add_image_sizes();
Gandhi Institute Of Engineering and Technology

Page 75

E-commerce Website
Project Documentation
$this->fix_server_vars();
}
/**
* Ensure post thumbnail support is turned on
*/
private function add_thumbnail_support() {
if ( ! current_theme_supports( 'post-thumbnails' ) ) {
add_theme_support( 'post-thumbnails' );
}
add_post_type_support( 'product', 'thumbnail' );
}
/**
* Add WC Image sizes to WP
*
* @since 2.3
*/
private function add_image_sizes() {
$shop_thumbnail = wc_get_image_size( 'shop_thumbnail' );
$shop_catalog
= wc_get_image_size( 'shop_catalog' );
$shop_single
= wc_get_image_size( 'shop_single' );
add_image_size( 'shop_thumbnail', $shop_thumbnail['width'],
$shop_thumbnail['height'], $shop_thumbnail['crop'] );
add_image_size( 'shop_catalog', $shop_catalog['width'],
$shop_catalog['height'], $shop_catalog['crop'] );
add_image_size( 'shop_single', $shop_single['width'],
$shop_single['height'], $shop_single['crop'] );
}
/**
* Fix `$_SERVER` variables for various setups.
*
* Note: Removed IIS handling due to wp_fix_server_vars()
*
* @since 2.3
*/
private function fix_server_vars() {
Gandhi Institute Of Engineering and Technology

Page 76

E-commerce Website
Project Documentation
// NGINX Proxy
if ( ! isset( $_SERVER['REMOTE_ADDR'] ) &&
isset( $_SERVER['HTTP_REMOTE_ADDR'] ) ) {
$_SERVER['REMOTE_ADDR'] =
$_SERVER['HTTP_REMOTE_ADDR'];
}
if ( ! isset( $_SERVER['HTTPS'] ) ) {
if ( ! empty( $_SERVER['HTTP_HTTPS'] ) ) {
$_SERVER['HTTPS'] = $_SERVER['HTTP_HTTPS'];
} elseif ( !
empty( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) &&
$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) {
$_SERVER['HTTPS'] = '1';
}
}
}
/**
* Get the plugin url.
* @return string
*/
public function plugin_url() {
return untrailingslashit( plugins_url( '/', __FILE__ ) );
}
/**
* Get the plugin path.
* @return string
*/
public function plugin_path() {
return untrailingslashit( plugin_dir_path( __FILE__ ) );
}
/**
* Get the template path.
* @return string
*/
public function template_path() {
Gandhi Institute Of Engineering and Technology

Page 77

E-commerce Website
Project Documentation
return apply_filters( 'woocommerce_template_path',
'woocommerce/' );
}
/**
* Get Ajax URL.
* @return string
*/
public function ajax_url() {
return admin_url( 'admin-ajax.php', 'relative' );
}
/**
* Return the WC API URL for a given request
*
* @param string $request
* @param mixed $ssl (default: null)
* @return string
*/
public function api_request_url( $request, $ssl = null ) {
if ( is_null( $ssl ) ) {
$scheme = parse_url( home_url(), PHP_URL_SCHEME );
} elseif ( $ssl ) {
$scheme = 'https';
} else {
$scheme = 'http';
}
if ( strstr( get_option( 'permalink_structure' ), '/index.php/' ) ) {
$api_request_url = trailingslashit( home_url( '/index.php/wcapi/' . $request, $scheme ) );
} elseif ( get_option( 'permalink_structure' ) ) {
$api_request_url = trailingslashit( home_url( '/wc-api/' .
$request, $scheme ) );
} else {
$api_request_url = add_query_arg( 'wc-api', $request,
trailingslashit( home_url( '', $scheme ) ) );
}

Gandhi Institute Of Engineering and Technology

Page 78

E-commerce Website
Project Documentation
return esc_url_raw( $api_request_url );
}
/**
* Load & enqueue active webhooks
*
* @since 2.2
*/
private function load_webhooks() {
if ( false === ( $webhooks =
get_transient( 'woocommerce_webhook_ids' ) ) ) {
$webhooks = get_posts( array(
'fields'
=> 'ids',
'post_type' => 'shop_webhook',
'post_status' => 'publish',
'posts_per_page' => -1
) );
set_transient( 'woocommerce_webhook_ids', $webhooks );
}
foreach ( $webhooks as $webhook_id ) {
$webhook = new WC_Webhook( $webhook_id );
$webhook->enqueue();
}
}
/**
* Get Checkout Class.
* @return WC_Checkout
*/
public function checkout() {
return WC_Checkout::instance();
}
/**
* Get gateways class
* @return WC_Payment_Gateways
*/
public function payment_gateways() {
return WC_Payment_Gateways::instance();
Gandhi Institute Of Engineering and Technology

Page 79

E-commerce Website
Project Documentation
}
/**
* Get shipping class
* @return WC_Shipping
*/
public function shipping() {
return WC_Shipping::instance();
}
/**
* Email Class.
* @return WC_Emails
*/
public function mailer() {
return WC_Emails::instance();
}
}
endif;
/**
* Returns the main instance of WC to prevent the need to use globals.
*
* @since 2.1
* @return WooCommerce
*/
function WC() {
return WooCommerce::instance();
}
// Global for backwards compatibility.
$GLOBALS['woocommerce'] = WC();-

Gandhi Institute Of Engineering and Technology

Page 80

E-commerce Website
Project Documentation

Chapter-5

Testing
This chapter includes the methods that were used for testing, validating, and
evaluating the system. The Conclusion and the Future Work for the software are
also given.
Methodology:With this testing approach, all the specs were ready for a prototype, and a plan was
already built to be shown; the tester started writing his or her code and saw if he or
she could obtain the same results that the specs mentioned. This way, the specs
were tested on each prototype, and continuous testing was applied. This also
helped to minimize the testing that would have to be implemented at the end of the
software lifecycle. In the process, all aspects of the software were tested. Steps to
follow while implementing the methodology are as follows:
1. Start with a base function that you want to implement.
2. Create a document with the detailed requirement definition, an activity
diagram with a description of the flow, database tables to be used, a

Gandhi Institute Of Engineering and Technology

Page 81

E-commerce Website
Project Documentation
component diagram, and a description of each component with the
precondition and tables that would be affected by the component.
3. Give the document to the tester, and work with the tester while he or she
writes the code to check if the steps in the document can be implemented
and if the result of each use case can be achieved.
4. If the tester finds a step difficult to implement or thinks he or she is
missing additional information to implement the functionality, then go to
step 2; otherwise, go to step 3.

5. Ask the tester to log on all the errors and difficulties he or she
encountered while working on the prototype implementation.
6. Once the prototype is done and the results between the developers
prototype and testers prototype match, work on the other requirement,
and expand the prototype to final software.
7. When the testing approach was implemented, the following pros and
cons regarding the testing approach were realized. Pros of using the
methodology
Helps give a better understanding about the requirements.
Better design at the end of the cycle. Reduced testing to be
performed at the end of the cycle
Documents produced would be of higher quality.
Cons of using the methodology The person working on the
document should be experienced.
There are increased time and money involved with testing.
Different viewpoints for the same problem can lead to varying
results.
Gandhi Institute Of Engineering and Technology

Page 82

E-commerce Website
Project Documentation

Interface Tesstingy:This section lists the functional requirements used for creating the test-case table,
the test cases that were used to verify the interface table, and the results for the
test-cases table. Table 1 lists the functional requirements for the interface built for
the online shoppingcart application, along with a short description of each
requirement

Functional Requirement Number


FR01

Functional Requirement Short Description


The online shopping-cart application shall have two types
of authentication: User authentication and Admin

FR02

authentication
The online shopping-cart application shall be accessible to

FR03

all the users to browse all the categories and the items.
The users shall be able to view the items they added to the

FR06

shopping cart.
The Admin shall be able to upload new/revised items as

FR07

well as to add/modify the categories


The Admin shall be able to view all the users registered in

FR08

the system.
The Admin shall be able to view all the information abour

FR09

users who placed an order from the shopping cart.


The users shall not be able to check out with an empty cart.

FR10

The users shall not be able to place an order without


providing valid information for all rows in the order form.

Gandhi Institute Of Engineering and Technology

Page 83

E-commerce Website
Project Documentation
FR11

The users shall not be able to place an order if any of the


columns in the order form are left empty.

Table 1. List of Functional Requirements.

Test Cases:Table 2 shows the functional requirements used to write the test cases along with
the testcase numbers for each test case and a short description of the test cases.
Functional Requirement No Test Case No
FR01
TC01

FR03
FR06

FR07
FR08
FR09
FR10

Test-Case Short Description


To test the Login/Authentication interface for

TC02

the Admin
To test the Login/Authentication interface for

TC03

the users
To test, users can view the items they add in the

TC04

shopping cart.
To test, Admin can upload new/revised

TC05

categories.
To test, Admin can upload new/revised items.

TC06

To test, Admin can view all the users registered

TC07

in the system
To test, Admin can view the information about

TC08

all the users who successfully placed an order


To test that users cannot check out with an

TC09

empty shopping cart


To test that users are not able to submit an order
form if the information in any of the fields is not
valid.

Gandhi Institute Of Engineering and Technology

Page 84

E-commerce Website
Project Documentation
FR11

TC10

To test that users are not able to submit an order


form if the information in any of the fields is

left blank.
Table 2. List of Test case
The following list includes the steps that should be taken by the user, the
conditions that should be met for the successful execution of the test case, and the
end result that should be met for the test cases to pass.
1. TC01: To test the Login/Authentication interface
Input: Username and Password
Output: Valid Destination Page
Valid Range: User Name
Alpanumeric,
Password
Alphanumric
End Messages/Result
i. If (User == Valid User), an order form appears to
ii.

complete the checkout process


If (User != Valid User), an error message is
displayed on the Login interface.

2. TC02: To test, the users can view the items they add to the shopping
cart.

Description of Purpose: The system shows all the saved items


in shopping cart for a particular user. The user can choose to
check out the items or go back to continue shopping.Output:
Valid Destination Page
Input: The user adds an item to the shopping cart from any of
the available categories.
Output: The shopping-cart page pops up, showing the item that
is added by the user.

Gandhi Institute Of Engineering and Technology

Page 85

E-commerce Website
Project Documentation

End Messages/Result
i. If (Selection == Item and document == exists),
the user is able to add that item to the cart, and
the item shows up in the shopping cart,
prompting user to delete the item, to continue
shopping, or to check out the item. If (User !=
Valid User), an error message is displayed on
ii.

the Login interface.


If (Selection = Item and Selection = View Cart),
an empty shopping cart pops up with buttons to
check out or to continue shopping.

3. TC03: To test, the Admin can upload new/revised categories and


items.
Description: The Admin can add or upload more items to a
category or can add a completely new category. The Admin can
also modify the price, information and shipping taxes, etc. for
the existing items and categories. Output: Valid Destination
Page
Input
i. User=Admin
ii.
Selection=Items
iii. Selection=Categories
Output: New or modified items or categories in the shopping
cart.

Gandhi Institute Of Engineering and Technology

Page 86

E-commerce Website
Project Documentation
End Messages/Result
i. If (User type = Admin &Selection =
(Items

||

Category)&&

Item/Category

=existing), then display the modified items


or

categories

in

the

shopping

cartIf

(Selection = Item and Selection = View


Cart), an empty shopping cart pops up with
buttons to check out or to continue
ii.

shopping.
If (User type == Admin &Selection ==
(Items

||

Category)

&

Item/

Category=existing), then display newly


added items or categories in the shopping
cart.
Results:Test Case Number
TC01
TC02
TC03
TC04
TC05
TC06
TC07

Expected Result
Pass
Pass
Pass
Pass
Pass
Pass
Pass

Actual Result
Pass
Pass
Pass
Pass
Pass
Pass
Pass

Table 3. List of Test-Case Results.

Chapter-6

Advantages and Applications


Gandhi Institute Of Engineering and Technology

Page 87

E-commerce Website
Project Documentation

Advantages of E-Commerce
Faster buying/selling procedure, as well as easy to find products.
Buying/selling 24/7.
More products and services: EC provides with more choices;
they can select from many vendors and from more products.
Cheaper products: EC frequently provides consumers with less
expensive products and services by allowing them to shop in
many places and conduct quick comparisons.
Ubiquity: EC provides consumers to shop or perform other
transactions year round, 24 hours a day, from almost any location.
More reach to customers, there is no theoretical geographic
limitations.
No need of physical company set-ups.
Easy to start and manage a business.
Customers can easily select products from different providers
without moving around physically.
Disadvantages of E-Commerce
Unable to examine products personally
Not everyone is connected to the Internet
There is the possibility of credit card number theft
Mechanical failures can cause unpredictable effects on the total
processes.
Some customers like to feel and touch products. Also, customers
are resistant to the change from a real to a virtual store.
People do not yet sufficiently trust paperless,

faceless

transactions.
There is an increase amount of fraud on the Internet.
Gandhi Institute Of Engineering and Technology

Page 88

E-commerce Website
Project Documentation

Applications of E-Commerce
Online Shopping
Electronic Bill Payment
Electronic ticketing
Online Banking

Online Shopping :Online shopping is the process consumers go through to purchase products
or services over the Internet.Online shopping is a type of electronic commerce used
for business-to-business (B2B) and business-to-consumer (B2C) transactions.
Electronic Bill Payment:Electronic bill presentment and payment (EBPP) is a fairly new technique
that allows consumers to view and pay bills electronically. EBPP systems send bills
from service providers to individual consumers via the internet.

Electronic Ticketing:An electronic ticket or e-ticket is used to represent the purchase of a seat on
a passenger airline, usually through a website or by telephone. This form of airline
ticket has rapidly replaced the old multi-layered paper tickets .
Online Banking:-

Gandhi Institute Of Engineering and Technology

Page 89

E-commerce Website
Project Documentation
Online banking (or Internet banking) allows customers to conduct financial
transactions on a secure website operated by their bank.The common features
provided by online-banking fall broadly into several categories:
Transactional
Non-transactional
Top 10 E-commerce websites in India:

Chapter-7

Conclusions and Future work


This chapter includes the Conclusion reached after creating the current version of
the software to meet the system objectives. The comparison is done between the
system that was built and original requirements that were designed at the beginning
of the project. It also describes the Future Work that is intended to be accomplished
with later versions of the software.
Gandhi Institute Of Engineering and Technology

Page 90

E-commerce Website
Project Documentation

Conclusion:The main objective of the application is to help IT students understand the basics
of Java, JavaScript, and HTML. By browsing through the application and looking
at the code for each graphical interpretation, students should be able to easily
understand the implementation. The following results have been achieved after the
completing the system and relate back to the systems objective.
1. Should allow IT students to browse through the code and application:
This is achieved when users, i.e., computer science students, are able to run and
install the application. When they run the application, they can browse through the
implementation of different objects.
2. Should allow users to browse through different product categories: This is
achieved when the user first runs the application and is directed to a home page
that has categories available for all the different item types that can be purchased
with this online shopping-cart application. The user can browse and click on any
category to view the items listed for that particular category.
3. Should allow users to save items to the cart and also to view detailed
information about a particular item:
The users can add any number of items to the shopping cart from any of 67 the
listed categories by simply clicking the cart icon at the right-hand corner of each
item. Users can view a detailed description of the item and price by clicking on the
more icon next to the cart icon

Gandhi Institute Of Engineering and Technology

Page 91

E-commerce Website
Project Documentation
. 4. Should allow users to check out the items: This is achieved when users click
the checkout button in the shopping cart. The checkout button disappears when
there are no items in the shopping cart. This implies that users can only click the
checkout button when there are items in the shopping cart.
5. System users should be able to place the order by filling out the order form:
This is achieved when a user clicks the checkout button and an order form appears
on the same page, showing the detailed order total with shipping charges and sales
tax, which requires the user to complete all the information to successfully place an
order. The user is not able to place an order if any information on the form is
invalid or empty.
6. The user should see a success message after placing an order: This is
achieved when a user successfully places an order by completely filling in all the
rows after which he or she can click the place-order button. The user receives a
message that the order has been successfully placed.

Future Work:The following section discusses the work that will be implemented with future
releases of the software.
1. Detailed categories: Future work could involve adding more categories which
are more detailed and have additional items.

Gandhi Institute Of Engineering and Technology

Page 92

E-commerce Website
Project Documentation

2. Watch/Wish List: Work can add a watch list or wish list so that users can add
an item to a list to watch for item prices to go down or to see when there is a sale
on any of those items.
3. Enhanced User Interface: Work on enhancing the user interface by adding
more user interactive features.
4. Recommended Items: Add a bar that would display the most-recommended
items which would depend on the number of times an item has been purchased by
any users.
5. Payment Options: Add different payment options, such as Visa, MasterCard,
PayPal, etc., where a user can also save the card information for later checkouts.
6. Shipping Options: Add different types of shipping options: regular shipping,
expedited shipping, international shipping, etc.
7. Recent History: Display the users recently browsed items in the recent-history
tab.

Reference:-

Gandhi Institute Of Engineering and Technology

Page 93

You might also like