表示する属性を指示する属性を作成しませんか?
最終的に、属性コード文字列であるグループ化された製品の2つのテキスト属性の値をロードするモジュールを作成しました。基本的に、その属性リスト文字列を分解し、ループして関連する製品属性データをロードするヘルパー。
私が私の属性を作成します。
grouped_attr_array
グループ化された製品の設計属性セットに属性を追加し、次にそれらを製品データのセミコロン区切りフィールドとして追加します。
torque_range;torque_increments;torque_accuracy
このコードを自分のモジュールからプルしました。これは、属性値に基づいてデフォルト属性のロードまたは非表示をさらに実行しており、モジュールはもう少し複雑です。しかし、表に示されているデータを取得するために、これらはコア関数の一部です。うまくいけば、上に構築するためのアイデアを提供します。これはmagento 1.9.2を使用しています
モジュールのヘルパー:
public function findAttributes($product, $attributes)
{
    //determined by attribute with id to add additional attributes to the table
    //string needs to be ; separated in ADMIN
    $strattributes = $product->getResource()->getAttribute('grouped_attr_array')->getFrontend()->getValue($product);
    if ($strattributes) {
        $strattributes = explode(';', $strattributes, 5);
        foreach ($strattributes as $additionAttribute) {
            //make sure these are valid attributes
            if ($product->getResource()->getAttribute($additionAttribute)) {
                array_push($attributes, $additionAttribute);
            }
        }
    }
}
public function groupedAttrDump($groupedProduct, $attributes)
{
    $cells = [];
    foreach ($attributes as $attrCode) {
        $attrText = $groupedProduct->getResource()->getAttribute($attrCode);
        if($attrText){
            array_push($cells, $attrText->getFrontend()->getValue($groupedProduct));
        }
    }
    return $cells;
}
public function groupedAttrHeaders($currentProduct, $attributes)
{
    $theads = [];
    foreach ($attributes as $attrCode) {
        $headerText = $currentProduct->getResource()->getAttribute($attrCode);
        if($headerText){
            $headerText = $headerText->getStoreLabel();
            array_push($theads,$headerText);
        }
    }
    return $theads;
}
groupedproduct.phtmlのヘルパーからデータを取得する
$attrrSetName = Mage::getModel("eav/entity_attribute_set")->load($_product->getAttributeSetId())->getAttributeSetName();
$tableAttributes = Mage::helper('groupedtable')->findAttributes($_product, $attrrSetName);
THの
     <?php foreach (Mage::helper('groupedtable')->groupedAttrHeaders($_product, $tableAttributes) as $attrLabel ): ?>
        <th><?php echo $attrLabel ?> </th>
     <?php endforeach; ?>
TDはテーブルです
<?php foreach (Mage::helper('groupedtable')->groupedAttrDump($_associatedProduct, $tableAttributes) as $attr ):?>
        <td><?php if($attr != 'No'){ echo $attr; } ?></td>
   <?php endforeach; ?>
ストアで使用可能な属性に基づいてその属性を選択する方法を構築したいと思います。多分これを行うにはもっと良い方法があるでしょう。まだそれに達していません。