Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

HOW TO - Add a new pages to OSC!


toolcrazy

Recommended Posts

How to add a new page to OSC.

 

First go to your /catalog/ root directory and open shipping.php and do Save As,

then rename the page, I'll name mine new_page.php. Be sure you save it to your

catalog root dir. Now you have a clone of your shipping.php file.

 

Now to go to /catalog/includes/languages/your_language/ and find shipping.php

and Save As this file also, this name should be the same as the previous page,

I'll name mine new_page.php also. Make sure you save it to your

/language/your_language dir. Now you have a language file for your new page.

 

You have created two new pages and now for some editing.

 

Open /catalog/includes/application_top.php and enter this code.

Edit this to match the name of your new_page.

define('FILENAME_NEW_PAGE', 'new_page.php');

I put mine right at the top of the other defines.

 

Now open /catalog/new_page.php and find this piece of code:

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHIPPING);

And change it to match your new new_page. Mine will be:

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_NEW_PAGE);

 

And on the next line you need to change this line:

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

And change this to match your new_page name:

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

 

Now go to /catalog/includes/languges/your_language/shipping.php And edit it to your taste.

 

And that is it. Now you can test your work. Open your browser and type in

http://www.yourdomain.com/new_page.php and you should see your new page. Now all you need

to do is decide where your going to put the link to you new page. I will be writing a tutorial

on how to add a link to the information and the categories page soon. So stay tuned. :)

Steve

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

Link to comment
Share on other sites

I searched for the define fields in /catalog/includes/application_top.php

but I can't find where to place my new define code.

 

Can you tell about which line this goes on? Or did you accidentally type in the wrong file?

 

I found this code in /catalog/includes/application_top.php

require(DIR_WS_INCLUDES . 'filenames.php');

 

 

Which includes the following defines:

 

// define the filenames used in the project

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

 define('FILENAME_ACCOUNT_EDIT', 'account_edit.php');

 define('FILENAME_ACCOUNT_EDIT_PROCESS', 'account_edit_process.php');

 define('FILENAME_ACCOUNT_HISTORY', 'account_history.php');

 define('FILENAME_ACCOUNT_HISTORY_INFO', 'account_history_info.php');

 define('FILENAME_ADDRESS_BOOK', 'address_book.php');

 define('FILENAME_ADDRESS_BOOK_PROCESS', 'address_book_process.php');

 define('FILENAME_ADVANCED_SEARCH', 'advanced_search.php');

 define('FILENAME_ADVANCED_SEARCH_RESULT', 'advanced_search_result.php');

 define('FILENAME_ALSO_PURCHASED_PRODUCTS', 'also_purchased_products.php');

 define('FILENAME_CHECKOUT_CONFIRMATION', 'checkout_confirmation.php');

 define('FILENAME_CHECKOUT_PAYMENT', 'checkout_payment.php');

 define('FILENAME_CHECKOUT_PAYMENT_ADDRESS', 'checkout_payment_address.php');

 define('FILENAME_CHECKOUT_PROCESS', 'checkout_process.php');

 define('FILENAME_CHECKOUT_SHIPPING', 'checkout_shipping.php');

 define('FILENAME_CHECKOUT_SHIPPING_ADDRESS', 'checkout_shipping_address.php');

 define('FILENAME_CHECKOUT_SUCCESS', 'checkout_success.php');

 define('FILENAME_CONTACT_US', 'contact_us.php');

 define('FILENAME_CONDITIONS', 'conditions.php');

 define('FILENAME_COOKIE_USAGE', 'cookie_usage.php');

 define('FILENAME_CREATE_ACCOUNT', 'create_account.php');

 define('FILENAME_CREATE_ACCOUNT_PROCESS', 'create_account_process.php');

 define('FILENAME_CREATE_ACCOUNT_SUCCESS', 'create_account_success.php');

 define('FILENAME_DEFAULT', 'default.php');

 define('FILENAME_DOWNLOAD', 'download.php');

 define('FILENAME_INFO_SHOPPING_CART', 'info_shopping_cart.php');

 define('FILENAME_LOGIN', 'login.php');

 define('FILENAME_LOGOFF', 'logoff.php');

 define('FILENAME_NEW_PRODUCTS', 'new_products.php');

 define('FILENAME_PASSWORD_FORGOTTEN', 'password_forgotten.php');

 define('FILENAME_POPUP_IMAGE', 'popup_image.php');

 define('FILENAME_POPUP_SEARCH_HELP', 'popup_search_help.php');

 define('FILENAME_PRIVACY', 'privacy.php');

 define('FILENAME_PRODUCT_INFO', 'product_info.php');

 define('FILENAME_PRODUCT_LISTING', 'product_listing.php');

 define('FILENAME_PRODUCT_NOTIFICATIONS', 'product_notifications.php');

 define('FILENAME_PRODUCT_REVIEWS', 'product_reviews.php');

 define('FILENAME_PRODUCT_REVIEWS_INFO', 'product_reviews_info.php');

 define('FILENAME_PRODUCT_REVIEWS_WRITE', 'product_reviews_write.php');

 define('FILENAME_PRODUCTS_NEW', 'products_new.php');

 define('FILENAME_REDIRECT', 'redirect.php');

 define('FILENAME_REVIEWS', 'reviews.php');

 define('FILENAME_SHIPPING', 'shipping.php');

 define('FILENAME_SHOPPING_CART', 'shopping_cart.php');

 define('FILENAME_SPECIALS', 'specials.php');

 define('FILENAME_SSL_CHECK', 'ssl_check.php');

 define('FILENAME_TELL_A_FRIEND', 'tell_a_friend.php');

 define('FILENAME_UPCOMING_PRODUCTS', 'upcoming_products.php');

?>

 

should "define('FILENAME_NEW_PAGE', 'new_page.php');" go in here somewhere instead of application_top.php?

 

Thanks in advance

Link to comment
Share on other sites

Everything I typed above is correct. Just ADDin the line:

 

define('FILENAME_NEW_PAGE', 'new_page.php');

 

In the top of the defines of /catalog/includes/application_top.php. Right below the comment line as shown below.

 

// define the filenames used in the project

 define('FILENAME_NEW_PAGE', 'new_page.php');

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

 

Just so you know, I am testing these mods as I write the lesson. I am sorry if I wasn't very clear, but I am still learning how to properly write tutorials.

Steve

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

Link to comment
Share on other sites

Steve,

 

Which version are you on.

 

I agree with Mercel and Pacman.

 

I am using Version 2.2 CVS and it is laid out as they say.

 

Byron

BG

 

Making the internet community better. Knowledge is power.

Link to comment
Share on other sites

I did this on MS1, I haven't looked at any of the newer snaps. It figures, I finally get the hang of things and they change everything. Oh, well, Thats the problem with any type of docs they are out of date the day they are written.

Steve

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

Link to comment
Share on other sites

But I have another question.

 

Is there a way escape out of php and format the page in html?

 

just this part:

define('TEXT_INFORMATION', 'Put here your New Page information.');

 

I need to add some pictures and this would require html format.

 

It doesn't look like I can place html in there.

 

Any ideas?

Link to comment
Share on other sites

Is there a way escape out of php and format the page in html?

 

It's simple:

 

<html>

<body>

 <b>

<?php

 echo 'Hello World'; 

?>

 </b>

</body>

</html>

"Politics is the art of preventing people from taking part in affairs which properly concern them"

Link to comment
Share on other sites

did you insert your text in catalog/includes/languages/english/shipping.php ?

 

and insert your text between the ' '

define('TEXT_INFORMATION', 'Put here your Shipping & Returns information.');

 

HTH

The_Bear

Link to comment
Share on other sites

This forum isn't for questions, except when focused on the lesson at hand. If you would start another thread in General Support and post your /includes/language/english/shipping.php as you have it edit now we will try and help.

Steve

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

Link to comment
Share on other sites

Hi Steve, Just wanted to let you know your instructions for the new page addition were very easy to follow and I had no problem adding a page. You did good!! Waiting for link tutorial>>> :D

Sarah

A newbie who has learned just enough to be dangerous!

Link to comment
Share on other sites

Hi Steve, Just wanted to let you know your instructions for the new page addition were very easy to follow and I had no problem adding a page. You did good!! Waiting for link tutorial>>> :D

Sarah

 

Thank you, your so kind. I have one of the two lessons just about finished. The first will be adding a link to the categories box and the next will be adding to the information box. Hoping to have both done and posted by Sunday night.

Steve

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

Link to comment
Share on other sites

Hi Steve, Waiting for link tutorial>>> :D

Sarah

 

http://wiki.oscommerce.com/helpModsAddBoxLinks

 

Here is a lesson I found on adding links to the information.php box, check it out. If it is too confusing for you let me know, I will rewrite it, otherwise there is no reason for me to repost it. I will, however, post the "Adding a link to Categories Box" lesson that I have almost finished.

 

Thanks again,

Steve

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

Link to comment
Share on other sites

Hi Steve! Thanks for the reminder of the wiki site. I used those instructions and FINALLY got it worked out. However, I must say, I found the instructions to be very confusing. See the underlined below: It seems to be telling you to rename and ADD a COLUMN. To a guru, they would have absolutely known better but to us :? scratching head newbies :? Anyway, that is my 2 cents for what it's worth and may help others.

 

See underlined line of the instructions below.

 

Add New Box

This will add a new box to one of the columns.

Open /catalog/includes/boxes/information.php in a text editor and save as /catalog/includes/boxes/newname.php

Then in column_left.php, add this line:

require(DIR_WS_BOXES . 'newname.php');

directly below this line:

require(DIR_WS_BOXES . 'information.php');

 

Save column_newname.php & upload to your server.

 

Add links to this new box like the instructions on Add Box Links

 

Thanks again for your help.

Sarah :)

A newbie who has learned just enough to be dangerous!

Link to comment
Share on other sites

  • 2 months later...

Thanks for this info. I followed the directions (and apparently have an older CVS - so there is no filenames.php)... Anyhow, when I attempt to open the page I get this error

Warning: main(includes/languages/english/FILENAME_layaway_faq) [function.main]: failed to create stream: No such file or directory in /home/tanya/public_html/store/layaway_faq.php on line 15



Fatal error: main() [function.main]: Failed opening required 'includes/languages/english/FILENAME_layaway_faq' (include_path='') in /home/tanya/public_html/store/layaway_faq.php on line 15

 

Here is line 15 of /home/tanya/public_html/store/layaway_faq.php

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LAYAWAY_FAQ);

 

the file layaway_faq.php IS in the ../language/english directory

 

Any suggesttions? I'm not that great at interpreting error messages yet, so thanks in advance!

Link to comment
Share on other sites

Do you have a

define('FILENAME_LAYAWAY_FAQ', 'layaway_faq.php');

in includes/application_top.php (or wherever the other FILENAME_ defines are)? The error message prints after the conversion, so what it is telling you is that it doesn't know what FILENAME_layaway_faq (or should that be FILENAME_LAYAWAY_FAQ) is. Also, capitalization matters, so one of three things must be true (unless I'm missing something): the error message actually says FILENAME_LAYAWAY_FAQ not FILENAME_layaway_faq; your line 15 actually says FILENAME_layaway_faq not FILENAME_LAYAWAY_FAQ; you have a define that looks like one of the following

define('LAYAWAY_FAQ', 'layaway_faq');

define('FILENAME_LAYAWAY_FAQ', 'FILENAME_layaway_faq');

If that is the case, delete the malformed define and replace it with the one in the first code block.

 

Hth,

Matt

Link to comment
Share on other sites

Ok, that was the problem.. I knew it had to be something simple.. *sigh* I think I need more coffee...

 

In application_top.php I now have this line:

define('FILENAME_LAYAWAY_FAQ', 'layaway_faq.php');

 

It DID say

define('FILENAME_NEW_PAGE', 'layaway_faq.php');

oops! :oops:

Link to comment
Share on other sites

  • 2 years later...

Ok am lost with this i have V2.2

 

I did everything on the 1st page of this post but i get this error

 

 

Warning: main(includes/languages/english/FILENAME_nevillepricelist): failed to open stream: No such file or directory in /home/sdsonlin/public_html/nevillepricelist.php on line 15

 

Warning: main(includes/languages/english/FILENAME_nevillepricelist): failed to open stream: No such file or directory in /home/sdsonlin/public_html/nevillepricelist.php on line 15

 

Fatal error: main(): Failed opening required 'includes/languages/english/FILENAME_nevillepricelist' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/sdsonlin/public_html/nevillepricelist.php on line 15

 

Can some one please help me.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...