You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Option B: If you HAVE already overridden Order/OrderItem controllers in your project**
83
+
84
+
Add the appropriate traits to your existing controllers:
85
+
86
+
```php
87
+
// src/Controller/OrderController.php
88
+
namespace App\Controller;
89
+
90
+
use Sylius\LegacyBridgePlugin\Controller\Trait\OrderTrait;
91
+
92
+
class OrderController extends \Sylius\Bundle\CoreBundle\Controller\OrderController
93
+
{
94
+
use OrderTrait; // Adds: widgetAction(), clearAction()
95
+
96
+
// ... your existing custom methods
97
+
}
98
+
```
99
+
100
+
```php
101
+
// src/Controller/OrderItemController.php
102
+
namespace App\Controller;
103
+
104
+
use Sylius\Bundle\ResourceBundle\Controller\ResourceController;
105
+
use Sylius\LegacyBridgePlugin\Controller\Trait\OrderItemTrait;
106
+
107
+
class OrderItemController extends ResourceController
108
+
{
109
+
use OrderItemTrait; // Adds: addAction(), removeAction() and helper methods
110
+
111
+
// ... your existing custom methods
112
+
}
113
+
```
114
+
115
+
### 4. Update UI Configuration
64
116
65
117
Replace `sylius_ui` configuration with `sylius_legacy_bridge` in your `config/packages/sylius_ui.yaml` (or wherever your UI events are configured):
66
118
@@ -76,7 +128,7 @@ sylius_legacy_bridge:
76
128
# ...
77
129
```
78
130
79
-
### 4. Configure Twig Paths
131
+
### 5. Configure Twig Paths
80
132
81
133
Add the following Twig paths configuration to your `config/packages/twig.yaml`:
82
134
@@ -94,7 +146,7 @@ twig:
94
146
95
147
**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.
96
148
97
-
### 5. Add Routes
149
+
### 6. Add Routes
98
150
99
151
Add the plugin routes to your `config/routes.yaml` file. **Important:** These routes must be loaded after the shop routes:
0 commit comments