Archive for Maret 2015

cara memperbaiki kode Notice: Undefined variable: search.tpl

solusi cepat untuk masalah ini dan akan membawa Anda hanya 3 menit untuk menyelesaikannya.

Gunakan Notepad ++ untuk membuka file-file berikut:

/catalog/view/theme/YOUR_THEME/template/common/header.tpl
Cari A:

Kode: Pilih semua
    <?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 } ?>



Ganti dengan bantuan dari file berikut:
/catalog/view/theme/default/template/common/header.tpl

Ganti Cari A:

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



BERIKUTNYA

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

Kode: Pilih semua
    <?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 } ?>



Cari 2:

Kode: Pilih semua
    <?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>



Cari 3:

Kode: Pilih semua
    <?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>



Ganti setiap kode, satu per satu, dengan bantuan dari file berikut:
/catalog/view/theme/default/template/product/search.tpl

Ganti Cari 1:

Kode: Pilih semua
    <?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 } ?>



Ganti Cari 2:

Kode: Pilih semua
    <?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>



Ganti Temukan 3:

Kode: Pilih semua
    <?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>



Itu saja.

Hal ini diuji dengan tema 1.5.4.X pada 1.5.5.1 instalasi OpenCart dan itu bekerja dengan baik.

cara memperbaiki kode Notice: Undefined variable: filter_name di opencart

Baru coba upload theme di Opencart dan terdapat error :
Notice: Undefined variable: filter_name in C:\xampp\htdocs\webku\catalog\view\theme\beautyshop\template\common\ header.tpl on line 447



Itu karena pake themes versi 1.5.4.1 sedangkan OC-nya pake versi 1.5.5.1


Cari tulisan ini di header.tpl:

Code:
            <?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; ?>">                             

            <?php } ?>



Replace dg:

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

zismy. Diberdayakan oleh Blogger.