Giter VIP home page Giter VIP logo

yii2-ecommerce-website's Introduction

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]'
    ];

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]

yii2-ecommerce-website's People

Contributors

thecodeholic avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.