Magento に複数選択属性がある可能性はありますか? そのために、複数選択のすべてのアイテムを表示する代わりに、レイヤード ナビゲーションでテキスト ボックスを使用しますか?
何百ものオプションがあり、階層化されたナビゲーションで使用する必要がある属性があります。
お客様が無効な値を使用すると、エラーが表示されます。
編集: FlorinelChis の助けを借りて、filter.phtml に次のコードがあります。
<ol>
<?php foreach ($this->getItems() as $_item): ?>
<?php
$attributeModel = $this->getAttributeModel();
$attribute_code = $attributeModel->getAttributeCode();
?>
<li>
<?php if ($attribute_code != 'available_zip'): ?>
<?php if ($_item->getCount() > 0): ?>
<a href="<?php echo $this->urlEscape($_item->getUrl()) ?>"><?php echo $_item->getLabel() ?></a>
<?php else: echo $_item->getLabel() ?>
<?php endif; ?>
<?php if ($this->shouldDisplayProductCount()): ?>
(<?php echo $_item->getCount() ?>)
<?php endif; ?>
<?php endif; ?>
</li>
<?php endforeach ?>
</ol>
<?php
if ($attribute_code == 'available_zip'):
$cat = Mage::registry('current_category')->getUrlPath() ;
$url = Mage::getBaseUrl();
/*$sendUrl = $this->urlEscape($_item->getUrl()).'+'.$url.$cat.'?'.$attribute_code.'='.$_item->getValue();*/
echo '<form action="" method="get">';
echo '<input type="text" size="5" maxlength="5" name="'.$attribute_code.'" />';
echo '<button type="submit">OK</button>';
echo '</form>';
endif; ?>
もう 1 つ、値の代わりに属性 ID を使用してフォームを送信する方法を教えてください。