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,386 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  
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

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,386
This week:131Up