Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ make ecs # Docker

## Architecture

This is the **Sylius Legacy Bridge Plugin** - a plugin for bridging legacy functionality with Sylius e-commerce. It provides a complete development environment with both traditional and Docker setups.
This is the **Sylius Legacy Shop Bridge Plugin** - a plugin for bridging legacy functionality with Sylius e-commerce. It provides a complete development environment with both traditional and Docker setups.

### Core Structure
- **Main Plugin Class**: `src/SyliusLegacyBridgePlugin.php` - Entry point using `SyliusPluginTrait`
- **DI Extension**: `src/DependencyInjection/SyliusLegacyBridgeExtension.php` - Handles service loading and Doctrine migrations
- **Main Plugin Class**: `src/SyliusLegacyShopBridgePlugin.php` - Entry point using `SyliusPluginTrait`
- **DI Extension**: `src/DependencyInjection/SyliusLegacyShopBridgeExtension.php` - Handles service loading and Doctrine migrations
- **Services**: `config/services.xml` - Service definitions with XML configuration
- **Routes**: `config/routes/` - Separate admin and shop route definitions
- **Templates**: `templates/` - Twig templates for admin and shop
Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</a>
</p>

<h1 align="center">Sylius Legacy Bridge Plugin</h1>
<h1 align="center">Sylius Legacy Shop Bridge Plugin</h1>

<p align="center">A plugin for bridging legacy Sylius functionality with modern Sylius applications.</p>

Expand All @@ -17,7 +17,7 @@
1. Install the plugin via Composer:

```bash
composer require sylius/legacy-bridge-plugin
composer require sylius/legacy-shop-bridge-plugin
```

2. Enable the plugin and required bundles in `config/bundles.php`:
Expand All @@ -27,7 +27,7 @@ return [
// ...
Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true],
FOS\RestBundle\FOSRestBundle::class => ['all' => true],
Sylius\LegacyBridgePlugin\SyliusLegacyBridgePlugin::class => ['all' => true],
Sylius\LegacyShopBridgePlugin\SyliusLegacyShopBridgePlugin::class => ['all' => true],
];
```

Expand All @@ -39,7 +39,7 @@ Add the plugin configuration import to your `config/packages/_sylius.yaml` (or m

```yaml
imports:
- { resource: "@SyliusLegacyBridgePlugin/config/config.yaml" }
- { resource: "@SyliusLegacyShopBridgePlugin/config/config.yaml" }
```

### 2. Configure FOSRestBundle
Expand Down Expand Up @@ -73,16 +73,16 @@ sylius_order:
resources:
order:
classes:
controller: Sylius\LegacyBridgePlugin\Controller\OrderController
controller: Sylius\LegacyShopBridgePlugin\Controller\OrderController
order_item:
classes:
controller: Sylius\LegacyBridgePlugin\Controller\OrderItemController
controller: Sylius\LegacyShopBridgePlugin\Controller\OrderItemController

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

**Option B: If you HAVE already any of these controllers in your project**
Expand All @@ -93,7 +93,7 @@ Add the appropriate traits to your existing controllers:
// src/Controller/OrderController.php
namespace App\Controller;

use Sylius\LegacyBridgePlugin\Controller\Trait\OrderTrait;
use Sylius\LegacyShopBridgePlugin\Controller\Trait\OrderTrait;

class OrderController extends \Sylius\Bundle\CoreBundle\Controller\OrderController
{
Expand All @@ -108,7 +108,7 @@ class OrderController extends \Sylius\Bundle\CoreBundle\Controller\OrderControll
namespace App\Controller;

use Sylius\Bundle\ResourceBundle\Controller\ResourceController;
use Sylius\LegacyBridgePlugin\Controller\Trait\OrderItemTrait;
use Sylius\LegacyShopBridgePlugin\Controller\Trait\OrderItemTrait;

class OrderItemController extends ResourceController
{
Expand All @@ -123,7 +123,7 @@ class OrderItemController extends ResourceController
namespace App\Controller;

use Sylius\Bundle\ResourceBundle\Controller\ResourceController;
use Sylius\LegacyBridgePlugin\Controller\Trait\ProvinceTrait;
use Sylius\LegacyShopBridgePlugin\Controller\Trait\ProvinceTrait;

class ProvinceController extends ResourceController
{
Expand All @@ -135,7 +135,7 @@ class ProvinceController extends ResourceController

### 4. Update UI Configuration

Replace `sylius_ui` configuration with `sylius_legacy_bridge` in your `config/packages/sylius_ui.yaml` (or wherever your UI events are configured):
Replace `sylius_ui` configuration with `sylius_legacy_shop_bridge` in your `config/packages/sylius_ui.yaml` (or wherever your UI events are configured):

```yaml
# Before
Expand All @@ -144,7 +144,7 @@ sylius_ui:
# ...

# After
sylius_legacy_bridge:
sylius_legacy_shop_bridge:
events:
# ...
```
Expand All @@ -161,8 +161,8 @@ twig:
'%kernel.project_dir%/templates/bundles/SyliusUiBundle': 'SyliusUi'

# These two lines are REQUIRED
'%kernel.project_dir%/vendor/sylius/legacy-bridge-plugin/templates/bundles/SyliusShopBundle': 'SyliusShop'
'%kernel.project_dir%/vendor/sylius/legacy-bridge-plugin/templates/bundles/SyliusUiBundle': 'SyliusUi'
'%kernel.project_dir%/vendor/sylius/legacy-shop-bridge-plugin/templates/bundles/SyliusShopBundle': 'SyliusShop'
'%kernel.project_dir%/vendor/sylius/legacy-shop-bridge-plugin/templates/bundles/SyliusUiBundle': 'SyliusUi'
```

**Note:** The first two 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.
Expand All @@ -180,8 +180,8 @@ sylius_shop:
_locale: ^[a-z]{2}(?:_[A-Z]{2})?$

# Legacy bridge routes - must be loaded AFTER shop routes
sylius_legacy_bridge:
resource: "@SyliusLegacyBridgePlugin/config/routes.yaml"
sylius_legacy_shop_bridge:
resource: "@SyliusLegacyShopBridgePlugin/config/routes.yaml"
```

### 7. Update Encore Entry Points (Shop)
Expand Down Expand Up @@ -243,7 +243,7 @@ Encore.reset();
Encore
.setOutputPath('public/build/legacy/shop')
.setPublicPath('/build/legacy/shop')
.addEntry('legacy-shop-entry', path.resolve(__dirname, './vendor/sylius/legacy-bridge-plugin/assets/shop/entrypoint.js'))
.addEntry('legacy-shop-entry', path.resolve(__dirname, './vendor/sylius/legacy-shop-bridge-plugin/assets/shop/entrypoint.js'))
.addAliases({
'semantic-ui-css': path.resolve(__dirname, 'node_modules/semantic-ui-css'),
'jquery': path.resolve(__dirname, 'node_modules/jquery'),
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "sylius/legacy-bridge-plugin",
"name": "sylius/legacy-shop-bridge-plugin",
"type": "sylius-plugin",
"description": "Legacy Bridge plugin for Sylius.",
"description": "Legacy Shop Bridge plugin for Sylius.",
"keywords": [
"sylius",
"sylius-plugin",
"legacy-bridge"
"legacy-shop-bridge"
],
"license": "MIT",
"require": {
Expand Down Expand Up @@ -66,12 +66,12 @@
},
"autoload": {
"psr-4": {
"Sylius\\LegacyBridgePlugin\\": "src/"
"Sylius\\LegacyShopBridgePlugin\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\Sylius\\LegacyBridgePlugin\\": ["tests/", "tests/TestApplication/src/"]
"Tests\\Sylius\\LegacyShopBridgePlugin\\": ["tests/", "tests/TestApplication/src/"]
}
}
}
2 changes: 1 addition & 1 deletion config/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
imports:
- { resource: "@SyliusLegacyBridgePlugin/config/events.yaml" }
- { resource: "@SyliusLegacyShopBridgePlugin/config/events.yaml" }

sonata_block:
default_contexts: ~
Expand Down
2 changes: 1 addition & 1 deletion config/events.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is part of the Sylius package.
# (c) Sylius Sp. z o.o.

sylius_legacy_bridge:
sylius_legacy_shop_bridge:
events:
sylius.grid:
blocks:
Expand Down
8 changes: 4 additions & 4 deletions config/routes.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
sylius_legacy_bridge_shop:
resource: "@SyliusLegacyBridgePlugin/config/routes/shop.yaml"
sylius_legacy_shop_bridge_shop:
resource: "@SyliusLegacyShopBridgePlugin/config/routes/shop.yaml"
prefix: /{_locale}
requirements:
_locale: ^[A-Za-z]{2,4}(_([A-Za-z]{4}|[0-9]{3}))?(_([A-Za-z]{2}|[0-9]{3}))?$

sylius_legacy_bridge_legacy_shop:
resource: "@SyliusLegacyBridgePlugin/config/routes/legacy_shop.yaml"
sylius_legacy_shop_bridge_legacy_shop:
resource: "@SyliusLegacyShopBridgePlugin/config/routes/legacy_shop.yaml"
prefix: /{_locale}
requirements:
_locale: ^[A-Za-z]{2,4}(_([A-Za-z]{4}|[0-9]{3}))?(_([A-Za-z]{2}|[0-9]{3}))?$
18 changes: 9 additions & 9 deletions config/routes/legacy_shop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,36 @@ sylius_shop_homepage:
_controller: sylius.controller.shop.homepage::indexAction

sylius_shop_security:
resource: "@SyliusLegacyBridgePlugin/config/routes/legacy_shop/security.yml"
resource: "@SyliusLegacyShopBridgePlugin/config/routes/legacy_shop/security.yml"

sylius_shop_user:
resource: "@SyliusLegacyBridgePlugin/config/routes/legacy_shop/shop_user.yml"
resource: "@SyliusLegacyShopBridgePlugin/config/routes/legacy_shop/shop_user.yml"

sylius_shop_product:
resource: "@SyliusLegacyBridgePlugin/config/routes/legacy_shop/product.yml"
resource: "@SyliusLegacyShopBridgePlugin/config/routes/legacy_shop/product.yml"

sylius_shop_product_review:
resource: "@SyliusLegacyBridgePlugin/config/routes/legacy_shop/product_review.yml"
resource: "@SyliusLegacyShopBridgePlugin/config/routes/legacy_shop/product_review.yml"
prefix: /products/{slug}/reviews

sylius_shop_cart:
resource: "@SyliusLegacyBridgePlugin/config/routes/legacy_shop/cart.yml"
resource: "@SyliusLegacyShopBridgePlugin/config/routes/legacy_shop/cart.yml"
prefix: /cart

sylius_shop_checkout:
resource: "@SyliusLegacyBridgePlugin/config/routes/legacy_shop/checkout.yml"
resource: "@SyliusLegacyShopBridgePlugin/config/routes/legacy_shop/checkout.yml"
prefix: /checkout

sylius_shop_contact_request:
resource: "@SyliusLegacyBridgePlugin/config/routes/legacy_shop/contact.yml"
resource: "@SyliusLegacyShopBridgePlugin/config/routes/legacy_shop/contact.yml"
prefix: /contact

sylius_shop_order:
resource: "@SyliusLegacyBridgePlugin/config/routes/legacy_shop/order.yml"
resource: "@SyliusLegacyShopBridgePlugin/config/routes/legacy_shop/order.yml"
prefix: /order

sylius_shop_account:
resource: "@SyliusLegacyBridgePlugin/config/routes/legacy_shop/account.yml"
resource: "@SyliusLegacyShopBridgePlugin/config/routes/legacy_shop/account.yml"
prefix: /account

sylius_shop_switch_currency:
Expand Down
4 changes: 2 additions & 2 deletions config/routes/legacy_shop/account.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# (c) Sylius Sp. z o.o.

sylius_shop_account_order:
resource: "@SyliusLegacyBridgePlugin/config/routes/legacy_shop/account/order.yml"
resource: "@SyliusLegacyShopBridgePlugin/config/routes/legacy_shop/account/order.yml"
prefix: /orders

sylius_shop_account_address_book:
resource: "@SyliusLegacyBridgePlugin/config/routes/legacy_shop/account/address_book.yml"
resource: "@SyliusLegacyShopBridgePlugin/config/routes/legacy_shop/account/address_book.yml"
prefix: /address-book

sylius_shop_account_root:
Expand Down
4 changes: 2 additions & 2 deletions config/routes/shop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# (c) Sylius Sp. z o.o.

sylius_shop_ajax:
resource: "@SyliusLegacyBridgePlugin/config/routes/shop/ajax.yml"
resource: "@SyliusLegacyShopBridgePlugin/config/routes/shop/ajax.yml"
prefix: /ajax

sylius_shop_partial:
resource: "@SyliusLegacyBridgePlugin/config/routes/shop/partial.yml"
resource: "@SyliusLegacyShopBridgePlugin/config/routes/shop/partial.yml"
prefix: /_partial
4 changes: 2 additions & 2 deletions config/routes/shop/ajax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# (c) Sylius Sp. z o.o.

sylius_shop_ajax_user:
resource: "@SyliusLegacyBridgePlugin/config/routes/shop/ajax/user.yml"
resource: "@SyliusLegacyShopBridgePlugin/config/routes/shop/ajax/user.yml"
prefix: /users

sylius_shop_ajax_cart:
resource: "@SyliusLegacyBridgePlugin/config/routes/shop/ajax/cart.yml"
resource: "@SyliusLegacyShopBridgePlugin/config/routes/shop/ajax/cart.yml"
prefix: /cart

sylius_shop_ajax_render_province_form:
Expand Down
10 changes: 5 additions & 5 deletions config/routes/shop/partial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
# (c) Sylius Sp. z o.o.

sylius_shop_partial_taxon:
resource: "@SyliusLegacyBridgePlugin/config/routes/shop/partial/taxon.yml"
resource: "@SyliusLegacyShopBridgePlugin/config/routes/shop/partial/taxon.yml"
prefix: /taxons

sylius_shop_partial_cart:
resource: "@SyliusLegacyBridgePlugin/config/routes/shop/partial/cart.yml"
resource: "@SyliusLegacyShopBridgePlugin/config/routes/shop/partial/cart.yml"
prefix: /cart

sylius_shop_partial_product:
resource: "@SyliusLegacyBridgePlugin/config/routes/shop/partial/product.yml"
resource: "@SyliusLegacyShopBridgePlugin/config/routes/shop/partial/product.yml"
prefix: /products

sylius_shop_partial_product_review:
resource: "@SyliusLegacyBridgePlugin/config/routes/shop/partial/product_review.yml"
resource: "@SyliusLegacyShopBridgePlugin/config/routes/shop/partial/product_review.yml"
prefix: /products/{productId}/reviews

sylius_shop_partial_product_association:
resource: "@SyliusLegacyBridgePlugin/config/routes/shop/partial/product_association.yml"
resource: "@SyliusLegacyShopBridgePlugin/config/routes/shop/partial/product_association.yml"
prefix: /products/{productId}/associations
2 changes: 1 addition & 1 deletion config/services/context_provider.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<service
id="Sylius\Bundle\UiBundle\ContextProvider\ContextProviderInterface"
class="Sylius\LegacyBridgePlugin\ContextProvider\DefaultContextProvider"
class="Sylius\LegacyShopBridgePlugin\ContextProvider\DefaultContextProvider"
>
<tag name="sylius.ui.template_event.context_provider" />
</service>
Expand Down
8 changes: 4 additions & 4 deletions config/services/controller.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@
<services>
<defaults public="true" />

<service id="sylius.controller.shop.currency_switch" class="Sylius\LegacyBridgePlugin\Controller\CurrencySwitchController">
<service id="sylius.controller.shop.currency_switch" class="Sylius\LegacyShopBridgePlugin\Controller\CurrencySwitchController">
<argument type="service" id="twig" />
<argument type="service" id="sylius.context.currency" />
<argument type="service" id="sylius.storage.currency" />
<argument type="service" id="sylius.context.channel" />
</service>

<service id="sylius.controller.shop.locale_switch" class="Sylius\LegacyBridgePlugin\Controller\LocaleSwitchController">
<service id="sylius.controller.shop.locale_switch" class="Sylius\LegacyShopBridgePlugin\Controller\LocaleSwitchController">
<argument type="service" id="twig" />
<argument type="service" id="sylius.context.locale" />
<argument type="service" id="sylius.provider.locale" />
<argument type="service" id="sylius_shop.locale_switcher" />
</service>

<service id="sylius.controller.shop.homepage" class="Sylius\LegacyBridgePlugin\Controller\HomepageController">
<service id="sylius.controller.shop.homepage" class="Sylius\LegacyShopBridgePlugin\Controller\HomepageController">
<argument type="service" id="twig" />
</service>

<service id="sylius.controller.shop.security_widget" class="Sylius\LegacyBridgePlugin\Controller\SecurityWidgetController">
<service id="sylius.controller.shop.security_widget" class="Sylius\LegacyShopBridgePlugin\Controller\SecurityWidgetController">
<argument type="service" id="twig" />
</service>
</services>
Expand Down
6 changes: 3 additions & 3 deletions config/services/template_event.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
>
<services>
<service id="Sylius\Bundle\UiBundle\Registry\TemplateBlockRegistryInterface" class="Sylius\LegacyBridgePlugin\Registry\TemplateBlockRegistry">
<service id="Sylius\Bundle\UiBundle\Registry\TemplateBlockRegistryInterface" class="Sylius\LegacyShopBridgePlugin\Registry\TemplateBlockRegistry">
<argument type="collection" />
</service>

<service id="Sylius\Bundle\UiBundle\Renderer\TemplateBlockRendererInterface" class="Sylius\LegacyBridgePlugin\Renderer\TwigTemplateBlockRenderer">
<service id="Sylius\Bundle\UiBundle\Renderer\TemplateBlockRendererInterface" class="Sylius\LegacyShopBridgePlugin\Renderer\TwigTemplateBlockRenderer">
<argument type="service" id="twig" />
<argument type="tagged_iterator" tag="sylius.ui.template_event.context_provider" />
</service>

<service id="Sylius\Bundle\UiBundle\Renderer\TemplateEventRendererInterface" class="Sylius\LegacyBridgePlugin\Renderer\DelegatingTemplateEventRenderer">
<service id="Sylius\Bundle\UiBundle\Renderer\TemplateEventRendererInterface" class="Sylius\LegacyShopBridgePlugin\Renderer\DelegatingTemplateEventRenderer">
<argument type="service" id="Sylius\Bundle\UiBundle\Registry\TemplateBlockRegistryInterface" />
<argument type="service" id="Sylius\Bundle\UiBundle\Renderer\TemplateBlockRendererInterface" />
</service>
Expand Down
Loading