Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
product / view.phtmlに、getChildHtml('my_block')?>という呼び出しがあります。これは、作成したphtmlファイルを出力します。そのファイルに商品画像を表示したいのですが、$ this-> getProduct()を呼び出すと、nullになります。製品(またはその他のデータ)を子ブロックに渡すにはどうすればよいですか?またはそれ以外の場合は利用可能にしますか?
現在製品表示ページを表示している場合は、現在の製品レジストリ値を使用することをお勧めします。これは、次のように$ this-> getProduct()の代わりにロードできます。
Mage::registry('current_product');