merubah tampilan menu
Posted: Tue Mar 20, 2012 1:32 am
gan mau tanya dong cara merubah tampilan home agar bisa masuk ke halaman menu sih gmn gan...

OpenCart Community Forum - Discuss shopping cart and e-commerce solutions.
https://forum.opencart.com/
Code: Select all
<div id="menu">
<ul>
<li><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a></li> <--- tambahan
<?php foreach ($categories as $category) { ?>
<li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
Klo misal Main Menunya yg mau di tambahin "Cara Belanja" yg berasal dari Dasboard >> Catalog >> Information >> Cara Belanja.qahar wrote:Asumsinya menggunakan default opencart theme.
Sesuaikan header.tpl seperti code ini bro:Code: Select all
<div id="menu"> <ul> <li><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a></li> <--- tambahan <?php foreach ($categories as $category) { ?> <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
Code: Select all
<div id="menu">
<ul>
<li><a href="<?php echo $informations[x]['href']; ?>"><?php echo $text_informations[x]['title']; ?></a></li> <--- x adalah no urut informasi yg bersangkutan.
<li><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a></li> <--- tambahan
<?php foreach ($categories as $category) { ?>
<li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
Code: Select all
$this->load->model('catalog/information');
$this->data['informations'] = array();
foreach ($this->model_catalog_information->getInformations() as $result) {
$this->data['informations'][] = array(
'title' => $result['title'],
'href' => $this->url->link('information/information', 'information_id=' . $result['information_id'])
);
}
Permisi gan, saya udah ubah codenya seperti diatas tapi kenapa ya gak ada perubahan di theme saya..qahar wrote:Asumsinya menggunakan default opencart theme.
Sesuaikan header.tpl seperti code ini bro:Code: Select all
<div id="menu"> <ul> <li><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a></li> <--- tambahan <?php foreach ($categories as $category) { ?> <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
Klo bertanya seharusnya, menyertakan OC versi berapa yang dipakai? Theme apa yang digunakan?novaip wrote:Permisi gan, saya udah ubah codenya seperti diatas tapi kenapa ya gak ada perubahan di theme saya..qahar wrote:Asumsinya menggunakan default opencart theme.
Sesuaikan header.tpl seperti code ini bro:Code: Select all
<div id="menu"> <ul> <li><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a></li> <--- tambahan <?php foreach ($categories as $category) { ?> <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
mohon bantuannya.. thanks....
maaf gan, saya lupa menyertakan versi oc nya...sa1638 wrote:Klo bertanya seharusnya, menyertakan OC versi berapa yang dipakai? Theme apa yang digunakan?novaip wrote:Permisi gan, saya udah ubah codenya seperti diatas tapi kenapa ya gak ada perubahan di theme saya..qahar wrote:Asumsinya menggunakan default opencart theme.
Sesuaikan header.tpl seperti code ini bro:Code: Select all
<div id="menu"> <ul> <li><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a></li> <--- tambahan <?php foreach ($categories as $category) { ?> <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
mohon bantuannya.. thanks....
Itu agan menambahkan code seperti itu di file apa? jangan2 menambahkannya di file header.tpl dari theme default, sedangkan theme yang agan gunakan bukan theme default.
saya udah nerapinnya & work 100%gangsar.swapurba wrote:coba pakai ini:
tapi sebelumnya tambahkan kode di bawah ini dulu di /catalog/controller/common/header.php:Code: Select all
<div id="menu"> <ul> <li><a href="<?php echo $informations[x]['href']; ?>"><?php echo $text_informations[x]['title']; ?></a></li> <--- x adalah no urut informasi yg bersangkutan. <li><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a></li> <--- tambahan <?php foreach ($categories as $category) { ?> <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
Code: Select all
$this->load->model('catalog/information'); $this->data['informations'] = array(); foreach ($this->model_catalog_information->getInformations() as $result) { $this->data['informations'][] = array( 'title' => $result['title'], 'href' => $this->url->link('information/information', 'information_id=' . $result['information_id']) ); }