从购物车中删除商品时,Magento 重定向到商店主页而不是 /checkout/cart/
我正在设置 Magento 1.4.2 购物车来替换旧版本 (1.1.6)。我目前正在开发机器上工作,当我的购物车中有多个商品并使用其中一个产品上的“删除”按钮时,该商品将被删除,并且我会通过 302 响应代码重定向到该产品的基本 URL商店,而不是“/checkout/cart/”(这是旧版本购物车的工作方式)。
我一直在试图找出导致此重定向的两个购物车之间的不同之处。关于我的设置的一些注释可能相关,也可能不相关:
- 有 2 个网站/商店/商店视图
- 我当前使用的商店视图是通过子 URL 和单独的 index.php 访问的文件。主要商店网址为 https://www.thestore.com/,我正在使用的商店可通过 https://www.thestore.com/second-store/ 访问索引.php/。如果您不熟悉这种方法,请参阅以下操作方法: 商店 旧的购物车(运行 1.1.6)在稍微不同的服务器设置上运行,您可以放心地假设设置中
- 一切皆有可能 - 例如,可以修改核心 Mage 代码。
我正在寻找任何关于在哪里查看的提示 - 通过管理面板进行 Magento 配置、local.xml 更改、Apache 重写规则...有关如何找出为什么这个新购物车没有重定向到 / 的任何提示store/checkout/cart/ 当我从购物车中删除产品时。
如果您需要更多详细信息,我很乐意提供。我们有一个真正被整合在一起的有点时髦的设置,如果听起来我们做错了什么,我也愿意接受关于如何设置的建议。谢谢!
I'm setting up a Magento 1.4.2 cart to replace an older version (1.1.6). I'm currently working on a development machine, and when I have multiple items in my cart and use the "delete" button on one of the products the item is removed and I am redirected via a 302 response code to the base URL of the store, instead of to '/checkout/cart/' (which is how the older version cart works).
I'm stuck trying to figure out what is different between the two carts that is causing this redirect. Some notes on my setup that may or may not be relevant:
- There are 2 websites/stores/store views
- The store view I'm currently working with is accessed via a sub-URL and separate index.php file. The main store URL is https://www.thestore.com/ and the store I'm working with is accessed at https://www.thestore.com/second-store/index.php/. If you're unfamiliar with this approach, here is how it is done: Store views by index.php
- The old cart (running 1.1.6) is running on a slightly different server setup, and you can safely assume anything is possible in the setup - modifications of core Mage code is possible, for example.
I'm looking for any hints on where to look - Magento configurations via the admin panel, local.xml changes, Apache rewrite rules...any tips on how to find out WHY this new cart isn't redirecting to /store/checkout/cart/ when I delete a product from my cart.
If you need more details, I'd be happy to provide them. We have a kinda funky setup that has been truly hacked together, and I'm also open to suggestions on how to set things up if it sounds like we're doing something wrong. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这可能是旧消息,但我在 2011 年 12 月的 magento 1.5.10 中也遇到了同样的问题。
我通过编辑 CartController.php 成功解决了这个
:
问题
替换
和
不要复制和粘贴此内容,请确保输入它,并在结帐/购物车周围使用单引号
This may be old news, but I had the same issue in magento 1.5.10 in December 2011.
and I successfully addressed it by editing
CartController.php:
in
replace
with
Don't copy and paste this, make sure you type it, and use single quotes around checkout/cart
如果您已经检查了 B00MER 建议的设置,那么我认为您的下一步需要是通过请求处理流程进行实时调试。阅读我的 之前的回答,了解有关设置 Magento 调试环境的一些指导。
该答案也相关,因为它涉及
CartController
中的updatePostAction
,在这种情况下负责的方法相同。if you've checked the setting that B00MER suggested, then I think that your next step needs to be to live debug your way through the request handling flow. Have a read of my previous answer for some pointers on getting your Magento debug environment setup.
That answer is also relevant because it involves the
updatePostAction
in theCartController
, the same method that is responsible in this situation.为了重写核心文件,我们需要创建一个模块并进行以下更改。
For rewriting the core file we need to create a module and make the following change.