Magento查找结帐方法

时间:2012-12-27 09:21:41

标签: magento

如何查找checkout方法是“访客”还是“注册”。

getCheckoutMethod已被弃用。建议您使用它。

2 个答案:

答案 0 :(得分:1)

它被弃用的地方?最新的magento 1.7.0.2似乎使用它并定义它,并没有提及任何关于此方法的弃用

Mage::getSingleton('checkout/type_onepage')->getCheckoutMethod();

此方法在多个地方定义

grep ' getCheckoutMethod' app/code -rsn
app/code/core/Mage/Checkout/Model/Type/Onepage.php:165:    public function getCheckoutMethod()
app/code/core/Mage/Paypal/Model/Express/Checkout.php:661:    public function getCheckoutMethod() 

答案 1 :(得分:1)

getCheckoutMethod通过引用模型弃用,因此不推荐使用checkout_onepage模型。

/**
 * Return quote checkout method code
 *
 * @deprecated after 1.4 beta1 it is checkout module responsibility
 * @param boolean $originalMethod if true return defined method from begining
 * @return string
 */
public function getCheckoutMethod($originalMethod = false)
{
    if ($this->getCustomerId() && !$originalMethod) {
        return self::CHECKOUT_METHOD_LOGIN_IN;
    }
    return $this->_getData('checkout_method');
}