• Stars
    star
    174
  • Rank 212,581 (Top 5 %)
  • Language
    PHP
  • License
    BSD 3-Clause "New...
  • Created over 3 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

E-commerce website with admin panel build on Yii2 framework

Yii2 E-commerce application


Yii2 E-commerce system

Features

  • Bootstrap 4
  • Custom Admin template in backend
  • Product Management
  • Implement cart page
  • Checkout for guests
  • Checkout for authorized users
  • Sending email when order is made
  • Payments with PayPal - PayPal buttons
  • Order validation
  • Display order in backend
  • Dashboard with basic statistics
    • Total earnings
    • Total products sold
    • Total number of orders made
    • Total users
    • Earnings by day
    • Revenue by country

Demo

I am working on demo. It will be available soon.

Installation

  1. Clone the repository
  2. Go to the project root directory and run composer install
  3. Run php init from the project root directory and choose your desired environment
  4. Create the database
  5. Open common/config/main-local.php
    • Configure database credentials by changing the following lines
      'dsn' => 'mysql:host=localhost;dbname=your_website_db',
      'username' => 'root',
      'password' => '',
      'charset' => 'utf8mb4',
    • If you want to use real SMTP credentials to send emails, configure the mail provider by replacing mailer component with the following code
      'mailer' => [
          'class' => 'yii\swiftmailer\Mailer',
          'transport' => [
              'class' => 'Swift_SmtpTransport',
              'host' => 'SMTP_HOST',
              'username' => 'SMTP_USERNAME',
              'password' => 'SMTP_PASSWORD',
              'port' => 'SMTP_PORT',
              'encryption' => 'tls',
          ],
      ],
  6. Run php yii migrate to apply all system migrations.
  7. Create virtual hosts for frontend/web and backend/web directories. Virtual Host templates
    <VirtualHost *:80>
        ServerName yii2-ecommerce.localhost
        DocumentRoot "/path/to/ecommerce-website/frontend/web/"
        
        <Directory "/path/to/ecommerce-website/frontend/web/">
            # use mod_rewrite for pretty URL support
            RewriteEngine on
            # If a directory or a file exists, use the request directly
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            # Otherwise forward the request to index.php
            RewriteRule . index.php
    
            # use index.php as index file
            DirectoryIndex index.php
    
            # ...other settings...
            # Apache 2.4
            Require all granted
            
            ## Apache 2.2
            # Order allow,deny
            # Allow from all
        </Directory>
    </VirtualHost>
    
    
    <VirtualHost *:80>
        ServerName backend.yii2-ecommerce.localhost
        DocumentRoot "/path/to/ecommerce-website/backend/web/"
        
        <Directory "/path/to/ecommerce-website/backend/web/">
            # use mod_rewrite for pretty URL support
            RewriteEngine on
            # If a directory or a file exists, use the request directly
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            # Otherwise forward the request to index.php
            RewriteRule . index.php
    
            # use index.php as index file
            DirectoryIndex index.php
    
            # ...other settings...
            # Apache 2.4
            Require all granted
            
            ## Apache 2.2
            # Order allow,deny
            # Allow from all
        </Directory>
    </VirtualHost>
    
  8. Open common/config/params-local.php and replace the content with the following code Make sure you create PayPal application and take ClientId and Secret.
    <?php
    return [
        'frontendUrl' => 'YOUR_FRONTEND_HOST', // Ex: http://yii2-ecommerce.localhost
        'paypalClientId' => '',
        'paypalSecret' => '',
        'vendorEmail' => '[email protected]'
    ];

Building assets

The project uses webpack to build the assets.
The project styles and bootstrap styles are built together. Source files are located in frontend/scss and backend/js.

Bootstrap customization

If you want to customize bootstrap variables, open frontend/scss/bootstrap-variables.scss and override any bootstrap variable.
Check the following link for more information about bootstrap customization

For Development

Runnpm run dev to build the files and start watching them. This will generate unminified versions of the files and will generate source maps as well

For production

Run npm run prod to build the files for production. This will generate minified files.

Create admin user

Run the following console command to create admin user. PASSWORD is optional, you can skip it and system will generate a random password

php yii app/create-admin-user USERNAME [PASSWORD]

More Repositories

1

php-developer-roadmap

This is PHP Developer Roadmap
3,285
star
2

laravel-vue-ecommerce

E-commerce project with Laravel and Vue.js
PHP
483
star
3

php-mvc-framework

PHP MVC Framework
PHP
442
star
4

laravel-vue-survey

This is a full stack application of Vue 3 with Tailwindcss 3 and Laravel 8
PHP
312
star
5

php-crash-course-2020

PHP
232
star
6

lobibox

Responsive jQuery notification plugin
JavaScript
199
star
7

lobipanel

jQuery plugin for bootstrap panels. It extends panels with several common and useful functions.
JavaScript
168
star
8

deno-websocket-chat

Realtime Chat App with Deno and WebSockets
JavaScript
127
star
9

Yii2-Youtube-Clone

Youtube clone made with Yii2 framework
PHP
124
star
10

laravel-react-starter

PHP
102
star
11

tc-php-mvc-core

PHP
95
star
12

laravel-file-manager

PHP
91
star
13

laravel-10-blog

Laravel 10 blog starter kit
PHP
89
star
14

PHPCourse2020

Materials for PHP Course 2020
PHP
79
star
15

yii2-blog-api

PHP
74
star
16

lobilist

LobiList is TODO list jquery plugin
JavaScript
67
star
17

laravel-react-survey

PHP
64
star
18

tailwindcss-ecommerce

E-commerce website template files built with tailwindcss
HTML
64
star
19

laravel-image-manipulation-rest-api

This is an image manipulation REST API written in PHP Laravel Framework
PHP
57
star
20

livewire-projects

Beginner friendly livewire projects
PHP
55
star
21

laravel9-tailwind-portfolio

JavaScript
53
star
22

lobiadmin

Responsive bootstrap admin panel
JavaScript
51
star
23

PHP-OOP-Projects

This repository contains OOP projects with PHP
PHP
51
star
24

vue-meals-app

Vue
50
star
25

PHPSimpleCRUD-FS

Simple PHP CRUD application with data saved in JSON file
PHP
46
star
26

laravel-social-media-website

Social Media website starter project built with Laravel and inertiajs with Vue3
PHP
44
star
27

alpinejs-course

Source code files for Alpine.js YouTube Course
HTML
41
star
28

vue.js-yii2-notes

Notes application using VueJs on frontend side and Yii2 Rest API on backend
PHP
39
star
29

freecodecamp-deno-course

Freecodecamp Deno Course source files
TypeScript
32
star
30

deno-login-register

Registration & Login with Deno
TypeScript
27
star
31

deno-mongodb-rest-api

REST API with Deno and oak reading and writing data from MongoDB
TypeScript
27
star
32

php-file-watcher

Watch file or folder and execute code when something is changes inside
PHP
22
star
33

VanillaJsNotes

Sticky notes app using vanilla javascript
JavaScript
21
star
34

deno-survey

Survey Application made with Deno
TypeScript
21
star
35

php8.0-changes

PHP
20
star
36

vanilla-js-projects

Practical projects around vanillajs
JavaScript
20
star
37

laravel-ecommerce-website

E-commerce website using Laravel, Tailwindcss and Alpine.js
JavaScript
20
star
38

stripe-checkout-laravel

Stripe online payments checkout process full flow implementation in Laravel
PHP
18
star
39

deno-jwt-auth-example

Example repository which show how you can use JWT authentication in Deno Oak framework
TypeScript
17
star
40

webpack-starter-kit

Webpack 4 starter kit project. Features: Bootstrap 4, ES6, SASS, Image optimization, HMR
JavaScript
16
star
41

php8.1-changes

PHP
15
star
42

JsPicturePuzzle

Javascript Picture Puzzle game
JavaScript
14
star
43

Yii2CrashCourse

PHP
14
star
44

yii2-best-practices

This repository contains best practices and recommendations about Yii2 framework
13
star
45

yii2-course

PHP
10
star
46

PHPCartOOP

PHP
9
star
47

chatgpt-bash

Shell
8
star
48

VueSocketIoChat

JavaScript
7
star
49

yii2-basic-bootstrap4

Yii2 Basic application with Bootstrap 4 integration
PHP
7
star
50

laravel11-crash-course

The source code for YouTube Tutorial, Laravel 11 Crash Course
PHP
7
star
51

laravel-example

PHP
6
star
52

vuejs-survey

Vue
6
star
53

deno-serve-static-files

Sample package which shows how you can serve static files in Deno.
TypeScript
6
star
54

react-vue-comparison

This repo contains the source code for the exact same application built in react an vue.js
JavaScript
6
star
55

yii2-admin-template

JavaScript
5
star
56

lobiadmin-vuejs

Bootstrap4 VueJs Admin Template
CSS
5
star
57

yii2-grapesjs

Yii2 GrapesJs AssetBundle, Actions and module
JavaScript
4
star
58

jasny-bootstrap-angular

JavaScript
4
star
59

BulkImageResize

Resize all images inside specific folder
PHP
3
star
60

PHP_namespaces

PHP
3
star
61

lobiadmin-bootstrap3-vuejs

Bootstrap 3 VueJs admin template
CSS
3
star
62

Angular-Lobiadmin

Angular 1.x admin panel - based on Lobiadmin
CSS
3
star
63

reddit-clone-deno

Reddit clone application using Vue.js and Deno
TypeScript
3
star
64

vuejs-projects

In this repository you will find vuejs project examples
Vue
3
star
65

javascript-course

Source code for Javascript course
3
star
66

SimplePHPFramework

PHP
2
star
67

Lobiadmin-nodejs

Admin template on nodejs starter project
JavaScript
2
star
68

vue-gif-search-app

Vue
2
star
69

node-rest-invoicing-app

JavaScript
2
star
70

lobilist2

Lobilist - jQuery todo plugin
JavaScript
1
star
71

JSHTMLTableCellEditing

HTML Table cell editing plugin
JavaScript
1
star
72

lobilist-angularjs

JavaScript
1
star
73

lobiadmin-bootstrap3

Bootstrap 3 admin template.
CSS
1
star
74

yii2-grapesjs-demo

PHP
1
star
75

yii2-album

Create, update, delete albums for logged in users. Upload, edit, delete Images inside your albums. Add captions to your albums and images
1
star
76

Angular4-Lobiadmin

CSS
1
star
77

GitCrashCourse

HTML
1
star
78

lobilist-angular

Lobilist angular
JavaScript
1
star
79

lobipanel-angularjs

JavaScript
1
star
80

reddit-clone-vue

Vue
1
star
81

laravel11-react-spa

Laravel 11 + React SPA with Inertia for managing projects and Tasks.
JavaScript
1
star