Powered by Blogger.

Fix Opencart Undefined variable: filter_name

After upgrading Opencart to a lot of themes will give an error “Undefined variable: filter_name” which will display on the search in the header. Luckily it is easy to fix by just simply doing a find and replace in the header.tpl file. To fix this error do the following.

Open the header.tpl file for your theme catalog/view/theme/NAME OF YOUR THEME/template/common/header.tpl

< ?php if ($filter_name) { ?>
    <input type="text" name="filter_name" value="<?php echo $filter_name; ?/>" />
    < ?php } else { ?>
    <input type="text" name="filter_name" value="<?php echo $text_search; ?/>" onclick="this.value = '';" onkeydown="this.style.color = '#000000';" />
    < ?php } ?>


<input type="text" name="search" placeholder="&lt;?php echo $text_search; ?/&gt;" value="&lt; ?php echo $search; ?&gt;" />
All fixed :) If this makes no sense to you then contact the developer of the theme to make the fix :~)
    Blogger Comment
    Facebook Comment