GithubHelp home page GithubHelp logo

albertirse / syliusnocommerceplugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from monsieurbiz/syliusnocommerceplugin

0.0 0.0 0.0 190 KB

Disable the e-commerce on your Sylius.

License: MIT License

PHP 81.26% Makefile 12.37% Twig 6.37%

syliusnocommerceplugin's Introduction

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

No Commerce for Sylius

No Commerce Plugin license Security Tests Flex Recipe

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

Installation

composer require monsieurbiz/sylius-no-commerce-plugin
For the installation without flex, follow these additional steps

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

<?php

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

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

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

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

Re-enable features

In the config file config/packages/monsieurbiz_sylius_nocommerce_plugin.yaml, add this lines:

# ...
monsieurbiz_sylius_nocommerce:
    config:
        allow_countries: false
        allow_customers: false
        allow_zones: false

You can allow different sections by changing the parameters to true.

Contributing

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

syliusnocommerceplugin's People

Contributors

jacquesbh avatar maximehuran avatar delyriand avatar lanfisis avatar albertirse avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.