3
不知道什么时候开始发生,但我的购物车网页上有一个运送估算器不工作。填写信息并点击“获取报价”后,页面将重新加载,但不向用户显示任何运输方式......就好像表单提交时为空白值一样。形式分:Magento Shipping Estimator - 不工作(空的结果)
public function estimatePostAction()
{
$country = (string) $this->getRequest()->getParam('country_id');
$postcode = (string) $this->getRequest()->getParam('estimate_postcode');
$city = (string) $this->getRequest()->getParam('estimate_city');
$regionId = (string) $this->getRequest()->getParam('region_id');
$region = (string) $this->getRequest()->getParam('region');
$this->_getQuote()->getShippingAddress()
->setCountryId($country)
->setCity($city)
->setPostcode($postcode)
->setRegionId($regionId)
->setRegion($region)
->setCollectShippingRates(true);
$this->_getQuote()->save();
$this->_goBack();
}
我添加了一个法师::日志:
checkout/cart/estimatePost
这些都(在应用程序/代码/核心/法师/结帐/控制器/ CartController.php)的内容这里检查请求:
$request = $this->getRequest()->getParams();
Mage::log($request, null, 'temp.log');
被记录的数组是完全空的。没有参数甚至到达这里。
我看了一下表格本身,它和开发网站上的表单完全一样(工作正常)。所以问题不在于形式本身。
唯一真正合乎逻辑的结论是,另一个模块正在把事情搞砸。我已经通过重写CartController.php的不同模块进行了检查,虽然有一些正在这样做,但他们没有一个正在搞乱guessPostAction()方法。
我有点困惑,有什么想法?
你的意思是你添加'array('_ secure'=> true)否则PHP会为' - >'引发一个'意外的T_OBJECT_OPERATOR'错误) – Jongosi 2015-02-05 22:39:17
固定。更好?? – pspahn 2015-02-05 23:26:56
就是这样:)解决方案中的+1,thx。 – Jongosi 2015-02-06 08:43:33