Magento-从$ item获取产品选项 [英] Magento - Get Product options from $item
本文介绍了Magento-从$ item获取产品选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在购物车页面上,有以下foreach循环:
On the cart page there's the following foreach loop:
foreach($this->getItems() as $_item) {
}
我需要获取这些产品的产品选项,我尝试了几种方法,但无法检索所需的结果.
I need to get the product options for these items, I've tried a few methods but I'm unable to retrieve the results I need.
我尝试过:
foreach($this->getItems() as $_item) {
print_r($_item->getProductOptions());
}
并且:
foreach($this->getItems() as $_item) {
print_r($_item->getOptionList());
}
我还能使用其他功能吗?
Are there any other functions I could use?
推荐答案
尝试使用:
$_item->getProduct()->getTypeInstance(true)->getOrderOptions($_item->getProduct());
这篇关于Magento-从$ item获取产品选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文