magento-1.9 – Display Simple Product Stock on Configurable Product

configurable-productmagento-1.9product-viewproductssimple-product

Im currently using Magento CE 1.9 and I want to display the individual stock quantities of all the simple products associated with the configurable product.

When you click the "Only X Left" message on the product page on the front end these products display as per /template/cataloginventory/stockqty/composite.phtml

However only the quantities are showing but the simple product titles are note displaying.

Can anyone suggest why the titles aren't displaying and how to fix this?

Also how can you get this table to display showing all the quantities to display without having to click on the message?

Best Answer

In the template

/template/cataloginventory/stockqty/composite.phtml

the table on line 35 got css-class "no-display":

<table id="<?php echo $this->getDetailsPlaceholderId() ?>" class="availability-only-details no-display">

override the template in your design and delete the "no-display" css-class... and then format the table to fit your needs. If you do, you can also remove the javscript at the bottom of the template-file from line 56 to 65

<script type="text/javascript">
//<![CDATA[
$('<?php echo $this->getPlaceholderId() ?>').observe('click', function(event){
    this.toggleClassName('expanded');
    $('<?php echo $this->getDetailsPlaceholderId() ?>').toggleClassName('no-display');
    event.stop();
    decorateTable('<?php echo $this->getDetailsPlaceholderId() ?>');
});
//]]>
</script>
Related Topic