1
votes

I want to call the "view.phtml" template in the tab "SPECIFICATION" (located in a static block), so that I can show a table of the grouped products.

Within that tab in the block content, I add following commands:

{{block type="catalog/product" template="catalog/product/view.phtml"}}

But nothing happens. I know the view.php located in catalog/product folder. Is there anything wrong with this command?

FYI, in the "view.phtml", there is only one setence:

<?php echo $this->getChildHtml('product_type_data') ?>

And below is my "grouped.phtml", which is nothing but a table:

<?php $this->setPreconfiguredValue(); ?>
<?php $_product = $this->getProduct(); ?>
<?php $_associatedProducts = $this->getAssociatedProducts(); ?>
<?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>
<?php echo $this->getChildHtml('product_type_data_extra') ?>
<div class="grouped-items-table-wrapper" style="border:0px;">
    <table class="data-table grouped-items-table" id="super-product-table" style="width:75%;margin-left:10px;">
        <tbody>
        <tr style="background-color:#091f36;color:white;">
                <td class="" colspan="2">
                    <p>
                        XCEL Part <br/>
                           No.
                    </p>
                </td>
                <td class="">
                    <p>
                        Fence <br/> H'
                    </p>
                </td>
                <td class="">
                    <p>
                        Fence <br/> W'
                    </p>
                </td>
                <td class="">
                    <p>
                        Fence<br/> H/mm 
                    </p>
                </td>
                <td class="">
                    <p>
                        Fence <br/>W/mm 
                    </p>
                </td>
                <td class="">
                    <p>
                        Pickets <br/>Qty.
                    </p>
                </td>
                <td class="">
                    <p>
                        Rails<br/> Qty. 
                    </p>
                </td>
                <td class="">
                    <p>
                        Rings<br/> Qty.
                    </p>
                </td>
                <td class="">
                    <p>
                        Panel <br/>LB 
                    </p>
                </td>
                <td class="">
                    <p>
                        Panel <br/>KG
                    </p>
                </td>
        </tr>
        <?php if ($_hasAssociatedProducts): ?>
        <?php foreach ($_associatedProducts as $_item): ?>
            <?php $_finalPriceInclTax = $this->helper('tax')->getPrice($_item, $_item->getFinalPrice(), true) ?>
            <tr>
                <td class="" colspan="2">
                    <p>
                        <?= $_item->getSKU() ?> 
                    </p>
                </td>
                <td class="">
                    <p>
                        <?= $_item->getAttributeText('height') ?> 
                    </p>
                </td>
                <td class="">
                    <p>
                        <?= $_item->getAttributeText('width') ?>
                    </p>
                </td>
                <td class="">
                    <p>
                        <?= $var=ceil(($_item->getAttributeText('height'))/0.0032808) ?> 
                    </p>
                </td>
                <td class="">
                    <p>
                        <?= $var=ceil(($_item->getAttributeText('width'))/0.0032808) ?> 
                    </p>
                </td>
                <td class="">
                    <p>
                        20
                    </p>
                </td>
                <td class="">
                    <p>
                        <?= $_item->getAttributeText('rail') ?> 
                    </p>
                </td>
                <td class="">
                    <p>
                        <?= $_item->getAttributeText('ring') ?> 
                    </p>
                </td>
                <td class="">
                    <p>
                        <?= $var=round($_item->getWeight(), 2) ?> 
                    </p>
                </td>
                <td class="">
                    <p>
                        <?= $var=round((($_item->getWeight())/2.2046),2) ?> 
                    </p>
                </td>

            </tr>
        <?php endforeach; ?>
        <?php else: ?>
           <tr>
               <td colspan="<?php if ($_product->isSaleable()): ?>4<?php else : ?>3<?php endif; ?>"><?php echo $this->__('No options of this product are available.') ?></td>
           </tr>
        <?php endif; ?>
        </tbody>
    </table>
</div>
<script type="text/javascript">decorateTable('super-product-table')</script>
1

1 Answers

1
votes
{{block type="catalog/product_view" template="catalog/product/view.phtml"}}

As you mention you have defined inside catalog->product->view->view.php

In your block type you have defined "catalog/product_view" so your view.php file should be inside catalog->product->view.php