简体   繁体   English

从magento 1.7的可配置产品中获得选项?

[英]get options from configurable products in magento 1.7?

on my productpage i've two options. 在我的产品页面上,我有两个选择。 The length and the width of an product who can manually typed in. in my cart.php i want to know the length and the width. 可以在我的cart.php中手动输入的产品的长度和宽度。我想知道长度和宽度。 how can i get these two values? 我如何获得这两个值?

http://imageshack.us/photo/my-images/42/bildschirmfoto20130521u.png/ (Länge in mm = length, Breite in mm = width) http://imageshack.us/photo/my-images/42/bildschirmfoto20130521u.png/(Länge以毫米为单位=长度,Breite以毫米为单位=宽度)

Daniel 丹尼尔

you can fetch as below 您可以按以下方式获取

$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'color');  
foreach ($attribute->getSource()->getAllOptions(true) as $option) {
    echo $option['value'] . ' ' . $option['label'] . "\n";
}

with attribute 具有属性

for more understand please refer below Link 欲了解更多信息,请参考下面的链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM