Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Easily Add New Pages


jhilgeman

Recommended Posts

Agreed. Steps were left out, which would generate errors, and you wouldn't use a root level index.php page (with all of its coding) to add new 'static' pages to your website.

 

Vger

Link to comment
Share on other sites

  • 1 month later...
  • Replies 125
  • Created
  • Last Reply
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONDITIONS);

?$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONDITIONS, '', 'NONSSL'));

 

 

Nice one burt, thats works great.

 

One question if I may.. the pages I make are SSL enabled. Is there anyway I can turn this off for my new pages?

 

 

Thanks in advance

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

Clive,

 

You can use similar instructions to those above, but copy includes/boxes/information.php to includes/boxes/new_box.php.

 

Include any language definitions in includes/languages/english.php, and add the box in includes/column_left.php or column_right.php.

 

-jared

Link to comment
Share on other sites

Clive,

 

You can use similar instructions to those above, but copy includes/boxes/information.php to includes/boxes/new_box.php.

 

Include any language definitions in includes/languages/english.php, and add the box in includes/column_left.php or column_right.php.

 

-jared

 

Is it possible to make this a links box to outside osc?

 

and is it possible to store links to filenames.php with the link to http://wherever.com

Link to comment
Share on other sites

  • 2 weeks later...

in catalog/includes/languages/english.php, find

// 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 add this underneath it:

define ('BOX_INFORMATION_LINKS', 'Links from Gehenna');

 

That's assuming, of course, that you want the box title to be Links from Gehenna.

 

-jared

Link to comment
Share on other sites

in catalog/includes/languages/english.php, find
// 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 add this underneath it:

define ('BOX_INFORMATION_LINKS', 'Links from Gehenna');

 

That's assuming, of course, that you want the box title to be Links from Gehenna.

 

-jared

 

jared,

 

Thanks very much for your help!!!

:thumbsup:

 

Dave

Link to comment
Share on other sites

  • 1 month later...
Let's clear up a few misconceptions.

 

You can install osCommerce in the root directory, in which case there is no folder called 'catalog'.

 

If you decide not to install in he root directory then the default folder would be 'catalog'

 

You can call the database whatever you like, as long as you name it when installing.

 

In the post by Burt, once the files have been uploaded, you add the new files to includes/filenames.php and not to application_top.php.

 

Vger

 

If that's the correct way of doing it I'd suggest editing Burt's post to reflect that. People tend to read the first few posts in a thread, not the whole thing. At least it'd be nice to have the "perfect solution" in one single post instead of spread thin - perhaps Burt or Vger would be so kind as to add the correct straight forward instructions to the knowledge base or as a contribution?

 

My $0.02

 

Elrahc

Link to comment
Share on other sites

  • 1 month later...

hi ...im OSC newbie. i've successfully added a new page. but i cant add a pic inside the box. i wanna add a pic insted of words as a Link to "CONDITIONS"

 

<?php

$info_box_contents = array();

$info_box_contents[] = array('text' => BOX_HEADING_SIZE);

 

new infoBoxHeading($info_box_contents, false, false);

 

$info_box_contents = array();

$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' .i. '</a>');

 

new infoBox($info_box_contents);

?>

 

 

and i cant get rid of the I.... errors comes out when i get rid of the I ..

where should i add the code <img src="pic"> ?

Thanks !!! in advanced!!

Puppy Clothes by WoofWoofLand

Link to comment
Share on other sites

Your way is good, but better (IMO):

Download the following files:

catalog/conditions.php

catalog/includes/languages/english/conditions.php

Save them (on your Hard Drive as):

catalog/template.php

catalog/includes/languages/english/template.php

When you want a new page:

Open catalog/template.php (on your HD) and change the following:

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONDITIONS);
?$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONDITIONS, '', 'NONSSL'));

To:

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_NEW_PAGE);
?$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_NEW_PAGE, '', 'NONSSL'));

where NEW_PAGE is the name of your new page.

eg if you wanted a page called "about_us.php" the code would be:

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ABOUT_US);
?$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_ABOUT_US, '', 'NONSSL'));

Save and Upload both:

catalog/template.php

catalog/includes/languages/english/template.php

to their respective places on the live server, and then rename them BOTH to whatever, in the example: about_us.php

Set CHMOD 777 on your newly created and renamed:

catalog/includes/languages/english/about_us.php

Download, and open up application_top.php and add the following:

// New page about_us.php

define('FILENAME_ABOUT_US', 'about_us.php');

Save and upload includes/application_top.php

Now go Admin > Tools > Define Languages > about_us.php

Done. It sounds complicated but once you get the hang of it, it takes no longer than 2 minutes. It maintains the proper Osc structure.

 

I thought I could do it directly in the filemanager of osCommerce.

I just create a new file...

.../www/myfile.php

.../www/includes/languages/english/myfile.php

 

and copy the code from another file like "conditions.php" into the new respective file and change FILENAME variables as mentioned + adding new FILENAME variable in filenames.php

 

But when calling the file from a link inside index.php everything works ok except I get the following red text on top...

 

Warning: session_start(): open(/data/members/paid/c/o/coyoteboardstore.se/htdocs/www/admin/sessions/sess_0a29bdb75e2a91174e811fd23f9fafb6, O_RDWR) failed: Permission denied (13) in /data/members/paid/c/o/coyoteboardstore.se/htdocs/www/includes/functions/sessions.php on line 67

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /data/members/paid/c/o/coyoteboardstore.se/htdocs/www/includes/functions/sessions.php:67) in /data/members/paid/c/o/coyoteboardstore.se/htdocs/www/includes/functions/sessions.php on line 67

 

and on this at the very bottom...

 

Warning: session_write_close(): open(/data/members/paid/c/o/coyoteboardstore.se/htdocs/www/admin/sessions/sess_0a29bdb75e2a91174e811fd23f9fafb6, O_RDWR) failed: Permission denied (13) in /data/members/paid/c/o/coyoteboardstore.se/htdocs/www/includes/functions/sessions.php on line 106

 

Warning: session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/data/members/paid/c/o/coyoteboardstore.se/htdocs/www/admin/sessions) in /data/members/paid/c/o/coyoteboardstore.se/htdocs/www/includes/functions/sessions.php on line 106

 

 

The only thing I can't do in the osCommerce filemanager is...

Set CHMOD 777 on your newly created files

 

Is this the reason of my error? My newly created file has the same mode as the one I copied i.e. -rw-rw-r--

 

What am I missing here?

Link to comment
Share on other sites

hi ...im OSC newbie. i've successfully added a new page. but i cant add a pic inside the box. i wanna add a pic insted of words as a Link to "CONDITIONS"

 

<?php

$info_box_contents = array();

$info_box_contents[] = array('text' => BOX_HEADING_SIZE);

 

new infoBoxHeading($info_box_contents, false, false);

 

$info_box_contents = array();

$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' .i. '</a>');

 

new infoBox($info_box_contents);

?>

and i cant get rid of the I.... errors comes out when i get rid of the I ..

where should i add the code <img src="pic"> ?

Thanks !!! in advanced!!

 

 

 

no one can help ? PLZ PLZ PLZ PLZ PLZ HELP !!!!!!!!!!!!!!!!

Puppy Clothes by WoofWoofLand

Link to comment
Share on other sites

I thought I could add pages directly in the filemanager of osCommerce.

I just create a new file...

.../www/myfile.php

.../www/includes/languages/english/myfile.php

 

and copy the code from another file like "conditions.php" into the new respective file and change FILENAME variables as mentioned + adding new FILENAME variable in filenames.php

 

But when calling the file from a link inside index.php everything works ok except I get the following red text on top...

 

Warning: session_start(): open(/data/members/paid/c/o/coyoteboardstore.se/htdocs/www/admin/sessions/sess_0a29bdb75e2a91174e811fd23f9fafb6, O_RDWR) failed: Permission denied (13) in /data/members/paid/c/o/coyoteboardstore.se/htdocs/www/includes/functions/sessions.php on line 67

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /data/members/paid/c/o/coyoteboardstore.se/htdocs/www/includes/functions/sessions.php:67) in /data/members/paid/c/o/coyoteboardstore.se/htdocs/www/includes/functions/sessions.php on line 67

 

and on this at the very bottom...

 

Warning: session_write_close(): open(/data/members/paid/c/o/coyoteboardstore.se/htdocs/www/admin/sessions/sess_0a29bdb75e2a91174e811fd23f9fafb6, O_RDWR) failed: Permission denied (13) in /data/members/paid/c/o/coyoteboardstore.se/htdocs/www/includes/functions/sessions.php on line 106

 

Warning: session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/data/members/paid/c/o/coyoteboardstore.se/htdocs/www/admin/sessions) in /data/members/paid/c/o/coyoteboardstore.se/htdocs/www/includes/functions/sessions.php on line 106

 

The only thing I can't do in the osCommerce filemanager is...

Set CHMOD 777 on your newly created files

 

Is this the reason of my error? My newly created file has the same mode as the one I copied i.e. -rw-rw-r--

 

I now tried downloading an existing file. Changed name and uploaded as stated. Now mode of my new files are _rwxrwxrwx

 

But still the same session error.

 

What am I missing here?

Link to comment
Share on other sites

  • 2 weeks later...
no one can help ? PLZ PLZ PLZ PLZ PLZ HELP !!!!!!!!!!!!!!!!

 

try

$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '"><img src="myimage.jpg"></a>');

 

-jared

Link to comment
Share on other sites

  • 1 month later...
www.naturesflavors.com

- Jonathan

 

thanks, i am wondering how did you change: E-Commerce Engine Copyright ? 2003 osCommerce

osCommerce provides no warranty and is redistributable under the GNU General Public License

 

Powered by osCommerce into: All Content Copyright 2006 Nature's Flavors. All Rights Reserved.

1145 W. Shelly Ct., Orange, CA 92868 - TEL: (714) 744-3700

 

how did you do that on all your pages and can you please tell me how to do that 2...

 

thanks,

 

saman

Link to comment
Share on other sites

  • 3 weeks later...

speaking of new pages, I've been trying to figure out how to create a new page with products i want to feature.

 

I dont want to go into the admin and create a new category and put items in there. I want the page to be kinda hidden so i can send a text link to the newsletter subscribers.

 

What i want to do is create a page that calls up certain products by their id number and list them with their small image, text and price, which then links to their page. Just like a sub-category page.

 

That way i can just browse my site and input all the numbers for the products i want.

 

is this possible?

 

maybe something like modifying the products new file?:

 

<td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>

<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a><br>' . $products_new['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td>

 

but modify each code to reflect bunch of chosen product id's ????

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...
I found that if I wanted to add "extra" pages to OSC, it became a real pain to work with them. For each page there are so many headers and extra lines that include the HTML headers, columns, etc... I came up with a simpler solution - it's only a little weird to set up in the beginning.

You can see an example of this by going to www.naturesflavors.com and clicking on any of the links in the "Product Information" box on the right, or by going to www.naturesflavors.com/newsletter

Doesn't look too different than normal OSC pages, right?

Now I can add a new page to my store in seconds. This is how it works - I simply copy all the header and footer information into one file called display_page.inc.php, so its contents look like:

<?php

// display_page.inc.php

// Header

require('includes/application_top.php');

more header stuff bla bla bla

// Content

echo $PageContent;

// Footer

require('includes/application_bottom.php');

more footer stuff

?>

Then for each page I want to create, I simply make a new document, assign the content to $PageContent and include the display_page.inc.php. For instance new_policies.php:

<?

// new_policies.php

$PageContent = "<p>Here are our new policies:</p>";

$PageContent .= "Blah dee dah.<br> More stuff. Etc... n";

$PageContent .= "And that's all of them. Thanks!<br>n";

include("display_page.inc.php");

?>

And that gives me a fully-rendered page. I don't have to waste time copying-and-pasting headers and footers into each new page.

I've done a bit more than that, but that is the basic working concept.

- Jonathan

Link to comment
Share on other sites

  • 2 weeks later...
Now go Admin > Tools > Define Languages > about_us.php

Done. It sounds complicated but once you get the hang of it, it takes no longer than 2 minutes. It maintains the proper Osc structure.

 

Those instructions were great, easy to follow but now I'm stuck.

 

I'm in admin>tools>define languages>my_page.php, and defined my new page. How do I get it to appear on my site? I want it in the information infobox or maybe a new info box. What do I have to select/switch on to do.

 

Thanks in advance.

Link to comment
Share on other sites

You wanna add it to includes/filenames.php. You can add it anywhere in that file. :) (Includes is inside your parent directory. So if osCommerce is installed in /catalogue/ then the file would be /catalogue/includes/filenames.php.

 

HTH, I'm fairly new to this too.

 

Gabriel

 

I sucessfully added the new page but got an error message after editing filenames.php

 

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at c:\hosting\webhost4life\member\jadegirly2k\catalog\includes\filenames.php:68) in c:\hosting\webhost4life\member\jadegirly2k\catalog\includes\functions\sessions.php on line 67.

 

I restored the backup filename.php but the error is still there

 

HELP!!!

I didn't set the CHMOD 777 cause don't know how to. Could that be the problem?

 

I did exactly as Burt said and added the page in the information box.

 

whats gone wrong??!!!!!!!

Link to comment
Share on other sites

Hi,

 

I've got to the stage I can now see my new page in the information box, and I've followed all the steps but I get the error when I click on it

 

 

Fatal error: main(): Failed opening required '' (include_path='.:/usr/local/lib/php') in /content/StartupHostPlus/b/a/xxxxxxxx.com/web/templates/fallback/main_page.tpl.php on line 121

 

I looked at this file and cannot see anything out of the ordinary. I'm guessing this has something to do with the templates being used (someone else set the site up for me and I'm now maintaining it).

 

Any ideas, what does main_page.tpl.php does or what is going wrong with it?

 

Thanks for you help. I'm getting there.

 

Regards

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...