Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding a link to a new page in 'Store Information' box


Guest

Recommended Posts

I'm trying to add a new "Links" page to my website, but I can't figure out how to insert a new category into my Store Information box. Any help would be appreciated.

Link to comment
Share on other sites

/catalog/includes/boxes/information.php

 

$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .
									 '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' .
									 '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
									 '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>');

 

Add your link amongst those ... MAKE SURE U USE THE tep_href_link FUNCTION WHEN LINKING TO INTERNAL PAGES TO ENSURE SESSIONS ARE NOT LOST WHILE BROWSING YOUR SITE!!

Link to comment
Share on other sites

Thanks for the help. I tried to add a new link, but I got an error message after I completed it...then I went to try and change everything back to the way it was and I'm still getting an error message...HELP!

 

Here's my code...what's wrong?

 

'</a>')

  $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_ABOUT) . '">' . BOX_INFORMATION_ABOUT . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_FAQ) . '">' . BOX_INFORMATION_FAQ . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>')

Link to comment
Share on other sites

Have you defined FILENAME_FAQ and FILENAME_ABOUT in /catalog/includes/filenames.php ... also have you defined BOX_INFORMATION_ABOUT and BOX_INFORMATION_FAQ in /catalog/includes/languages/english.php ??

 

Your missing a semicolon after your last link: '</a>'); should be at the end

Link to comment
Share on other sites

Yes they've all been defined....those pages were added a while ago...I'm just trying to add one extra page.

 

This is the error I'm getting right now:

 

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/content/b/u/r/burningmoon/html/includes/boxes/information.php on line 29

Link to comment
Share on other sites

shoe your code. you are missing a } or something else.

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

Yes they've all been defined....those pages were added a while ago...I'm just trying to add one extra page.

 

This is the error I'm getting right now:

 

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/content/b/u/r/burningmoon/html/includes/boxes/information.php on line 29

 

Did you add that semicolon??

 

should look like this:

 

$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_ABOUT) . '">' . BOX_INFORMATION_ABOUT . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_FAQ) . '">' . BOX_INFORMATION_FAQ . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>');

Link to comment
Share on other sites

Ok, so I got everything working properly and even got the new link inserted in the box. But, now when I click on the link it is saying "page not found". Do I have to actually define a new page for this? If so how....

Link to comment
Share on other sites

yea. otherwise how would your website know where to go. There is no page called FILENAME_CONTACT_US, but there is one called contact_us.php. If you go to catalog/includes/filenames/ you will see all of them/

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

How do I get this link/page into the list of define content items? How do I get the link in the store information box to link to an actual page??

 

All you need to do is define the page in filenames (/catalog/includes/filenames.php) like so:

 

Find: define('FILENAME_ACCOUNT', 'account.php');

Directly about it add: define('FILENAME_ABOUT', 'about.php');

 

So it should read like this:

 

// define the filenames used in the project
 define('FILENAME_ABOUT', 'about.php');
 define('FILENAME_ACCOUNT', 'account.php');

 

This will define the page about.php so now u can reference this page by using FILENAME_ABOUT ... anytime PHP see's FILENAME_ABOUT it will know this means about.php - Please note I used about.php as an example...you can use ANYTHING you like aboutus.php, allaboutus.php, about_us.php .... anything ...

 

Now all you need to do is create that page that you defined (in my example above you need to have the page about.php in your store root page) ... and your done ... this will link it to that page...that's it

 

Repeat this step for your other pages

Link to comment
Share on other sites

If you already defined it, then you did something wrong. What folder/directory does your page reside?

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

I didn't know I had to add the file to my root directory...I'm new to this, I didn't design/build the site myself. Ok I added it to my root directory, but now how do I make this page look like the rest of the site?? If possible, how do I get this link into my defined content items so I can easily edit it?

Link to comment
Share on other sites

  • 1 year later...

I got this to work. thanks for everyone's help.

 

One point that wasn't mentioned is you must create the faq.php in the root of your store, change the FILENAME_CONDITIONS (if you're using Conditions of Use as a template) to FILENAME_FAQ, then also you must create a faq.php in includes/languages/english/ and you create the text and titles in that file.

 

thanks,

Kendall

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...