Aimeos is THE professional, full-featured and high performance e-commerce package for Laravel

Overview
Aimeos logo

Aimeos Slim package

Total Downloads Build Status Coverage Status Scrutinizer Code Quality

Star us on GitHub — it helps!

Aimeos is THE professional, full-featured and high performance e-commerce package for Laravel! You can install it in your existing SlimPHP application within 5 minutes and can adapt, extend, overwrite and customize anything to your needs.

Aimeos SlimPHP demo

Table of content

Installation or update

This document is for the latest Aimeos SlimPHP 2019.10 release and later.

  • Beta release: 2020.01
  • LTS release: 2019.10

This tutorial assumes a directory layout as used in the Slim skeleton application created by:

composer create-project slim/slim-skeleton:~3.1 [my-app-name]

The Aimeos Slim e-commerce package is a composer based library that can be installed easiest by using Composer. Add these lines to your composer.json of your Slim project:

    "prefer-stable": true,
    "minimum-stability": "dev",
    "require": {
        "aimeos/aimeos-slim": "~2019.10",
        ...
    },

Afterwards, install the Aimeos shop package using

composer update

The next step is to copy the required configuration and route files to your src/ directory so you have your own copy you can modify according to your needs. When you upgrade from a previous version, you should have a backup of these files. You can then reapply the changes you've made in the past to the updated files.

cp vendor/aimeos/aimeos-slim/src/aimeos-settings.php src/
cp vendor/aimeos/aimeos-slim/src/aimeos-routes.php src/

To configure your database, you have to adapt the configuration in src/aimeos-settings.php file and modify the settings in the resource section:

0, 'limit' => 3, 'defaultTableOptions' => [ 'charset' => 'utf8mb4', 'collate' => 'utf8mb4_bin', ], ], ],">
'resource' => [
    'db' => [
        'adapter' => 'mysql',
        'host' => 'localhost',
        'port' => '',
        'socket' => '',
        'database' => 'slim',
        'username' => 'root',
        'password' => '',
        'stmt' => ["SET SESSION sort_buffer_size=2097144; SET NAMES 'utf8mb4'; SET SESSION sql_mode='ANSI'"],
        'opt-persistent' => 0,
        'limit' => 3,
        'defaultTableOptions' => [
            'charset' => 'utf8mb4',
            'collate' => 'utf8mb4_bin',
        ],
    ],
],

If you don't have at least MySQL 5.7 installed, you will probably get an error like

Specified key was too long; max key length is 767 bytes

To circumvent this problem, change the charset/collate setting in your src/aimeos-settings.php to these values before installing Aimeos:

'resource' => [
    'db' => [
        // ...
        'defaultTableOptions' => [
            'charset' => 'utf8',
            'collation' => 'utf8_bin'
        ],
    ],
],

If you want to use a database server other than MySQL, please have a look into the article about supported database servers and their specific configuration.

Setting up or upgrading existing tables in the database is done via:

php vendor/aimeos/aimeos-core/setup.php --config=src/aimeos-settings.php --option=setup/default/demo:1

In a production environment or if you don't want that the demo data is added, leave out the --option=setup/default/demo:1 option.

You must also copy the Aimeos templates to the templates/ directory of your Slim application. Thus, you can modify them according to your needs and they won't be overwritten by the next composer update:

cp -r vendor/aimeos/aimeos-slim/templates/* templates/

The last step is to publish the Aimeos theme files to the public/ directory, so they are available via HTTP:

mkdir -p public/aimeos/themes/
cp -r vendor/aimeos/aimeos-slim/resources/mimeicons/ public/aimeos/
cp -r ext/ai-client-html/client/html/themes/* public/aimeos/themes/
cp -r ext/ai-admin-jqadm/admin/jqadm/themes/* public/aimeos/themes/

Setup

Aimeos requires some objects to be available (like the Aimeos context) and the routes for generating the URLs. Both are added automatically if you add the lines starting with $aimeos right after the $app = new \Slim\App($settings); statement in your public/index.php file:

$app = new \Slim\App($settings);

$aimeos = new \Aimeos\Slim\Bootstrap( $app, require '../src/aimeos-settings.php' );
$aimeos->setup( '../ext' )->routes( '../src/aimeos-routes.php' );

// Set up dependencies

The Aimeos Slim package uses the Twig template engine to render the templates. Therefore, you have to setup the view object with a configured Twig instance. Copy the lines below at the end of your src/dependencies.php file:

// Twig view + Aimeos templates
$container['view'] = function ($c) {
	$conf = ['cache' => '../cache'];
	$view = new \Slim\Views\Twig(__DIR__ . '/../templates', $conf);
	$view->addExtension(new \Slim\Views\TwigExtension($c->get('router'), $c->get('request')->getUri()));
	return $view;
};

Note: You can use the Slim PHP template engine as well if you reimplement the existing templates in PHP, but Twig has one major advantage: Templates can inherit from a common base template, so you don't have to copy the whole HTML page into each template.

Caution: The Slim skeleton application contain a route for /[{name}] in src/routes.php which you have to remove first. It's so generic that it shadows routes from Aimeos!

Then, you should be able to call the catalog list page in your browser. For a quick start, you can use the integrated web server that is available since PHP 5.4. Simply execute this command in the base directory of your application:

php -S 127.0.0.1:8000 -t public

Point your browser to the list page of the shop using:

Since 2019.04: http://127.0.0.1:8000/shop Until 2019.01: http://127.0.0.1:8000/list

Admin

The Aimeos package for the Slim PHP framework also contains an administration interface for managing products and other content. If the internal PHP web server (php -S 127.0.0.1:8000 -t public) is still running, you can find it at:

http://127.0.0.1:8000/admin

Caution: It's important to protect the administration interface with a password or some other kind of authentication!

The easiest way is to add HTTP basic authentication (the browser is asking for user name and password) to all /admin URLs. In Slim, there's a middleware which you can add to your application. To install it, execute

composer require tuupola/slim-basic-auth

on the command line in your application directory. Afterwards, adapt your public/index.php file and add these lines before $app->run():

"Aimeos administration", "path" => "/admin", "users" => [ "admin" => "secret", ], ]));">
$app->add(new \Tuupola\Middleware\HttpBasicAuthentication([
	"realm" => "Aimeos administration",
	"path" => "/admin",
	"users" => [
		"admin" => "secret",
	],
]));

Note: The "users" array can contain a list of user name / password combinations and you need to use a really secret password!

Hints

To simplify development, you should configure to use no content cache. You can do this in the src/aimeos-settings.php file of your Slim application by adding these lines at the bottom:

    'madmin' => array(
        'cache' => array(
            'manager' => array(
                'name' => 'None',
            ),
        ),
    ),

If caching is enabled, you have to execute the following command to clear the cache if you change e.g. configuration settings:

php vendor/aimeos/aimeos-slim/cache.php --config=src/aimeos-settings.php

License

The Aimeos Slim package is licensed under the terms of the LGPLv3 license and is available for free.

Links

Comments
  • changed 'host' to 'hostname' for the db array

    changed 'host' to 'hostname' for the db array

    I don't know if this is php-bound or database server bound. I'm on Centos 7 using php7 and mariadb10.1

    it only worked after changing 'host' to 'hostname'

    opened by nicexe 4
  • Static route

    Static route "/admin" error

    After composer update and all setup steps try inter site but get Slim Application Error

    Slim Application Error
    
    The application could not run because of the following error:
    Details
    Type: FastRoute\BadRouteException
    Message: Static route "/admin" is shadowed by previously defined variable route "/([^/]+)" for method "GET"
    File: /var/www/test.local/slimfm/vendor/nikic/fast-route/src/DataGenerator/RegexBasedAbstract.php
    Line: 64
    Trace
    
    #0 /var/www/test.local/slimfm/vendor/nikic/fast-route/src/DataGenerator/RegexBasedAbstract.php(18): FastRoute\DataGenerator\RegexBasedAbstract->addStaticRoute('GET', Array, 'route1')
    #1 /var/www/test.local/slimfm/vendor/nikic/fast-route/src/RouteCollector.php(33): FastRoute\DataGenerator\RegexBasedAbstract->addRoute('GET', Array, 'route1')
    #2 /var/www/test.local/slimfm/vendor/slim/slim/Slim/Router.php(159): FastRoute\RouteCollector->addRoute(Array, '/admin', 'route1')
    #3 /var/www/test.local/slimfm/vendor/nikic/fast-route/src/functions.php(24): Slim\Router->Slim\{closure}(Object(FastRoute\RouteCollector))
    #4 /var/www/test.local/slimfm/vendor/slim/slim/Slim/Router.php(162): FastRoute\simpleDispatcher(Object(Closure), Array)
    #5 /var/www/test.local/slimfm/vendor/slim/slim/Slim/Router.php(146): Slim\Router->createDispatcher()
    #6 /var/www/test.local/slimfm/vendor/slim/slim/Slim/App.php(511): Slim\Router->dispatch(Object(Slim\Http\Request))
    #7 /var/www/test.local/slimfm/vendor/slim/slim/Slim/App.php(435): Slim\App->dispatchRouterAndPrepareRoute(Object(Slim\Http\Request), Object(Slim\Router))
    #8 /var/www/test.local/slimfm/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(116): Slim\App->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
    #9 /var/www/test.local/slimfm/vendor/slim/slim/Slim/App.php(337): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
    #10 /var/www/test.local/slimfm/vendor/slim/slim/Slim/App.php(298): Slim\App->process(Object(Slim\Http\Request), Object(Slim\Http\Response))
    #11 /var/www/test.local/slimfm/public/index.php(32): Slim\App->run()
    #12 {main}
    
    opened by 1f7 2
  • fill db bug

    fill db bug

    php vendor/aimeos/aimeos-core/setup.php --config=src/aimeos-settings.php --option=setup/default/demo:1

    Caught PHP error while processing setup:

    " failed: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"mshop_locale_site" (
            -- unique site id
            "id" INTEGER NOT NULL AUTO_INCREMENT,
    ' at line 1
    
    mysql -V
    mysql  Ver 14.14 Distrib 5.5.49, for debian-linux-gnu (x86_64) using readline 6.3
    
    opened by 1f7 2
  • aimeos/aimeos-core/admin

    aimeos/aimeos-core/admin

    from install: cp -r vendor/aimeos/aimeos-core/client/html/themes/* public/aimeos/themes/ cp -r vendor/aimeos/aimeos-core/admin/jqadm/themes/* public/aimeos/themes/ cp -r vendor/aimeos/aimeos-core/admin/extjs/lib/* public/aimeos/extjs/lib/ cp -r vendor/aimeos/aimeos-core/admin/extjs/lib/* public/aimeos/admin/extjs/lib/

    Client present, but where is admin folder?

    opened by 1f7 2
  • Can't get the admin URL to work

    Can't get the admin URL to work

    Hi I was evaluating slim's functionality in one complete application, I have several web projects (CI, Magento, etc.) all on htdocs and I am using xampp

    I followed the instruction on the readme, I was able to install the database, and setup httpd.conf to point my aimeos-slim

    # virtual host being defined.
    #
    <VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/aimeos/public"
    ServerName slimtest.dev
    ServerAlias www.slimtest.dev
    <Directory "c:/xampp/htdocs/aimeos/public">
    AllowOverride All
    Require all Granted
    </Directory>
    </VirtualHost>
    

    I even followed the pertinents setup(s) here https://github.com/slimphp/Slim/issues/2294

    I can't get the admin to work http://www.slimtest.dev/admin/
    Page Not Found
    
    The page you are looking for could not be found. Check the address bar to ensure your URL is spelled correctly. If all else fails, you can visit our home page at the link below.
    Visit the Home Page
    
    but the http://www.slimtest.dev/detail/5/Demo_bundle_article/2  works fine !
    
    opened by codingarrow 1
  • Scrutinizer Auto-Fixes

    Scrutinizer Auto-Fixes

    @aimeos requested this pull request.

    It consists of patches automatically generated for this project on Scrutinizer: https://scrutinizer-ci.com/g/aimeos/aimeos-slim/

    opened by scrutinizer-auto-fixer 0
  • Scrutinizer Auto-Fixes

    Scrutinizer Auto-Fixes

    @aimeos requested this pull request.

    It consists of patches automatically generated for this project on Scrutinizer: https://scrutinizer-ci.com/g/aimeos/aimeos-slim/

    opened by scrutinizer-auto-fixer 0
  • Scrutinizer Auto-Fixes

    Scrutinizer Auto-Fixes

    @aimeos requested this pull request.

    It consists of patches automatically generated for this project on Scrutinizer: https://scrutinizer-ci.com/g/aimeos/aimeos-slim/

    opened by scrutinizer-auto-fixer 0
Owner
Aimeos
Ultra fast, Open Source e-commerce framework for building custom online shops, market places and complex B2B applications #gigacommerce
Aimeos
Aimeos PHP e-commerce framework for ultra fast online shops, scalable marketplaces, complex B2B applications

Aimeos is an Open Source e-commerce framework for online shops consisting of the e-commerce library, the administration interface and different front-ends. It's a modular stack that offers an unmatched combination of flexibility and speed.

Aimeos 2.6k Dec 30, 2022
Full-featured e-commerce platform with multi-domain and multi-language support for PHP 8

Surikata.io Full-featured e-commerce platform with multi-domain and multi-language support for PHP 8. Free to use for both commercial and personal pro

null 8 Apr 5, 2022
Zen Cart® is a full-function e-commerce application for your website.

Zen Cart® - The Art of E-Commerce Zen Cart® was the first Open Source e-Commerce web application to be fully PA-DSS Certified. Zen Cart® v1.5.8 is an

Zen Cart 304 Jan 6, 2023
An eCommerce website is an online store where you can buy or sell products online. An eCommerce offers a professional online store builder that helps you launch your eCommerce business quickly and successfully.

An eCOMMERCE-SITE An eCommerce website is an online store where you can buy or sell products online. An eCommerce offers a professional online store b

UTTKARSH PARMAR 2 Aug 8, 2022
An E-Commerce package for Laravel with Grafite CMS. Take control of your content and how you sell it! Products, subscriptions, shipping, downloading and more!

Grafite Commerce Grafite has archived this project and no longer supports or develops its code. We recommend using only as a source of ideas for your

Grafite Inc 45 Jun 8, 2021
GetCandy is a package that brings functionality akin to Shopify and other e-commerce platforms to Laravel.

GetCandy is a set of Laravel packages that bring functionality akin to Shopify and other e-commerce platforms to Laravel. You have complete freedom to

GetCandy 7 Oct 27, 2022
Commerce GrappQL Package for Laravel

Sailwork Commerce Package for Laravel Document Please read document in here: Document Installation You can install the package via composer: composer

Sail Work 6 May 10, 2021
Drag and Drop Website Builder and CMS with E-commerce

Microweber: Drag-and-Drop CMS Current version: 1.2 running on Laravel 8! Download | What is Microweber? | Core features of Microweber | Requirements |

Microweber 2.6k Dec 28, 2022
PHP payment library to easily integrate Baltic banklinks (supports old and new iPizza protocol), E-commerce gateaway (Estcard, Nets Estonia), Liisi Payment Link and Pocopay.

PHP Payment library PHP payment library to easily integrate Baltic banklinks, E-commerce gateaway (Estcard, Nets Estonia), Liizi Payment Link and Poco

Rene Korss 34 Apr 27, 2022
Miolica: an e-commerce application that uses React.js as the frontend and Laravel as the backend

Miolica: an e-commerce application that uses React.js as the frontend and Laravel as the backend

Valll 5 Apr 20, 2022
PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

PrestaShop is an Open Source e-commerce web application, committed to providing the best shopping cart experience for both merchants and customers. It is written in PHP, is highly customizable, supports all the major payment services, is translated in many languages and localized for many countries, has a fully responsive design (both front and back office), etc. See all the available features.

PrestaShop 6.9k Dec 31, 2022
Begining of an e-commerce website using PHP and the MVC Pattern

Begining of an e-commerce website using PHP and the MVC Pattern

Ulysse Valdenaire 5 Dec 25, 2022
Laravel FREE E-Commerce Software

Laravel FREE E-Commerce Software

Jeff Simons Decena 1.7k Dec 24, 2022
A free open source e-commerce platform for online merchants based on customised version of Laravel.

A free open source e-commerce platform for online merchants based on customised version of Laravel.

Ace Vinayak 58 Oct 19, 2022
E-Commerce Laravel Project

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Mohamed Fadl 2 Dec 10, 2022
A e-commerce website with Laravel, Vue

A eCommerce using Laravel Version: 1.0 Release of the Laravel eCommerce. Technologies and libraries Laravel 7+, PHP 7+. JavaScript & VueJS Framework.

Jackson Zhang 1 Nov 4, 2021
A developer-friendly e-commerce foundation for your Laravel app

laravel-shopr A developer-friendly e-commerce foundation for your Laravel app. All the features you need for your webshop but without sacrificing you

Happy Pixels AB 208 Nov 2, 2022
Laravel FREE E-Commerce Software

Get discount on Digital Ocean Sign-up with Digital Ocean and get $10 discount! Laravel FREE E-Commerce Software Features Provided Products Cart Checko

Jeff Simons Decena 1.7k Jan 4, 2023
GetCandy - A headless E-Commerce API built on top of Laravel.

A headless E-Commerce API built on top of Laravel. Build amazing online stores with full control over functionality and user experience using headless

GetCandy 438 Jan 4, 2023