答案 0 :(得分:0)
步骤1:使用
显示静态块内容<div class="css_class_of_container" id="ID_OF_THE_STATIC_BLOCK_CONTAINER">
<?php
echo Mage::getModel('cms/block')
->load('STATIC_BLOCK_IDENTIFIER')
->toHtml();
?>
</div>
步骤2:使用
添加css以默认隐藏静态块容器.css_class_of_container { display: none;}
步骤3。使用javascript根据可用的自定义选项数量显示和隐藏静态块。
app/design/package/theme/catalog/product/view/options.phtml
中的
<?php if (count($_options)):?>
<script type="text/javascript">
<?php if(count($_options) > 4):?>
//if you are using jquery
jQuery(document).ready(function(){
jQuery("#ID_OF_THE_STATIC_BLOCK_CONTAINER").show();
});
//if using native javascript
setTimeout('showhiddenStaticBlock()', 500);
function showHiddenStaticBlock() {
document.getElementById("ID_OF_THE_STATIC_BLOCK_CONTAINER").style.display = 'block';
}
<?php endif;?>
</script>
<?php endif;?>