المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : حل مشكلة اوبن كارت : Upgrade to 1.5.5.1 now Undefined variable: filter_name



Eng Amr Adel
13-09-2013, 19:36
I have a fast solution for this problem and will take you just 3 minutes to solve it.

Use Notepad++ to open the following files:

/catalog/view/theme/YOUR_THEME/template/common/header.tpl
Find A


<?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; ?>" onblur="if (this.value=='') this.value='<?php echo $text_search; ?>';" onfocus="if (this.value=='<?php echo $text_search; ?>') this.value='';">


<?php } ?>


Replace with help from the following file:
/catalog/view/theme/default/template/common/header.tpl

Replace Find A:



<input type="text" name="search" placeholder="<?php echo $text_search; ?>" value="<?php echo $search; ?>" />


NEXT

/catalog/view/theme/YOUR_THEME/template/product/search.tpl
Find 1:


<?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 $filter_name; ?>" onclick="this.value = '';" onkeydown="this.style.color = '000000'" style="color: #999;" />
<?php } ?>


FInd 2:



<?php if ($filter_sub_category) { ?>
<input type="checkbox" name="filter_sub_category" value="1" id="sub_category" checked="checked" />
<?php } else { ?>
<input type="checkbox" name="filter_sub_category" value="1" id="sub_category" />
<?php } ?>
<label for="sub_category"><?php echo $text_sub_category; ?></label>


Find 3:


<?php if ($filter_description) { ?>
<input type="checkbox" name="filter_description" value="1" id="description" checked="checked" />
<?php } else { ?>
<input type="checkbox" name="filter_description" value="1" id="description" />
<?php } ?>
<label for="description"><?php echo $entry_description; ?></label>


Replace each code, one by one, with help from following file:
/catalog/view/theme/default/template/product/search.tpl

Replace Find 1:



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


Replace Find 2:


<?php if ($sub_category) { ?>
<input type="checkbox" name="sub_category" value="1" id="sub_category" checked="checked" />
<?php } else { ?>
<input type="checkbox" name="sub_category" value="1" id="sub_category" />
<?php } ?>
<label for="sub_category"><?php echo $text_sub_category; ?></label>


Replace Find 3:


<?php if ($description) { ?>
<input type="checkbox" name="description" value="1" id="description" checked="checked" />
<?php } else { ?>
<input type="checkbox" name="description" value="1" id="description" />
<?php } ?>
<label for="description"><?php echo $entry_description; ?></label>






That's all.

http://forum.opencart.com/viewtopic.php?f=20&t=94230

This was tested with a 1.5.4.X theme on 1.5.5.1 Opencart installation and it's working properly.

All the best.