开发者

How to redirect Magento after some operation to an url passed in query string? Possible?

开发者 https://www.devze.com 2023-04-01 09:55 出处:网络
This Wiki article: Adding a Product to the Cart via Querystring describes how one can put product with specific id to the cart directly from querystring. So for simple product it would be something li

This Wiki article: Adding a Product to the Cart via Querystring describes how one can put product with specific id to the cart directly from querystring. So for simple product it would be something like this:

/path/to/app/checkout/cart/add?product=[id]&qty=[qty]

But开发者_运维百科 after it adds a product, Magento redirects browser to the home page and shows nice message that product has been added successfully. But we need to show a Shopping Cart directly, not a home page. So maybe it is possible to add another param to the querystring to achieve this?

I know I could write a module, but I just stumbled upon this possibility, so might be there is a way to easily redirect as well?


There a few things you could try before going the custom code route.

In the Admin UI you could make sure the redirect flag is correct.

URL: /admin/system_config/edit/section/checkout
Fieldset: Shopping Cart
Field: After Adding a Product Redirect to Shopping Cart

If that doesn't solve the problem, try this one.

/checkout/cart/add?product=[id]&qty=[qty]&in_cart=true
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号