0

I wish to copy this content :

app\design\frontend\base\default\template\catalog\navigation\left.phtl

<?php if (!Mage::registry('current_category')) return ?>
<?php $_categories = $this->getCurrentChildCategories() ?>
<?php $_count = is_array($_categories)?count($_categories):$_categories->count(); ?>
<?php if($_count): ?>
<div class="block block-layered-nav">
    <div class="block-title">
        <strong><span><?php echo $this->__('Browse By') ?></span></strong>
    </div>
    <div class="block-content">
        <dl id="narrow-by-list2">
            <dt><?php echo $this->__('Category') ?></dt>
            <dd>
                <ol>
                <?php foreach ($_categories as $_category): ?>
                    <?php if($_category->getIsActive()): ?>
                    <li>
                        <a href="<?php echo $this->getCategoryUrl($_category) ?>"<?php if ($this->isCategoryActive($_category)): ?> class="current"<?php endif; ?>><?php echo $this->escapeHtml($_category->getName()) ?></a> (<?php echo $_category->getProductCount() ?>)
                    </li>
                    <?php endif; ?>
                <?php endforeach ?>
                </ol>
            </dd>
        </dl>
        <script type="text/javascript">decorateDataList('narrow-by-list2')</script>
    </div>
</div>
<?php endif; ?>

In my custom toolbar :

app\design\frontend\mytheme\default\template\catalog\product\list\toolbar.phtml

But I getting fatal error:

Fatal error: Call to a member function count() on a non-object in app\design\frontend\mytheme\default\template\catalog\product\list\toolbar.phtml

Thanks for your help.

0

To get all content of template file
app\design\frontend\base\default\template\catalog\navigation\left.phtml
inside
app\design\frontend\mytheme\default\template\catalog\product\list\toolbar.phtml
in your template use
echo $this->getLayout()->createBlock('catalog/navigation')->setTemplate('catalog/navigation/left.phtml')->toHtml();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.