GENERAL
FRONTEND
ADDITIONAL
We work on stable, supported and up-to-date versions of packages. We recommend you to do the same.
Package | Version |
---|---|
PHP | >=8.0 |
sylius/sylius | 1.12.x - 1.13.x |
MySQL | >= 5.7 |
NodeJS | >= 18.x |
composer require bitbag/product-attribute-groups-plugin --no-scripts
Add plugin dependencies to your config/bundles.php
file:
# config/bundles.php
return [
...
BitBag\SyliusProductAttributeGroupsPlugin\BitBagSyliusProductAttributeGroupsPlugin::class => ['all' => true],
];
Import required config in your config/packages/_sylius.yaml
file:
# config/packages/_sylius.yaml
imports:
...
- { resource: "@BitBagSyliusProductAttributeGroupsPlugin/Resources/config/config.yml" }
Add routing to your config/routes.yaml
file:
# config/routes.yaml
bitbag_product_attribute_groups_plugin:
resource: "@BitBagSyliusProductAttributeGroupsPlugin/Resources/config/routing.yml"
First, please run legacy-versioned migrations by using command:
bin/console doctrine:migrations:migrate
After migration, please create a new diff migration and update database:
bin/console doctrine:migrations:diff
bin/console doctrine:migrations:migrate
bin/console cache:clear
Note: If you are running it on production, add the -e prod
flag to this command.
Copy required templates into correct directories in your project.
AdminBundle (templates/bundles/SyliusAdminBundle
):
vendor/bitbag/product-attribute-groups-plugin/tests/Application/templates/bundles/SyliusAdminBundle/Product/Attribute/attributeChoice.html.twig
vendor/bitbag/product-attribute-groups-plugin/tests/Application/templates/bundles/SyliusAdminBundle/ProductAttribute/_form.html.twig
Please setup your webpack.config.js
file to require the plugin's webpack configuration. To do so, please put the line below somewhere on top of your webpack.config.js file:
const [ bitbagProductAttributeGroupsAdmin ] = require('./vendor/bitbag/product-attribute-groups-plugin/webpack.config.js')
As next step, please add the imported consts into final module exports:
module.exports = [..., bitbagProductAttributeGroupsAdmin];
Add the asset configuration into config/packages/assets.yaml
:
framework:
assets:
packages:
...
product_attribute_groups_admin:
json_manifest_path: '%kernel.project_dir%/public/build/bitbag/productAttributeGroups/admin/manifest.json'
Add the webpack configuration into config/packages/webpack_encore.yaml
:
webpack_encore:
output_path: '%kernel.project_dir%/public/build/default'
builds:
...
product_attribute_groups_admin: '%kernel.project_dir%/public/build/bitbag/productAttributeGroups/admin'
Add encore functions to your templates:
SyliusAdminBundle:
{# @SyliusAdminBundle/_scripts.html.twig #}
{{ encore_entry_script_tags('bitbag-productAttributeGroups-admin', null, 'product_attribute_groups_admin') }}
{# @SyliusAdminBundle/_styles.html.twig #}
{{ encore_entry_link_tags('bitbag-productAttributeGroups-admin', null, 'product_attribute_groups_admin') }}
yarn install
yarn encore dev # or prod, depends on your environment
For incorrectly displayed translations, execute the command:
bin/console cache:clear