How to Stay on Product Page After Adding to Cart
Understanding the Default Behavior
Property
Default Value
Description
Overriding the Redirect
# config/packages/twig_hooks/product/show.yaml
sylius_twig_hooks:
hooks:
'sylius_shop.product.show.content.info.summary':
add_to_cart:
component: 'sylius_shop:product:add_to_cart_form'
props:
product: '@=_context.product'
template: '@SyliusShop/product/show/content/info/summary/add_to_cart.html.twig'
routeName: 'sylius_shop_product_show'
routeParameters:
slug: '@=_context.product.getTranslation().getSlug()'
priority: 100Last updated
Was this helpful?
