Download the PHP package setono/sylius-callout-plugin without Composer
On this page you can find all versions of the php package setono/sylius-callout-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download setono/sylius-callout-plugin
More information about setono/sylius-callout-plugin
Files in setono/sylius-callout-plugin
Package sylius-callout-plugin
Short Description Add callouts to your Sylius products
License MIT
Informations about the package sylius-callout-plugin
Sylius Callout Plugin
The callout plugin for Sylius allows you to configure nice callouts/badges for sets of products based on specific rules. It provides a common set of rules by default and is very flexible when it comes to adding new ones.
- Go to installation instructions
Screenshots
Shop
Admin
Installation
Step 1: Download the plugin
Step 2: Enable the plugin
Then, enable the plugin by adding it to the list of registered plugins/bundles
in config/bundles.php
file of your project before (!) SyliusGridBundle
:
Step 3: Configure plugin
Step 4: Import routing
Step 5: Extend entities
Extend Product
Add the Setono\SyliusCalloutPlugin\Model\ProductTrait
trait to your App\Entity\Product\Product
class.
Step 6: Update your database schema
Step 7: Add callouts to your product templates
Add callouts to your product box template. By default, you should use templates/bundles/SyliusShopBundle/Product/_box.html.twig
path. Check out our _box.html.twig file for a reference.
Note the line: {% include "@SetonoSyliusCalloutPlugin/Shop/Product/Callout/_callouts.html.twig" with { 'callouts' : get_callouts(product, 'default') } %}
.
Step 8: Using asynchronous transport (optional, but recommended)
All commands in this plugin will extend the CommandInterface. Therefore, you can route all commands easily by adding this to your Messenger config:
Step 9: Configure cron job
For the performance reasons, configure a cron job on your production server to execute $ bin/console setono:sylius-callout:assign
command
once in a while in order to assign all callouts. In most cases it should be done by the resource event listener
triggered anytime you create/update a product or callout, but it is worth to have it covered if something goes wrong.
Step 10: Install assets
Usage
From now on you should be able to add new callouts in the admin panel. Once you add one, you just need to configure.
Customization
Adding a new rule form
- Configure a new form under
App\Form\Type\Rule
namespace, - Add a rule checker under
App\Checker\Rule
namespace and make sure it implementsSetono\SyliusCalloutPlugin\Checker\Rule\ProductCalloutRuleCheckerInterface
interface and has apublic const TYPE
set corresponding to the below service configuration - Register and tag new services:
All versions of sylius-callout-plugin with dependencies
doctrine/collections Version ^1.8
doctrine/event-manager Version ^1.2
doctrine/orm Version ^2.15
doctrine/persistence Version ^2.5 || ^3.2
ocramius/doctrine-batch-utils Version ^2.4
psr/event-dispatcher Version ^1.0
setono/composite-compiler-pass Version ^1.1
setono/doctrine-object-manager-trait Version ^1.2
sylius/channel Version ^1.0
sylius/channel-bundle Version ^1.0
sylius/core Version ^1.0
sylius/core-bundle Version ^1.0
sylius/locale Version ^1.0
sylius/product Version ^1.0
sylius/product-bundle Version ^1.0
sylius/promotion Version ^1.0
sylius/registry Version ^1.0
sylius/resource-bundle Version ^1.6
sylius/taxonomy Version ^1.0
sylius/taxonomy-bundle Version ^1.0
sylius/ui-bundle Version ^1.0
symfony/config Version ^5.4 || ^6.4
symfony/console Version ^5.4 || ^6.4
symfony/dependency-injection Version ^5.4 || ^6.4
symfony/deprecation-contracts Version ^2.5
symfony/event-dispatcher Version ^5.4 || ^6.4
symfony/form Version ^5.4 || ^6.4
symfony/http-foundation Version ^5.4 || ^6.4
symfony/messenger Version ^5.4 || ^6.4
symfony/options-resolver Version ^5.4 || ^6.4
symfony/routing Version ^5.4 || ^6.4
symfony/translation-contracts Version ^2.5 || ^3.1
symfony/twig-bundle Version ^5.4 || ^6.4
symfony/validator Version ^5.4 || ^6.4
twig/twig Version ^2.15 || ^3.8
webmozart/assert Version ^1.11