I have to many custom options on product page.
I would like to fill out the empty space on the left with a static block that appear only if more there is more than 4 custum options in product view.
I have to many custom options on product page.
I would like to fill out the empty space on the left with a static block that appear only if more there is more than 4 custum options in product view.
Step1: Display the static block content using
<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>
Step2: Add css to hide the static block container by default using
.css_class_of_container { display: none;}
Step3. Use javascript to show and hide the static block based on the number of custom options available.
in 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;?>