PHP Classes

Minimalist PHP Sales Site: Implement a sales site from configuration files

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 128 All time: 9,385 This week: 131Up
Version License PHP version Categories
minimalist-sales-sit 1.0.0GNU General Publi...8E-Commerce, Content management, PHP 8
Description 

Author

This package can implement a sales site from configuration files.

It can read configuration files that define several aspects of a sales site to generate sales pages to present products from sale.

Currently, the configuration files provide the list of products to sell, the base URL of the sales site, the site name, and the site contact email, etc..

Innovation Award
PHP Programming Innovation award nominee
September 2022
Number 9
Many sites implement an e-commerce section where the site owners can sell a set of products to their customers.

Implementing a complete e-commerce system can be a very complex task that requires to setup a database on which the site lists the available products.

This package provides a more straightforward solution: site owners can implement a sales system using simple configuration files.

Manuel Lemos
Picture of Pierre-Henry Soria
  Performance   Level  
Name: Pierre-Henry Soria <contact>
Classes: 49 packages by
Country: United Kingdom
Age: 31
All time rank: 37316 in United Kingdom
Week rank: 2 Up1 in United Kingdom Up
Innovation award
Innovation award
Nominee: 18x

Winner: 3x

Example

<?php
/**
 * (c) Pierre-Henry Soria <hi@ph7.me>
 * MIT License - https://opensource.org/licenses/MIT
 */

require __DIR__ . '/vendor/autoload.php';

use
Dotenv\Dotenv;
use
Whoops\Handler\PrettyPageHandler;
use
Whoops\Run as WhoopsRun;

$whoops = new WhoopsRun;
$whoops->pushHandler(new PrettyPageHandler);
$whoops->register();

$requiredEnvFields = [
   
'SITE_URL',
   
'SITE_NAME',
   
'APP_EMAIL',
];

$env = Dotenv::createImmutable(__DIR__);
$env->load();
$env->required($requiredEnvFields)->notEmpty();

define('SITE_URL', $_ENV['SITE_URL']);
define('SITE_NAME', $_ENV['SITE_NAME']);
define('APP_EMAIL', $_ENV['APP_EMAIL']);

require
__DIR__ . '/app/app.php';


Details

Minimalist sales micro-site

A minimalist sales micro-site

The easiest way to build a micro sales site ?

PHP Minimalist Sales Micro Ecommerce Site

:hammer: Requirements

:thought_balloon: Setup

  1. From a command line opened in the project, run `composer install` to install the project dependencies.
  2. Rename `env.sample` to `.env` and update the details in there.
  3. Run the PHP built-in server `php -S 127.0.0.1:8080` for testing purpose.
  4. Update the products details/list of products in `app/products.php`
  5. Update the product page details in `app/pages/product.page.php`

FYI: The document root file is index.php located in the root directory of this project.

:tada: 3rd party libraries

This project uses the following awesome libs: * Bootstrap v5 * Mustache.PHP * Just HTTP Status Codes * PHP dotenv

:cook: Author

I'm Pierre-Henry Soria. A passionate, perseverant zen &amp; dedicated software engineer ? Coding the best applications with the best practices is my way of life! ?

You can keep in touch with me at: hi@ph7.me ?

[![pH-7][github-image]](https://github.com/pH-7 "Follow Me on GitHub") [![@phenrysay][twitter-image]](https://twitter.com/phenrysay "Follow Me on Twitter")

Pierre-Henry Soria

:tv: Video

[![Watch the video][video-thumbnail]](https://www.youtube.com/watch?v=4OzD_agPFLA)

? Click here to watch on YouTube

:page_with_curl: License

Minimalist sales micro-site is distributed under MIT license ? Enjoy! ??

<!-- GitHub's Markdown reference links --> [github-image]: https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white [twitter-image]: https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white [video-thumbnail]: https://i1.ytimg.com/vi/4OzD_agPFLA/sddefault.jpg

<!-- Was generated by README Generator CLI on 2021-12-25 https://github.com/pH-7/github-readme-generator-cli -->


  Files folder image Files (31)  
File Role Description
Files folder image.github (1 file, 1 directory)
Files folder imageapp (3 files, 2 directories)
Files folder imageassets (2 directories)
Files folder imagetests (1 directory)
Files folder imageviews (5 directories)
Accessible without login Plain text file .env.sample Data Auxiliary data
Accessible without login Plain text file .htaccess Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Image file php-minimalist-sales-micro-site.png Data Auxiliary data
Accessible without login Plain text file phpunit.xml.dist Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (31)  /  .github  
File Role Description
Files folder imageworkflows (1 file)
  Accessible without login Plain text file FUNDING.yml Data Auxiliary data

  Files folder image Files (31)  /  .github  /  workflows  
File Role Description
  Accessible without login Plain text file test.yml Data Auxiliary data

  Files folder image Files (31)  /  app  
File Role Description
Files folder imageKernel (2 directories)
Files folder imagepages (4 files)
  Accessible without login Plain text file app.php Example Example script
  Accessible without login Plain text file products.php Conf. Configuration script
  Accessible without login Plain text file routes.php Aux. Auxiliary script

  Files folder image Files (31)  /  app  /  Kernel  
File Role Description
Files folder imageHelper (1 file)
Files folder imageHttp (3 files)

  Files folder image Files (31)  /  app  /  Kernel  /  Helper  
File Role Description
  Plain text file Template.php Class Class source

  Files folder image Files (31)  /  app  /  Kernel  /  Http  
File Role Description
  Plain text file Http.php Class Class source
  Plain text file NotFoundException.php Class Class source
  Plain text file Router.php Class Class source

  Files folder image Files (31)  /  app  /  pages  
File Role Description
  Accessible without login Plain text file 404.page.php Aux. Auxiliary script
  Accessible without login Plain text file contact.page.php Aux. Auxiliary script
  Accessible without login Plain text file homepage.page.php Aux. Auxiliary script
  Accessible without login Plain text file product.page.php Aux. Auxiliary script

  Files folder image Files (31)  /  assets  
File Role Description
Files folder imageimages (1 file)
Files folder imagethemes (1 directory)

  Files folder image Files (31)  /  assets  /  images  
File Role Description
  Accessible without login Image file blue-mug.png Data Auxiliary data

  Files folder image Files (31)  /  assets  /  themes  
File Role Description
Files folder imageclassic (1 directory)

  Files folder image Files (31)  /  assets  /  themes  /  classic  
File Role Description
Files folder imagecss (1 file)

  Files folder image Files (31)  /  assets  /  themes  /  classic  /  css  
File Role Description
  Accessible without login Plain text file common.css Data Auxiliary data

  Files folder image Files (31)  /  tests  
File Role Description
Files folder imageunit (1 file, 1 directory)

  Files folder image Files (31)  /  tests  /  unit  
File Role Description
Files folder imageKernel (1 directory)
  Accessible without login Plain text file bootstrap.php Aux. Auxiliary script

  Files folder image Files (31)  /  tests  /  unit  /  Kernel  
File Role Description
Files folder imageHelper (1 file)

  Files folder image Files (31)  /  tests  /  unit  /  Kernel  /  Helper  
File Role Description
  Plain text file TemplateTest.php Class Class source

  Files folder image Files (31)  /  views  
File Role Description
Files folder image404 (1 file)
Files folder imagecontact (1 file)
Files folder imagehomepage (1 file)
Files folder imageproduct (1 file)
Files folder image_shared (2 files)

  Files folder image Files (31)  /  views  /  404  
File Role Description
  Accessible without login HTML file index.mustache.html Doc. Documentation

  Files folder image Files (31)  /  views  /  contact  
File Role Description
  Accessible without login HTML file index.mustache.html Doc. Documentation

  Files folder image Files (31)  /  views  /  homepage  
File Role Description
  Accessible without login HTML file index.mustache.html Doc. Documentation

  Files folder image Files (31)  /  views  /  product  
File Role Description
  Accessible without login HTML file index.mustache.html Doc. Documentation

  Files folder image Files (31)  /  views  /  _shared  
File Role Description
  Accessible without login HTML file footer.mustache.html Doc. Documentation
  Accessible without login HTML file header.mustache.html Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:128
This week:0
All time:9,385
This week:131Up