Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

asdoria/AsdoriaSyliusRetailerPlugin

Repository files navigation

Asdoria Retailer Bundle

Simply Retailer's Managment into Sylius Shop

Features

  • 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

Leaflet Map

Retailers Group and custom retailer creation:

Example of major retailer and custom retailer creation

Installation


  1. run composer require asdoria/sylius-retailer-plugin

  2. Add the bundle in config/bundles.php. You must put it ABOVE SyliusGridBundle

Asdoria\SyliusRetailerPlugin\AsdoriaSyliusRetailerPlugin::class => ['all' => true],
[...]
Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
  1. Import routes in config/routes.yaml
asdoria_retailer:
    resource: "@AsdoriaSyliusRetailerPlugin/Resources/config/routing.yaml"
  1. Import config in config/packages/_sylius.yaml
imports:
    - { resource: "@AsdoriaSyliusRetailerPlugin/Resources/config/config.yaml"}
  1. run php bin/console do:mi:mi to update the database schema

  2. 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..',
}

Demo

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.

Usage

  1. In the back office, under "Retailers Managment", create a Major Retailer with a unique name.
  2. Click on "Manage retailers", and on "Add a new retailer" button.
  3. Fill the fields, and put unique longitude and latitude.
  4. Access to your map at /en_US/retailers (depends on your Sylius locale).