commercetools / sunrise
Commercetools Sunrise PHP template shop
Installs: 51
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 38
Forks: 8
Open Issues: 8
Type:project
Requires
- php: >=5.6
- commercetools/php-sdk: ^1.5 || ^2.0
- commercetools/sunrise-theme: ^0.63
- commercetools/symfony-bundle: ^0.2@dev
- guzzlehttp/guzzle: ^6.3
- incenteev/composer-parameter-handler: ^2.0
- jays-de/handlebars-bundle: ^1.0.1
- monolog/monolog: ^1.7
- particle/validator: ^2.1
- sensio/distribution-bundle: ^5.0
- sensio/framework-extra-bundle: ^3.0
- symfony/monolog-bundle: ^3.0
- symfony/psr-http-message-bridge: ^0.2.0
- symfony/symfony: ^3.1
Requires (Dev)
This package is auto-updated.
Last update: 2020-03-17 10:25:30 UTC
README
⚠️ The Sunrise php shopfront implementation is now deprecated and will be decommissioned in 2020. If you would nevertheless like to use it for your own developments you should fork this repository under the given license and continue developing your version, but please be aware that there will be no more updates and no support provided to this framework.
SUNRISE PHP is a template shopfront implementation that implements a complete online shop on the commercetools eCommerce platform using the following components:
- the commercetools PHP SDK and its corresponding commons library
- the commercetools SUNRISE responsive HTML templates (handlebars syntax)
- the symfony framework (using the MicrokernelTrait)
It aims to focus on being slim, easy to understand and fast, delegating reusabilty into the commons and symfony-components libraries.
Please read the Changelog before updating in any case.
Prerequisites
- PHP (see the SDK for detailed requirements)
- composer
Run
To run, you need a project on the commercetools platform that contains some minimum necessary content (e.g. the sample data). Then get your project key, client ID and client secret from the merchant center and provide them in one of the following ways:
- create a file
app/config/parameters.yml
with the following format:
parameters: env(SECRET_TOKEN): Secr3tT0ken env(CTP_CLIENT_ID): client-id env(CTP_CLIENT_SECRET): client-secret env(CTP_PROJECT): project-key
For local development purposes you can run the application in the php built-in web server. The web
folder contains static assets and index.php as the only PHP file.
Production Site:
php bin/console server:run --env prod
Development Site:
php bin/console server:run
Develop
To improve the template, we are happily receiving pull requests with improvements and bug fixes. If you'd like to change bigger things or add features it's a good idea to discuss the idea in a github issue first.
IMPORTANT: The composer configuration clones the PHP commons library and the sunrise designs inside the vendor
directory. So pay attention when doing git operations with changes in these files.
Using the command line
Available console commands
php bin/console list
Cache warm up
php bin/console cache:warmup
Deployment
Heroku
For an easy and fast deployment of your application we recommend heroku:
Docker
The Sunrise app is delivered with a docker compose configuration.
docker run -v $PWD:/var/www/symfony -w /var/www/symfony --rm=true jaysde/symfony-php-fpm composer install --prefer-dist
docker-compose up
This starts a nginx and a php-fpm docker container serving the application.
Create your own shop
Fork and forge your own eCommerce solution from it.
More specifically:
- fork the project or just copy the code (the MIT license of this code and the SUNRISE design allow unrestricted commercial use and modification)
- you may want to change the namespace of some things to your own project's name (TODO the template could use a generic namespace from the beginning)
- EITHER override and change the SUNRISE design by creating a
templates
directory in the project folder and overriding the*.hbs
filenames you find invendor/commercetools/sunrise-design/templates
- OR create an own HTML and templates structure from scratch using your preferred tools and template language
- add and change stuff as you like
- Be nice and contribute useful generic helpers back to the OSS commons library.