Magento Shipping Estimator - 不工作(空结果)

时间:2012-03-16 16:20:57

标签: magento

不确定它什么时候开始发生,但我在购物车页面上有一个运费估算工具无效。填写信息并单击“获取报价”后,页面将重新加载,但不会向用户显示任何送货方式......就好像表单是使用空白值提交的一样。表格指向:

checkout/cart/estimatePost

其内容为(在app / code / core / Mage / Checkout / controllers / CartController.php中):

    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();
}

我在这里添加了一个Mage :: log来检查请求:

$request = $this->getRequest()->getParams();
Mage::log($request, null, 'temp.log');

记录的数组完全为空。没有参数甚至到达这里。

我查看了表单本身,它与开发站点上的表单完全相同(工作正常)。所以问题不在于表单本身。

唯一合乎逻辑的结论是,另一个模块正在酝酿中。我已经检查了不同的模块来覆盖CartController.php,虽然有一些正在这样做,但它们都没有搞乱使用estimatePostAction()方法。

我有点困惑,有什么想法吗?

1 个答案:

答案 0 :(得分:4)

圣洁的烟雾。网站所有者必须更改服务器上的https:相关内容,因为我更改了表单的操作:

$this->getUrl('checkout/cart/estimatePost')

要:

$this->getUrl('checkout/cart/estimatePost', array('_secure'=>true))

它现在有效。