構成可能な製品は、オプションのないオプションボックスを表示します

magento.stackexchange https://magento.stackexchange.com/questions/3196

  •  16-10-2019
  •  | 
  •  

質問

以下は、2つの簡単な製品を正しく関連付けている私の構成可能な製品のスクリーンショットです。

enter image description here

構成可能な製品が表示され(カタログ/検索)、単純な製品は個別に表示されません。

設定可能な製品を表示すると、「Select Size」オプションが表示されますが、何らかの理由でオプションがありません。

以下はスクリーンショットです:

enter image description here

何がこれを引き起こしているのか誰もが考えていますか?

コアファイルを編集またはオーバーライドしていませんが、configurable.phtmlのforeachループによってオプションが入力されていることに気付きました

コードは以下に含まれています(Frontend/base/default/template/catalog/catalog/vise/view/options/configurable.phtml)

<?php
$_product    = $this->getProduct();
$_attributes = Mage::helper('core')->decorateArray($this->getAllowAttributes());
?>
<?php if ($_product->isSaleable() && count($_attributes)):?>
    <dl>
    <?php foreach($_attributes as $_attribute): ?>
        <dt><label class="required"><em>*</em><?php echo $_attribute->getLabel() ?></label></dt>
        <dd<?php if ($_attribute->decoratedIsLast){?> class="last"<?php }?>>
            <div class="input-box">
                <select name="super_attribute[<?php echo $_attribute->getAttributeId() ?>]" id="attribute<?php echo $_attribute->getAttributeId() ?>" class="required-entry super-attribute-select">
                    <option><?php echo $this->__('Choose an Option...') ?></option>
                  </select>
              </div>
        </dd>
    <?php endforeach; ?>
    </dl>
    <script type="text/javascript">
        var spConfig = new Product.Config(<?php echo $this->getJsonConfig() ?>);
    </script>
<?php endif;?>

アップデート:

私はこの問題をデバッグしようとしましたが、独自のデザインテーマを備えた別のストアビューで、構成可能な製品が正常に機能したことに気付きました。また、元のデザインテーマでは、カートへの追加ボタンが機能しないことに気付きました。私はおそらくいくつかのJavaScriptが干渉しており、私のすべての外部JSスクリプトを含むlocal.xmlファイルを削除した後、すべてが正常に機能しました。さて...具体的に何がエラーを引き起こしているのかを把握します。

役に立ちましたか?

解決

問題は、競合モードなしでjqueryを追加したことです。

私のlocal.xmlコードは次のとおりです。

<reference name="head">
        <block type="core/text" name="jquery.cdn.google">
            <action method="setText">
                <text><![CDATA[<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>]]></text>
            </action>
        </block>
        <block type="core/text" name="google.jquery.noconflict" after="google.jquery">
            <action method="setText">
                <text><![CDATA[<script type="text/javascript">var $j = jQuery.noConflict(); </script>]]></text>
            </action>
        </block>

        .... 

これが誰かを助けることを願っています!

ライセンス: CC-BY-SA帰属
所属していません magento.stackexchange
scroll top