Disable the e-commerce on your Sylius.


Monsieur Biz logo      Sylius logo
Monsieur Biz is a Sylius Extension Artisan partner

No Commerce for Sylius

No Commerce Plugin license Tests Scrutinizer Code Quality

This plugin disables the e-commerce parts of Sylius.
Basically it disables the routes and updates the admin and frontend templates.


composer require monsieurbiz/sylius-no-commerce-plugin="1.0.x-dev" --no-scripts

Change your config/bundles.php file to add the line for the plugin :


return [
    MonsieurBiz\SyliusNoCommercePlugin\MonsieurBizSyliusNoCommercePlugin::class => ['all' => true],

Then create the config file in config/packages/monsieurbiz_sylius_nocommerce_plugin.yaml :

    - { resource: "@MonsieurBizSyliusNoCommercePlugin/Resources/config/config.yaml" }

        allow_customers: false

You can allow customers by changing the allow_customers parameters to true.

Add some annotations to your src/Entity/Channel/Channel.php entity to prevent error during Channel saving:

   * @ORM\Entity
   * @ORM\Table(name="sylius_channel")
+  * @ORM\AssociationOverrides({
+  *     @ORM\AssociationOverride(name="baseCurrency",
+  *         joinColumns=@ORM\JoinColumn(
+  *             name="base_currency_id", referencedColumnName="id", nullable=true
+  *         )
+  *     )
+  * })
  class Channel extends BaseChannel

Use a different trait for your src/Kernel.php:

-     use MicroKernelTrait;
+     use SyliusNoCommerceKernelTrait;

(don't forget the use MonsieurBiz\SyliusNoCommercePlugin\Kernel\SyliusNoCommerceKernelTrait; statement or course).

Copy the templates we override:

cp -Rv vendor/monsieurbiz/sylius-no-commerce-plugin/src/Resources/templates/* templates/

Create the new migrations, and run them:

./bin/console doctrine:migrations:diff
./bin/console doctrine:migrations:migrate


You can open an issue or a Pull Request if you want! 😘
Thank you!