使用magento检查购物车属性

时间:2013-09-11 06:12:29

标签: magento

我成功获得了所有购物车的详细信息(即总物品,购物车中的物品等)。

但我只想购物车中的特定属性。 假设我想获得 store_id 属性,我该如何实现。

public function info($quoteId, $store = null)
    {
        $quote = $this->_getQuote($quoteId, $store);
        $result_attr = $this->_getAttributes($quote, 'quote');
       //this is giving error
        $result_attr->getAttributeText('store_id');
}

1 个答案:

答案 0 :(得分:0)

如果您在$quote

中获得了对象

你可以使用下面的代码

if($quote )
    $store = $quote->getStoreId();

希望这对您有所帮助。