3brs / sylius-extended-channels-plugin
Extended channels plugin for Sylius
Installs: 28
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 6
Type:sylius-plugin
Requires
- php: ^7.3
- ext-json: *
- sylius/sylius: ^1.7
Requires (Dev)
- behat/behat: ^3.4
- behat/mink: ^1.7@dev
- behat/mink-browserkit-driver: ^1.3
- behat/mink-extension: ^2.2
- behat/mink-selenium2-driver: ^1.3
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/suite-settings-extension: ^1.0
- friends-of-behat/symfony-extension: ^2.0
- friends-of-behat/variadic-extension: ^1.1
- lakion/mink-debug-extension: ^1.2.3
- phpstan/phpstan-doctrine: ^0.10
- phpstan/phpstan-shim: ^0.10
- phpstan/phpstan-symfony: ^0.10
- phpstan/phpstan-webmozart-assert: ^0.10
- phpunit/phpunit: ^6.5
- sensiolabs/security-checker: ^5.0
- sylius-labs/coding-standard: ^2.0
- symfony/browser-kit: ^3.4|^4.1
- symfony/debug-bundle: ^3.4|^4.1
- symfony/dotenv: ^4.2
- symfony/intl: ^3.4|^4.1
- symfony/web-profiler-bundle: ^3.4|^4.1
- symfony/web-server-bundle: ^3.4|^4.1
Conflicts
- symfony/browser-kit: 4.1.8
- symfony/dependency-injection: 4.1.8
- symfony/dom-crawler: 4.1.8
- symfony/routing: 4.1.8
- symfony/symfony: 4.1.8
This package is auto-updated.
Last update: 2024-10-30 02:10:43 UTC
README
Extended Channels Plugin
Features
- Duplicate product and product variant
- Bulk action to set categories for products
- Mark Taxon as external link so taxonomy can be used for creating custom menus with links anywhere
- Download current exchange rates
- Update product prices using downloaded or custom exchange rates
- Set channel timezone
- Set channel phone
- Send copy of order mail to custom email address per channel
- When SMTP is unavailable, it prevents error 500 on order submit but logs the error and submits the order
- Cancel unpaid orders for certain payment method
- Allows to change the code for the product and product variant
- Administration for Hello Bars (you can use your own types)
Installation
-
Run
$ composer require mangoweb-sylius/sylius-extended-channels
. -
Add plugin classes to your
config/bundles.php
:return [ ... MangoSylius\ExtendedChannelsPlugin\MangoSyliusExtendedChannelsPlugin::class => ['all' => true], ];
-
Your Entity
Channel
has to implement\MangoSylius\ExtendedChannelsPlugin\Model\ExtendedChannelInterface
. You can use TraitMangoSylius\ExtendedChannelsPlugin\Model\ExtendedChannelTrait
. -
Your Entity
Taxon
has to implement\MangoSylius\ExtendedChannelsPlugin\Model\ExternalLinkTaxonInterface
. You can use TraitMangoSylius\ExtendedChannelsPlugin\Model\ExternalLinkTaxonTrait
. -
Include template
{{ include('@MangoSyliusExtendedChannelsPlugin/Channel/extendedChannelForm.html.twig') }}
in@SyliusAdmin/Channel/_form.html.twig
. -
Add
{{ form_row(form.externalLink) }}
to template in@SyliusAdmin/Taxon/_form.html.twig
. -
Replace inner content of
<div class="sylius-grid-nav__bulk"> ... </div>
with{{ include('@MangoSyliusExtendedChannelsPlugin/Grid/bulkActions.html.twig') }}
in@SyliusAdmin/Grid/_default.html.twig
. -
Add resource to
config/packeges/_sylius.yaml
imports: ... - { resource: "@MangoSyliusExtendedChannelsPlugin/Resources/config/resources.yml" }
-
Add routing to
config/_routes.yaml
mango_sylius_extended_channels: resource: '@MangoSyliusExtendedChannelsPlugin/Resources/config/routing.yml' prefix: /admin
For guide to use your own entity see Sylius docs - Customizing Models
Optional
Run src/Migrations/basic-data/timezones-data.sql
for load the timezones table. (Recommended, otherwise the timezone select will be empty)
Usage
Commands
-
Updates exchange rates (you need to define currencies first in Sylius admin)
mango:exchange-rates:update
-
Update Product prices by exchange rates, from
sourceChannel
(primary value, won't be changed) totargetChannel
. You can run this after the previous command to update by downloaded rates or you can run it without the previous one to update the prices with your custom exchange rates set in Sylius admin.mango:product:update-price sourceChannel targetChannel
-
Remove orders that are not paid for a configured period and for certain shipping methods. This allows to keep unpaid orders which are e.g. to be paid at personal pickup, therefore needs to stay unpaid for a couple of hours / days. Configuration parameters:
sylius_order.order_expiration_period
sylius_order.expiration_method_codes
mango:cancel-unpaid-orders
-
You can use events to modify an object when you duplicate it
mango-sylius-extended-channels.duplicate.product.before-persist
mango-sylius-extended-channels.duplicate.product.after-persist
mango-sylius-extended-channels.duplicate.product-variant.before-persist
mango-sylius-extended-channels.duplicate.product-variant.after-persist
-
You can use event after bulk category assignment
mango-sylius-extended-channels.products.after_bulk_categories
-
You can change the types of Hello bars
parameters: mangoweb_sylius_extended_channels_hello_bar_types: error: 'Error' success: 'Success' info: 'Info' warning: 'Warning'
-
Use the Twig function for listing Hello Bars
mangoweb_sylius_available_hello_bars()
mangoweb_sylius_available_hello_bars_by_type(type)
Development
Usage
- Create symlink from .env.dist to .env or create your own .env file
- Develop your plugin in
/src
- See
bin/
for useful commands
Testing
After your changes you must ensure that the tests are still passing.
$ composer install
$ bin/console doctrine:schema:create -e test
$ bin/behat
$ bin/phpstan.sh
$ bin/ecs.sh
License
This library is under the MIT license.