• Stars
    star
    223
  • Rank 178,458 (Top 4 %)
  • Language
    CSS
  • License
    MIT License
  • Created about 10 years ago
  • Updated about 1 year ago

Reviews

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

Repository Details

Symfony e-commerce bundle for professional, ultra fast online shops, complex B2B applications and #gigacommerce
Aimeos logo

Aimeos Symfony bundle

Total Downloads Build Status Coverage Status Scrutinizer Code Quality

⭐ Star us on GitHub β€” it helps!

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

Aimeos Symfony demo

Table of content

Installation

This document is for the latest Aimeos 2021.10 and Symfony 4.4.

If you want to upgrade between major versions, please have a look into the upgrade guide!

The Aimeos Symfony e-commerce bundle is a composer based library that can be installed easiest by using Composer. If you don't have an existing Symfony application, you can create a skeleton application using

composer create-project symfony/website-skeleton:~4.4 myshop
cd myshop

These settings need to be added to the ./config/packages/fos_user.yaml file:

fos_user:
    db_driver: orm
    user_class: Aimeos\ShopBundle\Entity\FosUser
    firewall_name: aimeos_myaccount
    from_email:
        address: "[email protected]"
        sender_name: "Test shop"

Also add these lines to your existing ./config/packages/framework.yaml file:

    templating:
        engines:
            twig

The Aimeos components have to be configured as well to get authentication working correctly. You need to take care of three things: Using the correct customer manager implementation and password encryption method as well as the right path for the storages. All must be appended at the end of the ./config/packages/aimeos_shop.yaml:

aimeos_shop:
    resource:
        fs:
            baseurl: "https://yourdomain.com/"
            basedir: "%kernel.root_dir%/../public"
        fs-admin:
            basedir: "%kernel.root_dir%/../public/uploads"
    mshop:
        customer:
            manager:
                name: FosUser
                password:
                    name: Bcrypt

To configure the Aimeos routing, create the file ./config/routes/aimeos_shop.yaml with these lines:

aimeos_shop:
    resource: "@AimeosShopBundle/Resources/config/routing.yml"

The same applies for the FosUser bundle. Create the file ./config/routes/fos_user.yaml containing:

fos_user:
    resource: "@FOSUserBundle/Resources/config/routing/all.xml"

Make sure that the database is set up and it is configured in your ./config/packages/doctrine.yaml:

parameters:
    env(DATABASE_URL): ''
    database_host: <your host/ip>
    database_port: <your port>
    database_name: <your database>
    database_user: <db username>
    database_password: <db password>

Also, you have to configure your database credentials in the .env file:

DATABASE_URL=mysql://db_user:[email protected]:3306/db_name

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.

Symfony 4 uses an in-memory mail spooler by default which collects the e-mails and send them at the end. This can be problematic if there's an error because you e.g. forgot to add a sender address and all e-mail gets lost. The settings for sending e-mails immediately in ./config/packages/swiftmailer.yaml are:

swiftmailer:
    url: '%env(MAILER_URL)%'
    sender_address: <[email protected]>
#    spool: { type: 'memory' }

If you don't use Sendmail but SMTP for sending e-mails, you have to adapt the MAILER_URL configuration in your .env file, e.g.:

MAILER_URL=smtp://smtp.mailtrap.io:2525?encryption=tls&auth_mode=login&username=...&password=...

Composer

Then add these lines to your composer.json of your Symfony project:

    "prefer-stable": true,
    "minimum-stability": "dev",
    "require": {
        "aimeos/aimeos-symfony": "~2021.10",
        "friendsofsymfony/user-bundle": "^2.2.2",
        ...
    },
    "scripts": {
        "post-install-cmd": [
            "Aimeos\\ShopBundle\\Composer\\ScriptHandler::installBundle",
            "Aimeos\\ShopBundle\\Composer\\ScriptHandler::setupDatabase",
            ...
        ],
        "post-update-cmd": [
            "Aimeos\\ShopBundle\\Composer\\ScriptHandler::installBundle",
            "Aimeos\\ShopBundle\\Composer\\ScriptHandler::setupDatabase",
            ...
        ]
    }

Afterwards, install the Aimeos shop bundle using

composer update

In a production environment or if you don't want that the demo data gets installed, use the --no-dev option:

SYMFONY_ENV=prod composer update --no-dev

If you get an exception that the SensioGeneratorBundle isn't found, follow the steps described in the Aimeos Symfony forum post

Start the PHP web server in the base directory of your application to do some quick tests:

php -S 127.0.0.1:8000 -t public

Then, you should be able to call the catalog list page in your browser using

http://127.0.0.1:8000/shop

Login and Admin

Setting up the administration interface is a matter of configuring the Symfony firewall to restrict access to the admin URLs.

Setting up the security configuration is the most complex part. The firewall setup in ./config/packages/security.yaml should look like this one:

security:
    providers:
        aimeos:
            entity: { class: AimeosShopBundle:FosUser, property: username }

    encoders:
        Aimeos\ShopBundle\Entity\FosUser: bcrypt

    firewalls:
        aimeos_admin:
            pattern:   ^/admin
            anonymous: ~
            provider: aimeos
            logout_on_user_change: true
            form_login:
                login_path: /admin
                check_path: /admin_check
        aimeos_myaccount:
            pattern: ^/
            form_login:
                provider: aimeos
                csrf_token_generator: security.csrf.token_manager
            logout:       true
            anonymous:    true

    access_control:
        - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/profile, roles: ROLE_USER }
        - { path: ^/admin/.+, roles: [ROLE_ADMIN, ROLE_SUPER_ADMIN] }

Caution: The order of the configuration settings in this file is important!

These settings will protect the /admin/* URLs from unauthorized access from someone without admin privileges.

The /profile URL is protected by the FOS user bundle as well, which also offers user registration.

As last step, you have to create an admin account using the Symfony command line:

./bin/console aimeos:account --admin [email protected]

The e-mail address is the user name for login and the account will work for the frontend too. To protect the new account, the command will ask you for a password. The same command can create limited accounts by using "--editor" instead of "--admin". If you use "--super" the account will have access to all sites.

If the PHP web server is still running (php -S 127.0.0.1:8000 -t public), you should be able to call the admin login page in your browser using

http://127.0.0.1:8000/admin

and authenticating with your e-mail and the password which has been asked for by the aimeos:account command.

Hints

To simplify development, you should configure to use no content cache. You can do this by adding these lines to ./config/packages/aimeos_shop.yaml:

aimeos_shop:
    madmin:
        cache:
            manager:
                name: None

License

The Aimeos Symfony bundle is licensed under the terms of the MIT license and is available for free.

Links

More Repositories

1

aimeos-laravel

Laravel ecommerce package for ultra fast online shops, scalable marketplaces, complex B2B applications and #gigacommerce
PHP
6,508
star
2

aimeos-core

Aimeos PHP e-commerce framework for ultra fast online shops, scalable marketplaces, complex B2B applications and #gigacommerce
PHP
2,921
star
3

map

PHP arrays and collections made easy
PHP
2,613
star
4

upscheme

Database migrations and schema updates made easy
PHP
982
star
5

aimeos-headless

Aimeos cloud-native, API-first ecommerce headless distribution for ultra fast online shops, scalable marketplaces, complex B2B applications and #gigacommerce
JavaScript
759
star
6

macro

Customize code using closures
PHP
729
star
7

aimeos-base

Aimeos abstraction layer for host applications
PHP
483
star
8

aimeos-typo3

TYPO3 e-commerce extension for ultra fast online shops, scalable marketplaces, complex B2B applications and #gigacommerce
PHP
204
star
9

aimeos-slim

Slim PHP package for professional, ultra fast online shops
PHP
100
star
10

ai-client-html

Aimeos e-commerce HTML client components
PHP
61
star
11

ai-admin-jqadm

Aimeos e-commerce Vue.js+Bootstrap based admin interface
PHP
60
star
12

aimeos-flow

Flow / NeosCMS e-commerce package for professional, ultra fast online shops and complex B2B applications
PHP
28
star
13

ai-laravel

Laravel adapter for Aimeos web shops and e-commerce solutions
PHP
27
star
14

ai-client-jsonapi

Aimeos frontend JSON API
PHP
24
star
15

ai-controller-jobs

Aimeos e-commerce job controllers
PHP
23
star
16

ai-controller-frontend

Aimeos frontend controler
PHP
23
star
17

ai-admin-jsonadm

Aimeos e-commerce JSON API for administrative tasks
PHP
22
star
18

ai-gettext

Gettext adapter for Aimeos core
PHP
19
star
19

ai-swiftmailer

SwiftMailer adapter for Aimeos web shops and e-commerce solutions
PHP
18
star
20

ai-cms-grapesjs

GrapesJS CMS integration into Aimeos
PHP
17
star
21

aimeos-docs

Aimeos documentation
HTML
14
star
22

ai-typo3

TYPO3 adapter for Aimeos web shops and e-commerce solutions
PHP
12
star
23

ai-admin-extadm

Aimeos e-commerce ExtJS based admin interface
PHP
11
star
24

laravel-cms

Easy, flexible and powerful API-first Laravel CMS package with JSON:API and GraphQL APIs
PHP
10
star
25

ai-fosuser

Adapter for the Symfony FOS user bundle to integrate into Aimeos online shops and e-commerce solutions
PHP
10
star
26

ai-symfony

Symfony adapter for Aimeos online shops and e-commerce solutions
PHP
10
star
27

ai-cache

Cache extension for Aimeos web shops and e-commerce solutions
PHP
9
star
28

aimeos-docker

Aimeos docker images
Dockerfile
9
star
29

ai-monolog

Monolog adapter for Aimeos web shops and e-commerce solutions
PHP
8
star
30

ai-twig

Adapter for Twig template engine
PHP
8
star
31

ai-mqueue

Aimeos message queue adapter
PHP
8
star
32

ai-filesystem

File system layer for Aimeos e-commerce components and online shop solution
PHP
8
star
33

aimeos-typo3-dist

TYPO3 e-commerce distribution for high performance web shops
PHP
7
star
34

aimeos-test

Test core and all extensions
6
star
35

ai-catsuggest

Include categories in search suggestions
PHP
5
star
36

ai-zend

Zend Framework adapter for Aimeos web shops and e-commerce solutions
PHP
4
star
37

ai-slim

Aimeos adapter for the Slim PHP micro framework
PHP
4
star
38

ai-zend2-i18n

Zend Framework 2 translation adapter for Aimeos web shops and e-commerce solutions
PHP
4
star
39

ai-container

Container extension for Aimeos web shops and e-commerce solutions
PHP
4
star
40

ai-admin-graphql

Aimeos GraphQL API admin interface
PHP
3
star
41

ai-zend2

Zend Framework 2 adapter for Aimeos web shops and e-commerce solutions
PHP
3
star
42

aimeos-vuestorefront

VueStorefront integration in Aimeos
3
star
43

ai-ezpublish

Aimeos adapter for the ezPublish platform and CMS
PHP
3
star
44

ai-flow

Flow/NeosCMS adapter for Aimeos web shops and e-commerce solutions
PHP
3
star
45

ai-shippings

Logsta connector
PHP
2
star
46

ai-lexoffice

Aimeos Lexoffice adapter: Push orders from Aimeos to Lexoffice
PHP
2
star
47

react-commerce

React.js ecommerce PWA for Aimeos
1
star