Post by Yam » Fri Apr 13, 2012 8:30 pm

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.
Last edited by Yam on Mon Apr 16, 2012 11:17 am, edited 1 time in total.

Yam
New member

Posts

Joined
Fri Sep 30, 2011 8:59 pm

Post by cwswebdesign » Fri Apr 13, 2012 9:28 pm

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!


User avatar
Active Member

Posts

Joined
Sun Dec 11, 2011 12:26 am
Location - USA

Post by Yam » Sat Apr 14, 2012 7:20 am

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.

Yam
New member

Posts

Joined
Fri Sep 30, 2011 8:59 pm

Post by Yam » Sun Apr 15, 2012 8:43 am

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.

Yam
New member

Posts

Joined
Fri Sep 30, 2011 8:59 pm

Post by Avvici » Sun Apr 15, 2012 9:11 am

Send a link to your site please.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by Yam » Sun Apr 15, 2012 11:59 am

www.youngandmoodie.com.au
I'll turn the maintenance mode back off. Thanks, Craig.

Yam
New member

Posts

Joined
Fri Sep 30, 2011 8:59 pm

Post by MarketInSG » Sun Apr 15, 2012 12:34 pm

Edit header.tpl of your theme file. Add in the links the way you added previously, inside the menu div.


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by Yam » Sun Apr 15, 2012 12:48 pm

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.

Yam
New member

Posts

Joined
Fri Sep 30, 2011 8:59 pm

Post by Avvici » Sun Apr 15, 2012 1:25 pm

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

Code: Select all

$this->data['contact'] = $this->url->link('information/contact');

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by Yam » Sun Apr 15, 2012 4:37 pm

Hi, I tried that line of code but it just forced that address down under the menu bar and still did not navigate to the page.
Would I have needed to alter the tpl to information/contact as well? Thanks.

Yam
New member

Posts

Joined
Fri Sep 30, 2011 8:59 pm

Post by Yam » Sun Apr 15, 2012 4:44 pm

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>

Yam
New member

Posts

Joined
Fri Sep 30, 2011 8:59 pm

Post by MarketInSG » Sun Apr 15, 2012 7:57 pm

Have this in header!!!!

Code: Select all

$this->data['text_contact'] = $this->language->get('text_contact');
$this->data['contact'] = $this->url->link('information/contact');
And this in language!!

Code: Select all

$_['text_contact'] = 'Contact Us';


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by Yam » Mon Apr 16, 2012 4:18 am

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

Yam
New member

Posts

Joined
Fri Sep 30, 2011 8:59 pm

Post by Yam » Mon Apr 16, 2012 11:15 am

Update: The notice doesn't seem to coming up any more so thanks to all for your help, Craig.

Yam
New member

Posts

Joined
Fri Sep 30, 2011 8:59 pm

Post by jerdna » Wed Feb 06, 2013 10:20 pm

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

Newbie

Posts

Joined
Fri Nov 12, 2010 8:18 pm

Post by jerdna » Fri Feb 08, 2013 9:51 am

Juhu knolage please....help me....i want to know...i am learning ....i need soluttion....please...i wont give up...i am trying hard...every day...for you its a pice of cake...just direct me somewhare...give me a push start...

thnx

Newbie

Posts

Joined
Fri Nov 12, 2010 8:18 pm
Who is online

Users browsing this forum: No registered users and 20 guests