从Magento中的值获取自定义属性标签

从Magento中的值获取自定义属性标签,magento,Magento,我需要从它的值中获取一个自定义属性标签。我有下面的代码- $labels = $product->getAdwordsLabels(); $labels_array = explode(',', $labels); foreach($labels_array as $value) { $goog_labels .= "<g:adwords_labels>$value</g:adwords_labels>"; } return $goog_labels; $la

我需要从它的值中获取一个自定义属性标签。我有下面的代码-

$labels = $product->getAdwordsLabels();
$labels_array = explode(',', $labels);
foreach($labels_array as $value) {
  $goog_labels .= "<g:adwords_labels>$value</g:adwords_labels>";
}
return $goog_labels;
$labels=$product->getAdwordsLabels();
$labels_array=分解(',',$labels);
foreach($labels\u数组为$value){
$goog_标签=“$value”;
}
返回$goog_标签;
$value的值是属性的整数表示形式。我需要现在$value所在的属性的标签


怎么做?

如果我正确理解了你的问题,这应该可以:

    //$labels = $product->getAdwordsLabels();
    $labels = $product->getResource()->getAttribute("adwords_labels")->getStoreLabel();
    $labels_array = explode(',', $labels);
    foreach($labels_array as $value) {
      $goog_labels .= "<g:adwords_labels>$value</g:adwords_labels>";
    }
    return $goog_labels;
/$labels=$product->getAdwordsLabels();
$labels=$product->getResource()->getAttribute(“adwords_标签”)->getStoreLabel();
$labels_array=分解(',',$labels);
foreach($labels\u数组为$value){
$goog_标签=“$value”;
}
返回$goog_标签;

$product->getData('attribute_code');我使用这种格式-$this->getProduct()->getData('attribute_code');