Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Additional Information


Andge

Recommended Posts

Hey,

 

I asked this question before but only one person replied and I didn't quite understand.

I expect however that everyone who has an oscommerce online store HAS done this.

Extra pages. Like a FAQ page or an About Us page.. etc. How did you create these? One person here told me that they delete the middle of their shipping page and use that, but I need to understand how.

For example, if I wanted to add a product to my catalog, there's a "form" to fill out, with all the info, upload the image etc etc etc.

Now, if I want to make a FAQ page - for example - where do I go? what do I do?

 

Thank you.

Andrew.

Link to comment
Share on other sites

OK, I'll try to explain it a little easier.

 

 

Open catalog/shipping.php

Save it at catalog/faq.php

Open catalog/includes/languages/shipping.php

Find the variable that defines the TEXT on the page, and change it to whatever you want.

Change whatever other text you want. Make sure to preceed any single quotes in your text with a backslash.

Save it as catalog/includes/languages/faq.php

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

Okay, for each page viewed you have two pages of the same name e.g. privacy.php. So, in your root directory open privacy.php and select to 'Save As' and choose another name. The page is now renamed, and at the top of the page, where it says 'FILENAME_PRIVACY' change this to 'FILENAME_NEWPAGENAME', save the file and close it.

 

Then, go to includes/filenames.php, and add the new file name to the list.

 

Then go to includes/languages/english/privacy.php, and elect to 'Save As' and use the new file name. Then you need to change this at the top of the new page (to whatever you decide to use):

 

define('NAVBAR_TITLE', 'Privacy');

define('HEADING_TITLE', 'Privacy');

 

Then go to your osCommerce 'admin' control panel, select Tools, then Define Languages, then open english.php. If you are going to add the new file to an existing 'info box' (e.g. INFORMATION) then scroll down until you find the box entries and add

 

define('BOX_INFORMATION_NEWFILENAME', 'Some text here');

 

That's about it really. If you don't want to use the 'HEADING_TITLE' on the new page, then change this

 

define('HEADING_TITLE', 'Privacy');

 

to this

 

//define('HEADING_TITLE', 'Privacy');

 

Vger

Link to comment
Share on other sites

There are a number of ways to execute this.

 

What I'd do is to create the FAQ page by copying an existing page with little code in it - like the shipping page - found under /catalog/ Call it faq.php.

 

Within the file you'll see a call to a file called shipping (FILENAME_SHIPPING). The rest of the code is a standard template. Change this to FILENAME_FAQ.

 

The next thing you need to do is to create a copy of the shipping file located under the languages you use. /catalog/includes/languages/english/ for example. It's a small file but it has the code for the three major pieces you need to include.

 

NAVBAR_TITLE

HEADING_TITLE

TEXT_INFORMATION

 

Name this file faq.php as well.

 

Change the definitions for the above tags as you wish and then upload both files.

 

For how to access the page you'll need to tell us where you want to place the link. You could simply add the link to the header or build your own box to use in one of the columns.

 

LOL - it seems I'm a bit late to the party. :P

Apathy is a dominant gene - mutate.

Link to comment
Share on other sites

Within the file you'll see a call to a file called shipping (FILENAME_SHIPPING). The rest of the code is a standard template. Change this to FILENAME_FAQ.

 

I forgot to include that part.

 

Also will need an entry in filenames.php

define(FILENAME_FAQ, 'faq.php');

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

There are a number of ways to execute this.

 

What I'd do is to create the FAQ page by copying an existing page with little code in it - like the shipping page - found under /catalog/ Call it faq.php.

 

Within the file you'll see a call to a file called shipping (FILENAME_SHIPPING). The rest of the code is a standard template. Change this to FILENAME_FAQ.

 

The next thing you need to do is to create a copy of the shipping file located under the languages you use. /catalog/includes/languages/english/ for example. It's a small file but it has the code for the three major pieces you need to include.

 

NAVBAR_TITLE

HEADING_TITLE

TEXT_INFORMATION

 

Name this file faq.php as well.

 

Change the definitions for the above tags as you wish and then upload both files.

 

For how to access the page you'll need to tell us where you want to place the link. You could simply add the link to the header or build your own box to use in one of the columns.

 

LOL - it seems I'm a bit late to the party.  :P

 

Ok, after making the pages [FAQ page and another one] I want to put a link to the FAQ one in the left column, in the information box. The other one I'm gonna put on a particular page.

How do I go about doing this?

 

Thanks

Andrew.

Link to comment
Share on other sites

>> Left Column.

 

Got it. Ok. So let's assume it's going to go in the Information box. You'll need to edit /catalog/include/boxes/information.php

 

In there you'll see code similar to this:

 

$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .

 

There should be 4 references to tep_href_link which are the 4 links that come with the standard install. Add a line for your FAQ where you want it and be sure to watch your syntax. Let's say you want to put it at the top of the list. So:

array('text' => '<a href="' . tep_href_link(FILENAME_FAQ) . '">' . BOX_INFORMATION_FAQ . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .

 

Next we need to tell osCommerce where to find the file we're referencing so we open up /catalog/includes/filenames.php. The list is alphabetical. Add the reference to FAQ in there (FILENAME_FAQ) and give it the name of the file you created (faq.php).

 

Lastly, you'll need to open up the language files under the root of languages and add the text that BOX_INFORMATION_FAQ references. For english edit /catalog/includes/languages/english.php

 

When you're done this, upload and you should be all set.

Apathy is a dominant gene - mutate.

Link to comment
Share on other sites

>> Left Column.

 

Got it. Ok. So let's assume it's going to go in the Information box. You'll need to edit /catalog/include/boxes/information.php

 

In there you'll see code similar to this:

 

$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .

 

There should be 4 references to tep_href_link which are the 4 links that come with the standard install. Add a line for your FAQ where you want it and be sure to watch your syntax. Let's say you want to put it at the top of the list. So:

array('text' => '<a href="' . tep_href_link(FILENAME_FAQ) . '">' . BOX_INFORMATION_FAQ . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .

 

Next we need to tell osCommerce where to find the file we're referencing so we open up /catalog/includes/filenames.php. The list is alphabetical. Add the reference to FAQ in there (FILENAME_FAQ) and give it the name of the file you created (faq.php).

 

Lastly, you'll need to open up the language files under the root of languages and add the text that BOX_INFORMATION_FAQ references. For english edit /catalog/includes/languages/english.php

 

When you're done this, upload and you should be all set.

 

 

Hi, I'm doing what you said, I just added the FAQ file to the information box, but when I look at the information box on my site now, instead of an "FAQ" link, I have this "BOX_INFORMATION_FAQ" link.

 

What did I do wrong?

 

Andrew.

Link to comment
Share on other sites

See the next to the last sentence of my previous post. ;)

 

Yeah, I did that, and now I got this :Parse error: parse error, unexpected T_STRING in /home/shandge/public_html/includes/languages/english.php on line 79

 

What did I do wrong?

 

Thanks for answering so quickly.

Andrew.

Link to comment
Share on other sites

I'm guessing that the text title for the page is FAQ's? It should be FAQ\'s. All apostrophes used amongst text have to have a backslash (also called a 'trailing' slash) before them with php.

 

Vger

Link to comment
Share on other sites

I'm guessing that the text title for the page is FAQ's?  It should be FAQ\'s.  All apostrophes used amongst text have to have a backslash (also called a 'trailing' slash) before them with php.

 

Vger

 

It doesn't have an "S" on it, come to think of it it should. But I just had FAQ. Can you think of any other reason?

 

The problem started when I went into languages/english.php I saw this:

 

// information box text in includes/boxes/information.php

define('BOX_HEADING_INFORMATION', 'Information');

define('BOX_INFORMATION_PRIVACY', 'Privacy Notice');

define('BOX_INFORMATION_CONDITIONS', 'Conditions of Use');

define('BOX_INFORMATION_SHIPPING', 'Shipping & Returns');

define('BOX_INFORMATION_CONTACT', 'Contact Us');

 

and I made it this:

 

// information box text in includes/boxes/information.php

define('BOX_HEADING_INFORMATION', 'Information');

define('BOX_INFORMATION_FAQ', 'FAQ');

define('BOX_INFORMATION_PRIVACY', 'Privacy Notice');

define('BOX_INFORMATION_CONDITIONS', 'Conditions of Use');

define('BOX_INFORMATION_SHIPPING', 'Shipping & Returns');

define('BOX_INFORMATION_CONTACT', 'Contact Us');

 

and now I get the error I spoke of above.

 

Can you figure out why?

 

Iorax said in his entrys "When you're done this, upload and you'll be all set"

What do I need to upload? If that's the problem.

 

Also, in my filenames.php the FAQ file remains at the bottom of the list even though they should be in alphabetical order.

 

By the way, ya'll are life savers.

 

Thanks

Andrew.

Link to comment
Share on other sites

If you altered this file using the osCommerce File Manager then please go back and look at it again. The File Manager in osCommerce should not be used for editing files (it has a nasty habit of chopping pieces of code, which then causes problems). Take a look to see if there are any missing commas, or backslashed etc. The code you posted should work fine, as long as you have added the new page to filenames.php correctly. Also take a look at that file and double check there are no missing commas etc.

 

The reference that Iorax made to uploading the file when finished did assume that you had downloaded the file to your computer, and that you had edited using a text editor such as NotePad.

 

Vger

Link to comment
Share on other sites

p.s. Did you add th extra line to includes/boxes/information.php?

 

Vger

 

See anything wrong with it?

 

$info_box_contents = array();

$info_box_contents[] = array('text' =>'<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_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>');

Link to comment
Share on other sites

Sorry, posted wrong, didn't see the link to FAQ

 

Vger

 

You posted wrong? I only just copy and pasted it there so maybe you could see an error that I can't.

 

I dunno. All I have on my site now is an error and I cant' figure out why.

 

Tell me, in the filenames.php the FAQ name hasn't taken it's place in alphabetical order, did I do something wrong that may be causing this?

 

Andrew.

Link to comment
Share on other sites

Parse error: parse error, unexpected T_STRING in /home/shandge/public_html/includes/languages/english.php on line 79

 

What's on line 79 of the english.php file?

 

These errors usually occur when there's a missing ; or you didn't escape a ' in the string.

 

>> What do I need to upload? If that's the problem.

 

You upload the files you edited:

 

catalog/include/boxes/information.php

catalog/includes/filenames.php

catalog/includes/languages/english.php

 

Still having problems? Let's make the troubleshooting simple. Don't edit any files except the one the error points out. Do this. Comment out the line you added by putting a // in front of it so it reads

 

//define('BOX_INFORMATION_FAQ', 'FAQ');

 

Upload and test. Do you still get an error?

Apathy is a dominant gene - mutate.

Link to comment
Share on other sites

What's on line 79 of the english.php file?

 

These errors usually occur when there's a missing ; or you didn't escape a ' in the string.

 

>> What do I need to upload? If that's the problem.

 

You upload the files you edited:

 

catalog/include/boxes/information.php

catalog/includes/filenames.php

catalog/includes/languages/english.php

 

Still having problems? Let's make the troubleshooting simple. Don't edit any files except the one the error points out. Do this. Comment out the line you added by putting a // in front of it so it reads

 

//define('BOX_INFORMATION_FAQ', 'FAQ');

 

Upload and test. Do you still get an error?

 

 

I commented out the the line: //define('BOX_INFORMATION_FAQ', 'FAQ'); but I still get the error.

It may not be line 79 though, I counted the lines but what i'm not sure of is if a line is represented by a row, for example:

?

Information etc etc

<>

/??

More information

 

??

 

how many lines was that? Do I only count the "lines" with writing on them or do all the spaces and other characters etc count too?

 

Andrew

Link to comment
Share on other sites

Blank lines don't count and a line is a complete line of code. Count down to the line you added and see how many lines that is. It should be approx 78.

 

What are you using to edit the files with?

 

Did you edit anything else within the file - even so much as adding a space?

Apathy is a dominant gene - mutate.

Link to comment
Share on other sites

I commented out the the line: //define('BOX_INFORMATION_FAQ', 'FAQ'); but I still get the error.

It may not be line 79 though, I counted the lines but what i'm not sure of is if a line is represented by a row, for example:

?

Information etc etc

<>

/??

More information

 

??

 

how many lines was that? Do I only count the "lines" with writing on them or do all the spaces and other characters etc count too?

 

Andrew

 

I downloaded the english.php file and noticed that there was ' in What's new, and as Vger pointed out to me earlier, you should replace all of these ' with backslashes, so I moved it and then the error went to line 147. How did this thing get errors? I didn't even touch any of these places. Again Vger you're right, this thing seems to make it's own errors. Anyway I'll try to see if I can find the 147 error now.

 

Thanks to all of you.

Andrew.

Link to comment
Share on other sites

Big jumps in the line numbers for an error - especially when you've only been working in one area - can mean that you've inadvertantly deleted some character that encapsulates several lines of code. Like a <? or { Open up the original copy of the english.php file and compare it with the one you're working on line by line. That'll help you narrow down where the error lies.

 

I think you're on the right track but take it slow. You should get yourself an editor that gives you line numbers - it'll make the job easier and much quicker.

Apathy is a dominant gene - mutate.

Link to comment
Share on other sites

Big jumps in the line numbers for an error - especially when you've only been working in one area  -  can mean that you've inadvertantly deleted some character that encapsulates several lines of code. Like a <? or {  Open up the original copy of the english.php file and compare it with the one you're working on line by line. That'll help you narrow down where the error lies.

 

I think you're on the right track but take it slow. You should get yourself an editor that gives you line numbers - it'll make the job easier and much quicker.

 

Line 147 says: define('JS_REVIEW_TEXT', '* The 'Review Text' must have at least ' . REVIEW_TEXT_MIN_LENGTH . ' characters.n');

 

I // commented it out and now the page has returned. Can someone tell me what's wrong with that line?

 

Thanks

Andrew.

Link to comment
Share on other sites

Line 147 says: define('JS_REVIEW_TEXT', '* The 'Review Text' must have at least ' . REVIEW_TEXT_MIN_LENGTH . ' characters.n');

 

That line should look like:

 

define('JS_REVIEW_TEXT', '* The \'Review Text\' must have at least ' . REVIEW_TEXT_MIN_LENGTH . ' characters.\n');

 

Note the backslashes. Which makes me wonder if you did a global search and replace for something that ended up messing with all of the backslashes??

Apathy is a dominant gene - mutate.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...