Simply Retailer's Managment into Sylius Shop
- Create Major Retailer using your own images
- Create custom retailers with precise geographical coordinates and contact informations
- Create your own interactive map with Leaflet to show all your retailers
Retailers Group and custom retailer creation:
-
run
composer require asdoria/sylius-retailer-plugin
-
Add the bundle in
config/bundles.php
. You must put it ABOVESyliusGridBundle
Asdoria\SyliusRetailerPlugin\AsdoriaSyliusRetailerPlugin::class => ['all' => true],
[...]
Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
- Import routes in
config/routes.yaml
asdoria_retailer:
resource: "@AsdoriaSyliusRetailerPlugin/Resources/config/routing.yaml"
- Import config in
config/packages/_sylius.yaml
imports:
- { resource: "@AsdoriaSyliusRetailerPlugin/Resources/config/config.yaml"}
-
run
php bin/console do:mi:mi
to update the database schema -
Edit your defaults settings in
@AsdoriaSyliusRetailerPlugin/Resources/views/Shop/Retailer/index.html.twig
:
config = {
'ajaxRoute' : path('asdoria_shop_ajax_retailer_index', {'criteria[search][value]': 0}),
'imageRoute': 'media/cache/resolve/sylius_small/',
'default' : {
'latitude' : 45.564601,
'longitude' : 5.917781,
},
'searchField': Street, Zipcode, City',
'findButton' : 'Find a retailer',
'emptyResultsMessage': 'No results..',
}
You can see the result for the user here with a cap: here.
If you want to try to create retailers, go on the admin authentication page and connect with:
Login: asdoria
Password: asdoria
Then go on "Retailers Managment" in the back office and follow usage lines below.
Note that we have developed several other open source plugins for Sylius, whose demos and documentation are listed on the following page.
- In the back office, under "Retailers Managment", create a Major Retailer with a unique name.
- Click on "Manage retailers", and on "Add a new retailer" button.
- Fill the fields, and put unique longitude and latitude.
- Access to your map at
/en_US/retailers
(depends on your Sylius locale).