PHPackages                             marcelsud/shop-api-plugin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. marcelsud/shop-api-plugin

ActiveSylius-plugin[API Development](/categories/api)

marcelsud/shop-api-plugin
=========================

Shop API for Sylius E-Commerce.

v1.0.1(8y ago)03MITPHPPHP ^7.1

Since Apr 11Pushed 8y ago1 watchersCompare

[ Source](https://github.com/marcelsud/SyliusShopApiPlugin)[ Packagist](https://packagist.org/packages/marcelsud/shop-api-plugin)[ RSS](/packages/marcelsud-shop-api-plugin/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (12)Versions (28)Used By (0)

Sylius Shop API [![License](https://camo.githubusercontent.com/447a8d603709b8544e6ce38e588fd002a0295a94802e26ae84d915bf6fea5f00/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73796c6975732f73686f702d6170692d706c7567696e2e737667)](https://packagist.org/packages/sylius/shop-api-plugin) [![Version](https://camo.githubusercontent.com/c3b13a52624bb23f420100174970acf59b48cc734fd23fe9454d9985edbbaabb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73796c6975732f73686f702d6170692d706c7567696e2e737667)](https://packagist.org/packages/sylius/shop-api-plugin) [![Build Status on linux](https://camo.githubusercontent.com/3b5273011e29b8f9a17a6b17c6e0ccf2a3675c8aa323662a741f3b5ade28ada4/68747470733a2f2f7472617669732d63692e6f72672f53796c6975732f53796c69757353686f70417069506c7567696e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Sylius/SyliusShopApiPlugin) [![Scrutinizer Quality Score](https://camo.githubusercontent.com/173570ee2ce1be450a3a62ee231b76cd91b93020c4e2c042fe5d3fe1dc78655a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f53796c6975732f53796c69757353686f70417069506c7567696e2e737667)](https://scrutinizer-ci.com/g/Sylius/SyliusShopApiPlugin/)
===================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#sylius-shop-api----)

This repository provides a ShopApi implementation on the top of [Sylius E-Commerce platform](https://github.com/Sylius/Sylius).

Beware
======

[](#beware)

It is also just an addition to Sylius - Standard. Please, check [official documentation](http://docs.sylius.org/en/latest/) in order to understand the basic concepts.

Pre - requirements
------------------

[](#pre---requirements)

In order to run this plugin you need to fulfill following requirements:

1. Installed composer [Composer](https://getcomposer.org/).

    ```
    $ wget http://getcomposer.org/composer.phar
    $ php composer.phar create-project -s beta sylius/sylius-standard project
    ```
2. Installed Sylius

    ```
    $ cd project
    $ php bin/console sylius:install
    ```

Rest of the command are executed inside `project` folder.

Usage
-----

[](#usage)

1. Run `composer require sylius/shop-api-plugin`.
2. Extend config files:

    1. Add SyliusShopApi to AppKernel.

    ```
    // app/AppKernel.php

        /**
         * {@inheritdoc}
         */
        public function registerBundles()
        {
            $bundles = [
                // ...

                new \Sylius\ShopApiPlugin\ShopApiPlugin(),
                new \League\Tactician\Bundle\TacticianBundle(),
            ];

            return array_merge(parent::registerBundles(), $bundles);
        }
    ```

    2. Add `- { path: '^/shop-api', priorities: ['json'], fallback_format: json, prefer_extension: true }` to `fos_rest.format_listener.rules`section in `app/config/config.yml` file and import config from Plugin.

    ```
    # app/config/config.yml

    imports:
        # ...
        - { resource: "@ShopApiPlugin/Resources/config/app/config.yml" }

    # ...

    fos_rest:
        # ...

        format_listener:
            rules:
                - { path: '^/shop-api', priorities: ['json'], fallback_format: json, prefer_extension: true } #
