Skip to content

Commit 1b3ccf1

Browse files
committed
Update readme
1 parent 50df578 commit 1b3ccf1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,27 @@ npm run build
302302
yarn build
303303
```
304304

305+
### 12. Update Twig Templates
306+
307+
When migrating legacy templates, you need to update certain Twig function calls and menu names:
308+
309+
**Menu name changes:**
310+
311+
```twig
312+
{# Before #}
313+
{{ knp_menu_render('sylius.shop.account', ...) }}
314+
315+
{# After #}
316+
{{ knp_menu_render('sylius_shop.account', ...) }}
317+
```
318+
319+
**Twig function replacements:**
320+
321+
| Before | After |
322+
|------------------------------------------|----------------------------------------|
323+
| `sylius_order_items_subtotal(order)` | `order.getItemsSubtotal()` |
324+
| `sylius_product_variant_prices(product)` | `sylius_product_variants_map(product)` |
325+
305326
## Usage
306327

307328
Once installed and configured, the plugin will provide legacy compatibility for older Sylius templates and functionality, allowing you to gradually migrate to modern Sylius features.

0 commit comments

Comments
 (0)