I have had to re-do my site after trying to upgrade from 1.5.1 to 1.5.2.1. I had made backups but they had timing conflicts which I couldn't get around. Decided just to start from scratch as I've been in development stage for quite some time now.
Issue I am having is getting a top menu button back like before that someone else had set up for me. The button is to be able to switch back and forth between the default(public) and wholesale site. The code that was in the old Header tpl doesn't work and just makes the site go blank. I managed to work out ways of getting my 'Contact' and 'About Us' into the top menu but need some extra help with this one. Code originally used was
<li><a href="http://wholesale.youngandmoodie.com.au/"><?php echo $text_wholesale;?></a></li>
<?php } else { ?>
<li><a href="http://www.youngandmoodie.com.au/"><?php echo $text_public;?></a></li>
<?php } ?>
I have duplicated and renamed the default/template/common/header tpl which is where I'm attempting to place this. Other alterations in this header tpl are all working.
Thanks, Craig.
Issue I am having is getting a top menu button back like before that someone else had set up for me. The button is to be able to switch back and forth between the default(public) and wholesale site. The code that was in the old Header tpl doesn't work and just makes the site go blank. I managed to work out ways of getting my 'Contact' and 'About Us' into the top menu but need some extra help with this one. Code originally used was
<li><a href="http://wholesale.youngandmoodie.com.au/"><?php echo $text_wholesale;?></a></li>
<?php } else { ?>
<li><a href="http://www.youngandmoodie.com.au/"><?php echo $text_public;?></a></li>
<?php } ?>
I have duplicated and renamed the default/template/common/header tpl which is where I'm attempting to place this. Other alterations in this header tpl are all working.
Thanks, Craig.
Last edited by Yam on Mon Apr 16, 2012 11:17 am, edited 1 time in total.
You're trying to add these two links into the standard navigation bar?
This account is inactive. Look for us under the name 'EvolveWebHosting' and contact us under that username.
Thanks!
I'm trying to have them in the top menu, where the product categories are and where I have placed my 'About Us', 'Contact'. The way it was set up before was when a visitor was in the default(public) site, the text button read 'Wholesale' and if clicked was directed to the wholesale site. When the visitor was in the the wholesale(subdomain) site, the button read 'Public' and when clicked would return to the public(default) site.
I found a vqmod to add an option to put info pages in top menu which is how I got the 'About Us' up there and found a line to put into the header tpl that got the 'Contact' up there again. I think the 'Contact button isn't quite right though since testing from clicking within the wholesale site actually takes the user back to the default Contact page. Would like to this sorted as well. Any advice is appreciated, Craig.
I found a vqmod to add an option to put info pages in top menu which is how I got the 'About Us' up there and found a line to put into the header tpl that got the 'Contact' up there again. I think the 'Contact button isn't quite right though since testing from clicking within the wholesale site actually takes the user back to the default Contact page. Would like to this sorted as well. Any advice is appreciated, Craig.
Ok. So I have read up how to get the 'wholesale', 'public' buttons working by adding their text info into controller/common/ header php and language/common/header php. This has worked but from what I'm aware is that if updating opencart, these will get overwritten. Is there a vqmod that could be easily adjusted to input these variables?
I also tried to re-do the contact button with the same process which has placed the button in the menu but gives a page not found error. Any ideas? Craig.
I also tried to re-do the contact button with the same process which has placed the button in the menu but gives a page not found error. Any ideas? Craig.
Edit header.tpl of your theme file. Add in the links the way you added previously, inside the menu div.
This is what I currently have in my header tpl.
<li><a href="<?php echo $contact; ?>"><?php echo $text_contact;?></a></li>
<?php if($base == 'http://www.youngandmoodie.com.au/'){ ?>
<li><a href="http://wholesale.youngandmoodie.com.au/"><?php echo $text_wholesale;?></a></li>
<?php } else { ?>
<li><a href="http://www.youngandmoodie.com.au/"><?php echo $text_public;?></a></li>
The wholesale and public buttons are working perfectly now since adding the text info as described in the other reply. The Contact button is showing but when clicked gives a page not found error.
I was wanting to know how to make these buttons work and not lose the changes after opencart updating. Thanks, Craig.
<li><a href="<?php echo $contact; ?>"><?php echo $text_contact;?></a></li>
<?php if($base == 'http://www.youngandmoodie.com.au/'){ ?>
<li><a href="http://wholesale.youngandmoodie.com.au/"><?php echo $text_wholesale;?></a></li>
<?php } else { ?>
<li><a href="http://www.youngandmoodie.com.au/"><?php echo $text_public;?></a></li>
The wholesale and public buttons are working perfectly now since adding the text info as described in the other reply. The Contact button is showing but when clicked gives a page not found error.
I was wanting to know how to make these buttons work and not lose the changes after opencart updating. Thanks, Craig.
That's because $contact is an undefined variable. You need to go to the control file and check to make sure you have the correct variable in place.
There needs to be this line somewhere in the function index() of header.php
There needs to be this line somewhere in the function index() of header.php
Code: Select all
$this->data['contact'] = $this->url->link('information/contact');
This is what I have in my controller header php
$this->data['text_contact'] = $this->language->get('Contact');
This is what I have in my language header php
$_['text_contact'] = 'Contact Us';
This is what I have in my theme header tpl
<li><a href="<?php echo $contact; ?>"><?php echo $text_contact;?></a></li>
<?php if($base == 'http://www.youngandmoodie.com.au/'){ ?>
<li><a href="http://wholesale.youngandmoodie.com.au/"><?php echo $text_wholesale;?></a></li>
<?php } else { ?>
<li><a href="http://www.youngandmoodie.com.au/"><?php echo $text_public;?></a></li>
$this->data['text_contact'] = $this->language->get('Contact');
This is what I have in my language header php
$_['text_contact'] = 'Contact Us';
This is what I have in my theme header tpl
<li><a href="<?php echo $contact; ?>"><?php echo $text_contact;?></a></li>
<?php if($base == 'http://www.youngandmoodie.com.au/'){ ?>
<li><a href="http://wholesale.youngandmoodie.com.au/"><?php echo $text_wholesale;?></a></li>
<?php } else { ?>
<li><a href="http://www.youngandmoodie.com.au/"><?php echo $text_public;?></a></li>
Have this in header!!!!
And this in language!!
Code: Select all
$this->data['text_contact'] = $this->language->get('text_contact');
$this->data['contact'] = $this->url->link('information/contact');
Code: Select all
$_['text_contact'] = 'Contact Us';
Thanks for that. It's working now on both sites but does give a notice when clicked within the wholesale( subdomain)
2011-09-23 13:26:19 - PHP Notice: session_start(): ps_files_cleanup_dir: opendir(/var/lib/php/session) failed: Permission denied (13) in /var/www/vhosts/youngandmoodie.com.au/httpdocs/system/library/session.php on line 11
2011-09-23 13:26:19 - PHP Notice: session_start(): ps_files_cleanup_dir: opendir(/var/lib/php/session) failed: Permission denied (13) in /var/www/vhosts/youngandmoodie.com.au/httpdocs/system/library/session.php on line 11
Hi there, old topic i know but i didnt find anything similar on google so im asking here?
exactly the thing i need......and i did it like you did but i get blank screan.....Somebothy have any idea maybe how to code this php thing for OC 1.5.4.1...shoppica 2 instaled.
Whith out php it is working but i have two buttons on each site
I need just the linking button on both sites domain and sub domain!
please i need this thing badly and im weri close to it.
Thanx
exactly the thing i need......and i did it like you did but i get blank screan.....Somebothy have any idea maybe how to code this php thing for OC 1.5.4.1...shoppica 2 instaled.
Whith out php it is working but i have two buttons on each site
I need just the linking button on both sites domain and sub domain!
please i need this thing badly and im weri close to it.
Thanx
Who is online
Users browsing this forum: Amazon [Bot] and 37 guests