e-Commerce Site using PHP/PDO, PHPMailer, ReCaptcha, and PayPal with Source Code

Language

This is an e-Commerce Site Project with Secure Registration and Online Payment. This project was developed using PHP, PDO, MySQL Database, HTML, CSS, and other plugins. This e-Commerce Site Project has an admin panel where you can manage the Categories, Users, Products, and View the Sales. Talking about the Secure Registration, the user registration form has a reCaptcha Checkbox feature. Aside from reCaptcha, the user must register a valid email because the system will mail to the given email a verification link to verify the user's email for security purposes. As I have said about the admin panel, the Admin user must populate first the products and categories list so that the users can explore and create their transactions. For Online Payment, this system is using Paypal for checkout.

Features

  • jQuery Cart Adding and Quantity Adjustment
  • Can shop even without logging into the site but can't checkout
  • Product Search
  • Magnify product image
  • Email verification on signup
  • Google ReCaptcha on signup
  • Forgot password email
  • Paypal express checkout
  • Printable sales via date range
  • Manage Users
  • Manage Product Categories
  • Manage Product List

Plugins

  • AdminLTE
  • TCPDF
  • PHPMailer

How to Run

Requirements

  • Download and Install any local web server such as XAMPP/WAMp.
  • Download the provided source code zip file. (download button is located below)
  • Valid Email for Mailing Purposes.
  • Paypal Account for as a Buyer and Merchant. Create a sandbox account for this to test the online payment feature. Paypal Dashboard for Developers

Installation and Setup

  1. Open your XAMPP/WAMP's Control Panel and start the "Apache" and "MySQL".
  2. Extract the downloaded source code zip file.
  3. If you using XAMPP, copy the extracted folder and paste it into the XAMPP's "htdocs" directory. And for WAMP, paste it into the "www" directory.
  4. Import the included .sql file located in db folder which is the database of the system. If you have no idea how to import, please refer to my tutorial on How import .sql file to restore MySQL database.
  5. After a successful import, open the extracted folder and open conn.php located in the includes folder. Edit the database name in the connection depending on the name of the database you created in importing the included .sql file.
  6. Open the "register.php" and "reset.php" with your preferred text editor and find the variable just like the image below to configure your email for sending mails.
    mail_config
  7. Open a web browser and browse the Project. i.e. http://localhost/ecommerce

Users

There are two types of users to the system which are the admin and the buyer.

For the admin account, you can use this credential:
Email: [email protected]
Password: password

For the sample buyer:
Email: [email protected]
Password: nurhodelta
Or you can also create a new account.

Optional Task

  • Create ABOUT US and CONTACT US page
  • Social Media Links
  • Subscribe email

That's it! I hope this project will help you with what you are looking for and for your future PHP projects. If you found any bugs or errors in the system or if you have any comments or suggestions, feel free to comment below or message me.

Happy Coding :)

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Comments

Submitted byDollarsoft (not verified)on Mon, 05/14/2018 - 04:15

tnx bro pls help me ur code is nice but i get mailer error message could not been sent mailer error

Be sure to edit the email credentials. If error persist, send me a screenshot of the error and code to my fb account.
Submitted byShalomzy (not verified)on Fri, 06/01/2018 - 18:13

There is error in adding products, date_view error
Submitted byBoobathi P S (not verified)on Fri, 06/22/2018 - 20:08

Hi, Nice work really helpful for beginner to develop e-commerce site. While signup a account then click a submit button after facing following issue in register.php This page isn’t working domain.com is currently unable to handle this request. HTTP ERROR 500 pls help how to fix it
Submitted byboobathi6on Fri, 06/22/2018 - 20:11

Hi, Nice work really helpful for beginner to develop e-commerce site. While signup a account then click a submit button after facing following issue in register.php This page isn’t working domain.com is currently unable to handle this request. HTTP ERROR 500 pls help how to fix it
Submitted byAlma Balma (not verified)on Fri, 01/18/2019 - 17:03

default currency is $....how to change USD currency to MYR...where should i change the code?
Submitted byChrisHuman (not verified)on Thu, 04/15/2021 - 01:44

In reply to by Alma Balma (not verified)

hi. could you fix th currency . ? pls help me aswell
Submitted byleCourier (not verified)on Sat, 06/05/2021 - 08:43

In reply to by ChrisHuman (not verified)

vous avez pu régler le problème de création de compte?
Submitted byLGLoges (not verified)on Sun, 06/27/2021 - 04:55

In reply to by Alma Balma (not verified)

Open notepad, find in files by opening project folder, type USD and find all. You'll be able to see the files that contains the currency.

Hi, Nice work really helpful for beginner to develop e-commerce site. While signup a account then click a submit button after facing following issue in verify.php Fatal error: Call to undefined function password_verify() in D:\xampp\htdocs\Shopping\ecommerce\ecommerce\verify.php on line 17 pls help how to fix it Thankx
Submitted byerreur de crea… (not verified)on Sat, 06/05/2021 - 08:41

Salut, excellent travail vraiment utile pour les débutants pour développer un site de commerce électronique. Lors de l'inscription d'un compte, j'ai l'erreur suivant : Erreur fatale: Erreur non interceptée : Constante non définie « PHPMailer\PHPMailer\FILTER_FLAG_HOST_REQUIRED » dans C:\xampp\htdocs\Site de commerce électronique PHP\ecommerce\vendor\phpmailer\phpmailer\src\PHPMailer.php:3599 Trace de pile : #0 C:\xampp\htdocs\Site de commerce électronique PHP\ecommerce\vendor\phpmailer\phpmailer\src\PHPMailer.php(3565): PHPMailer\PHPMailer\PHPMailer\PHPMailer::isValidHost('localhost') #1 C:\xampp\htdocs\Ecommerce Site PHP\ecommerce\vendor\phpmailer\phpmailer\src\PHPMailer.php(2304): PHPMailer\PHPMailer \PHPMailer->serverHostname('localhost.local...') #2 C:\xampp\htdocs\Ecommerce Site PHP\ecommerce\vendor\phpmailer\src\PHPMailer.php(1421): PHPMailer\PHPMailer\PHPMailer->createHeader('localhost.local...') #3 C:\xampp\htdocs\Ecommerce Site PHP\ecommerce\vendor\phpmailer\phpmailer\src\PHPMailer.php(1316): PHPMailer\PHPMailer\PHPMailer>preSend() #4 C:\xampp\htdocs\Ecommerce Site PHP\ecommerce\register.php(102) : PHPMailer\PHPMailer\PHPMailer->send() #5 {main} jeté dans C:\xampp\htdocs\Ecommerce Site PHP\ecommerce\vendor\phpmailer\phpmailer\src\PHPMailer.php en ligne 3599. besoin d'aide svp
Submitted bythteh (not verified)on Sat, 01/29/2022 - 04:55

does not work error on registration please give me the file again without verification and send it by email just for the register not for the password reset because it is essential for this email [email protected] please Please because I can't adjust your file I've tried everything I don't understand how you coded it Only you can correct it I have an error SQLSTATE[HY000]: General error: 1364 Field 'type' doesn't have a default value for debugging otherwise I get the error you defined either $_SESSION['error'] = 'Fill up signup form first'; it's a maildev problem that doesn't work with all network operators
Submitted bythteh (not verified)on Sat, 01/29/2022 - 04:55

does not work error on registration please give me the file again without verification and send it by email just for the register not for the password reset because it is essential for this email [email protected] please Please because I can't adjust your file I've tried everything I don't understand how you coded it Only you can correct it I have an error SQLSTATE[HY000]: General error: 1364 Field 'type' doesn't have a default value for debugging otherwise I get the error you defined either $_SESSION['error'] = 'Fill up signup form first'; it's a maildev problem that doesn't work with all network operators
Submitted byShannon Smith (not verified)on Sat, 07/23/2022 - 20:24

is there a way to add shipping methods on checkout and update the transaction amount to reflect.
Submitted bybncastillo (not verified)on Fri, 08/19/2022 - 14:33

Idol, ganda nito.. di ngalang working ung capcha pag nag sign up, nwawala sya hahaha. tapos yung checkout. nawawala yung pop up after 0.5 sec
Submitted bysobarzolicandeo (not verified)on Sun, 06/04/2023 - 02:37

Hello! congratulations on your excellent work! and thanks for sharing. One question, I can't see the "Add a comment..." section on the view product page, do I need any special configuration? maybe a specific PHP version?Thanks since now.
Submitted byAnonymous (not verified)on Fri, 02/09/2024 - 18:37

I am getting the following response after pressing the signup button in the new member registration form. Your prompt response is appreciated' Fatal error: Uncaught Error: Undefined constant "PHPMailer\PHPMailer\FILTER_FLAG_HOST_REQUIRED" in C:\xampp\htdocs\ecommerce\vendor\phpmailer\phpmailer\src\PHPMailer.php:3599 Stack trace: #0 C:\xampp\htdocs\ecommerce\vendor\phpmailer\phpmailer\src\PHPMailer.php(3565): PHPMailer\PHPMailer\PHPMailer::isValidHost('localhost') #1 C:\xampp\htdocs\ecommerce\vendor\phpmailer\phpmailer\src\PHPMailer.php(2304): PHPMailer\PHPMailer\PHPMailer->serverHostname() #2 C:\xampp\htdocs\ecommerce\vendor\phpmailer\phpmailer\src\PHPMailer.php(1421): PHPMailer\PHPMailer\PHPMailer->createHeader() #3 C:\xampp\htdocs\ecommerce\vendor\phpmailer\phpmailer\src\PHPMailer.php(1316): PHPMailer\PHPMailer\PHPMailer->preSend() #4 C:\xampp\htdocs\ecommerce\register.php(105): PHPMailer\PHPMailer\PHPMailer->send() #5 {main} thrown in C:\xampp\htdocs\ecommerce\vendor\phpmailer\phpmailer\src\PHPMailer.php on line 3599

Add new comment