Configuration

Controllers

The plugin provides controllers for cart, orders, and address operations. Choose one of the options below.

Option A: Use Plugin Controllers

If you haven't customized these controllers in your project, use them directly.

Add to config/packages/_sylius.yaml:

sylius_order:
    resources:
        order:
            classes:
                controller: Sylius\LegacyShopBridgePlugin\Controller\OrderController
        order_item:
            classes:
                controller: Sylius\LegacyShopBridgePlugin\Controller\OrderItemController

sylius_addressing:
    resources:
        province:
            classes:
                controller: Sylius\LegacyShopBridgePlugin\Controller\ProvinceController

Option B: Use Traits

If you have existing custom controllers, add traits to them:

Twig Paths

Add to config/packages/twig.yaml:

Note: The first lines are only needed if you have customized SyliusShopBundle or SyliusUiBundle templates in your templates/bundles/ directory. The last two lines pointing to the plugin's templates are always required and have to be placed at the end.

FOSRestBundle

If not already configured, create config/packages/fos_rest.yaml:

Webpack Encore

Add to webpack.config.js:

Build assets:

Template Updates

Encore Entry Points

Update your shop layout template:

Asset Paths

Update asset references:

Regex for bulk replacement:

Find:

Replace:

Note: These regexes work within PHPStorm: Cmd+Shift+R (Find and Replace in Files), enable Regex, paste both patterns.

Twig Functions

Before (Sylius 1.x)
After

sylius_order_items_subtotal(order)

order.getItemsSubtotal()

sylius_order_tax_included(order)

order.getTaxIncludedTotal()

sylius_order_tax_excluded(order)

order.getTaxExcludedTotal()

sylius_product_variant_prices(product, channel)

sylius_product_variants_map(product, {'channel': channel})

UI Events Migration

If you have custom sylius_ui events configuration, rename the root key:

Last updated

Was this helpful?