Skip to content

Commit

Permalink
Extend README with the Sylius routes to overwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
shochdoerfer committed Dec 28, 2023
1 parent 7455e15 commit 1bf41e1
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,43 @@ imports:
```yaml
brille24_customer_options:
resource: "@Brille24SyliusCustomerOptionsPlugin/Resources/config/app/routing.yml"
sylius_shop_ajax_cart_add_item:
path: ajax/cart/add
methods: [POST]
defaults:
_controller: sylius.controller.order_item::addAction
_format: json
_sylius:
factory:
method: createForProductWithCustomerOption
arguments: [expr:notFoundOnNull(service('sylius.repository.product').find($productId))]
form:
type: Sylius\Bundle\CoreBundle\Form\Type\Order\AddToCartType
options:
product: expr:notFoundOnNull(service('sylius.repository.product').find($productId))
redirect:
route: sylius_shop_cart_summary
parameters: {}
flash: sylius.cart.add_item
sylius_shop_partial_cart_add_item:
path: cart/add-item
methods: [GET]
defaults:
_controller: sylius.controller.order_item::addAction
_sylius:
template: $template
factory:
method: createForProductWithCustomerOption
arguments: [expr:notFoundOnNull(service('sylius.repository.product').find($productId))]
form:
type: Sylius\Bundle\CoreBundle\Form\Type\Order\AddToCartType
options:
product: expr:notFoundOnNull(service('sylius.repository.product').find($productId))
redirect:
route: sylius_shop_cart_summary
parameters: {}
```

* Copy the template overrides from the plugin directory
Expand Down

0 comments on commit 1bf41e1

Please sign in to comment.