2012-01-31 54 views
1

在功能如何從結帳/車優惠super_attribute

$cart = Mage::getModel('checkout/cart')->getQuote(); 
foreach ($cart->getItems() as $item) { 
    $productId = $item->getProduct()->getId(); 
    $productPrice = $item->getProduct()->getPrice(); 
} 

我可以讓

$product_id = $item->getProduct()->getId();/product 
$quote_id = $item->getId();/cart 
$quote_qty = $item->getQty();/cart 

但是,我怎麼可以從$項目獲得super_attribute

http://i.stack.imgur.com/79sXX.png

我想獲得Url的Supper_attribute checkout/cart/add/produc噸/ $的productId /?super_attribute [attribute_ID] = option_ID &qty; = $ quote_qty

感謝。

回答

0

你嘗試:

$super_attribute = $item->getProduct()->getSuperAttribute(); 
+0

的print_r($ super_attribute);是返回** 1 ** – meteew 2012-01-31 16:13:46