Author Topic: Category browse page shows an error Sometimes  (Read 4172 times)

angmindy

  • Beginner
  • *
  • Posts: 1
Category browse page shows an error Sometimes
« on: May 02, 2008, 11:21:27 am »
Hi

I am currently using Joomla 1.5 and VM 1.1 to do my website. There are many categories and sub categories for my products. Although most of the category browsings are working fine, some of them show this error:

Fatal error: Call to a member function on a non-object in /var/www/html/miratech/components/com_virtuemart/themes/default/templates/browse/includes/browse_orderbyform.tpl.php on line 12

I have changed the layout of the browse page to my liking, and I am unsure if my changes caused this to happen. But the fact that only some of categories cause this error is troubling me. Here are my codes for components/com_virtuemart/themes/default/templates/browse/includes/browse_orderbyform.tpl.php:

Code: [Select]
<?php if( !defined'_VALID_MOS' ) && !defined'_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); ?>

<div>

<!-- ORDER BY .... FORM -->
<form action="<?php echo $mm_action_url."index.php" ?>" method="get" name="order">



<!-- CUSTOM -->
<table width="100%"><tr><td align="left"><br />
<?php $pagenav->writePagesCounter(); ?>
</td>
<td align="right"><br />
<!-- CUSTOM -->



<?php
if( !empty( $VM_BROWSE_ORDERBY_FIELDS )) {
echo $this->fetch_cache'browse/includes/browse_orderbyfields.tpl.php');

// This is the toggle button for Descending / Ascending Order
// It is wrapped into a JS function with a noscript area to keep it accessible
echo mm_writeWithJS('&nbsp;<input type="hidden" name="DescOrderBy" value="'.$asc_desc[0].'" /><a href="javascript: document.order.DescOrderBy.value=\''.$asc_desc[1].'\'; document.order.submit()"><img src="'$mosConfig_live_site."/images/M_images/$icon"  .'" border="0" alt="'$VM_LANG->_('PHPSHOP_PARAMETER_SEARCH_'.$asc_desc[0].'ENDING_ORDER') .'" title="'.$VM_LANG->_('PHPSHOP_PARAMETER_SEARCH_'.$asc_desc[0].'ENDING_ORDER') .'" width="12" height="12" /></a>',
      
'<select class="inputbox" name="DescOrderBy">
            <option '
.$selected[0].' value="DESC">'.$VM_LANG->_('PHPSHOP_PARAMETER_SEARCH_DESCENDING_ORDER').'</option>
            <option '
.$selected[1].' value="ASC">'.$VM_LANG->_('PHPSHOP_PARAMETER_SEARCH_ASCENDING_ORDER').'</option>
        </select>
        <input class="button" type="submit" value="'
.$VM_LANG->_('PHPSHOP_SUBMIT').'" />');
}
?>

    <input type="hidden" name="Itemid" value="<?php echo $Itemid ?>" />
    <input type="hidden" name="option" value="com_virtuemart" />
    <input type="hidden" name="page" value="shop.browse" />
    <input type="hidden" name="category_id" value="<?php echo $category_id ?>" />
    <input type="hidden" name="manufacturer_id" value="<?php echo $manufacturer_id ?>" />
    <input type="hidden" name="keyword" value="<?php echo $keyword ?>" />
    <input type="hidden" name="keyword1" value="<?php echo $keyword1 ?>" />
    <input type="hidden" name="keyword2" value="<?php echo $keyword2 ?>" />
<!-- IN BROWSE ORDER BY FORM PAGE-->
   
<?php

if( !empty( $product_type_id )) {
echo $ps_product_type->get_parameter_form($product_type_id);

}

if( 
$show_top_navigation ) {
?>

&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $VM_LANG->_('PN_DISPLAY_NR'?>&nbsp;&nbsp;

<?php $pagenav->writeLimitBox$search_string ); ?>
<noscript><input type="submit" value="<?php echo $VM_LANG->_('PHPSHOP_SUBMIT'?>" /></noscript>

    <!-- PAGE NAVIGATION AT THE TOP -->
    <br/>



<!-- CUSTOM -->
</td>
</tr>
<tr>
<td colspan="2"  align="center"><br />
<!-- CUSTOM -->



    <div style="text-align:center;"><?php 
     $pagenav->writePagesLinks$search_string );
      ?>

    </div>
   
<?php

}
?>




<!-- CUSTOM -->
</td></tr></table>
<!-- CUSTOM -->




</form>
</div>

I'm pretty new to PHP and Joomla. So I hope I'm not making some silly mistake here. Please enlighten me on this. Thank you in advance.