Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

how to find the "default" code settings for index.php (or any other section)


studioflow

Recommended Posts

well ... i am new to this and my webmaster tech wizard has gone on a 10 day meditation retreat ... before he left he gave me the ability to go into my "index.php" section to change the wording around ...

 

of course he told me to save the default coding first .... but because i was simply changing words and not coding i thought i'd be fine .. yikes!!!

 

now my entire shopping cart has disappeared from me changing only ONE WORD!!!

 

where can one find the original default coding so that i can replace the coding that i messed up ...

Link to comment
Share on other sites

You should always back up your files before you alter them. If you're going to alter them, make a copy, first. Then if you like the new page, delete the copy. But if you don't like the new page, you can always revert back to your saved copy. Lesson learned.

 

If you want a fresh index.php, you can use the e-mail link in my profile and I'll e-mail you a fresh copy.

Jason

 

Simple 1-2-3 Intructions on how to get, install and configure SSL

 

The Google Sandbox explained

 

Simple to follow instructions on how to change the look of your OSC

 

How To Make A Horrible OSC Website

 

my toolbox: All things WordPress-related - All things Adobe-related - PHP Designer 2007 - Codecanyon Junkie - Crimson Editor - Winmerge - phpMyAdmin - WS_FTP

 

my installed contributions: Category Banners, File Upload feature-.77, Header Tags, Sort_Product_Attributes_1, XSellv2.3, Price Break 1.11.2, wishlist 3.5, rollover_category_images_v1.2, Short_Description_v2.1, UPSXML_v1_2_3, quickbooks qbi_v2_10, allprods v4.4, Mouseover-effect for image-buttons 1.0, Ultimate_SEO, AAP 1.41, Auto Select State Value, Fast Easy Checkout, Dynamic SiteMap v2.0, Image Magic, Links Manager 1.14, Featured Products, Customer Testimonials, Article Manager, FAQ System, and I'm sure more ...

Link to comment
Share on other sites

Out of interest. Which word did you change?

 

 

the very last line in the index.php was

 

define('HEADING_TITLE', 'Categories');

}

 

i was trying to change the word "categories" and for some reason this removed my entire shopping cart from my website ...

 

LESSON LEARNED!!!

 

thank you for your help ...

 

if you want to see my new website it's

 

www.studioflow.ca

 

but it's still in the baby stages of development

Link to comment
Share on other sites

Should end in ...

 

} elseif ($category_depth == 'nested') {

define('HEADING_TITLE', 'Categories');

}

?>

 

 

Looks like you had a minor syntax error, but you have to be careful with syntax with php. Don't forget to add a \ before every apostrophe when you're creating your page.

Jason

 

Simple 1-2-3 Intructions on how to get, install and configure SSL

 

The Google Sandbox explained

 

Simple to follow instructions on how to change the look of your OSC

 

How To Make A Horrible OSC Website

 

my toolbox: All things WordPress-related - All things Adobe-related - PHP Designer 2007 - Codecanyon Junkie - Crimson Editor - Winmerge - phpMyAdmin - WS_FTP

 

my installed contributions: Category Banners, File Upload feature-.77, Header Tags, Sort_Product_Attributes_1, XSellv2.3, Price Break 1.11.2, wishlist 3.5, rollover_category_images_v1.2, Short_Description_v2.1, UPSXML_v1_2_3, quickbooks qbi_v2_10, allprods v4.4, Mouseover-effect for image-buttons 1.0, Ultimate_SEO, AAP 1.41, Auto Select State Value, Fast Easy Checkout, Dynamic SiteMap v2.0, Image Magic, Links Manager 1.14, Featured Products, Customer Testimonials, Article Manager, FAQ System, and I'm sure more ...

Link to comment
Share on other sites

oops -- got cut off. Was going to say ... when you\'re doing your text, it should look like this if you\'re planning on using apostrophes with php. It\'s mandatory, or you\'ll get syntax errors. I know it looks goofy, but it will show up on the wepage as normal.

Jason

 

Simple 1-2-3 Intructions on how to get, install and configure SSL

 

The Google Sandbox explained

 

Simple to follow instructions on how to change the look of your OSC

 

How To Make A Horrible OSC Website

 

my toolbox: All things WordPress-related - All things Adobe-related - PHP Designer 2007 - Codecanyon Junkie - Crimson Editor - Winmerge - phpMyAdmin - WS_FTP

 

my installed contributions: Category Banners, File Upload feature-.77, Header Tags, Sort_Product_Attributes_1, XSellv2.3, Price Break 1.11.2, wishlist 3.5, rollover_category_images_v1.2, Short_Description_v2.1, UPSXML_v1_2_3, quickbooks qbi_v2_10, allprods v4.4, Mouseover-effect for image-buttons 1.0, Ultimate_SEO, AAP 1.41, Auto Select State Value, Fast Easy Checkout, Dynamic SiteMap v2.0, Image Magic, Links Manager 1.14, Featured Products, Customer Testimonials, Article Manager, FAQ System, and I'm sure more ...

Link to comment
Share on other sites

oops -- got cut off. Was going to say ... when you\'re doing your text, it should look like this if you\'re planning on using apostrophes with php. It\'s mandatory, or you\'ll get syntax errors. I know it looks goofy, but it will show up on the wepage as normal.

 

 

wow ... that was the problem ... i didn't think i erased any code which i now know i did not ...

 

funny how the littlest thing can wipe out your whole shopping cart!!!

 

thank you so much for that info ... now it's all working fine again ...

Link to comment
Share on other sites

and psst ...

 

no one tell my webmaster when he gets back ...

 

HA HA HA .....

 

 

This is exactly what happened to me. I am building a new site and the programmer sent me the files to start loading on Tuesday. Today I made 1 small change in the index.php (and even put it back to the way it was...I thought) , lost the cart and just like you, my programmer is out of town until Monday.

 

Here is the exact content of the index.php file. Can someone tell me whats wrong? Guess I need to save these files somewhere for future reference should this happen again.

 

 

 

 

 

<?php

/*

$Id: index.php,v 1.1 2003/06/11 17:38:00 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

define('TEXT_MAIN', 'Steve D´Gerolamo is the guiding force behind some of the finest garages in the world. Inside and out, they are engineered to meet the owner´s current and future needs with an unsurpassed level of appointment and detail. From tools, lighting, and storage solutions to showcase automotive museums and fully equipped workshops, let Steve help you create your own ultimate garage.');

define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');

define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');

define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');

 

if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {

define('HEADING_TITLE', 'Let us see what we have here...');

define('TABLE_HEADING_IMAGE', '');

define('TABLE_HEADING_MODEL', 'Model');

define('TABLE_HEADING_PRODUCTS', 'Product Name');

define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');

define('TABLE_HEADING_QUANTITY', 'Quantity');

define('TABLE_HEADING_PRICE', 'Price');

define('TABLE_HEADING_WEIGHT', 'Weight');

define('TABLE_HEADING_BUY_NOW', 'Buy Now');

define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');

define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');

define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');

define('TEXT_SHOW', '<b>Show:</b>');

define('TEXT_BUY', 'Buy 1 '');

define('TEXT_NOW', '' now');

define('TEXT_ALL_CATEGORIES', 'All Categories');

define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers');

} elseif ($category_depth == 'top') {

define('HEADING_TITLE', 'What is New Here?');

} elseif ($category_depth == 'nested') {

define('HEADING_TITLE', 'Categories');

}

?>

 

 

 

Should end in ...

 

} elseif ($category_depth == 'nested') {

define('HEADING_TITLE', 'Categories');

}

?>

Link to comment
Share on other sites

This is exactly what happened to me. I am building a new site and the programmer sent me the files to start loading on Tuesday. Today I made 1 small change in the index.php (and even put it back to the way it was...I thought) , lost the cart and just like you, my programmer is out of town until Monday.

 

Here is the exact content of the index.php file. Can someone tell me whats wrong? Guess I need to save these files somewhere for future reference should this happen again.

<?php

/*

$Id: index.php,v 1.1 2003/06/11 17:38:00 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

define('TEXT_MAIN', 'Steve D´Gerolamo is the guiding force behind some of the finest garages in the world. Inside and out, they are engineered to meet the owner´s current and future needs with an unsurpassed level of appointment and detail. From tools, lighting, and storage solutions to showcase automotive museums and fully equipped workshops, let Steve help you create your own ultimate garage.');

define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');

define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');

define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');

 

if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {

define('HEADING_TITLE', 'Let us see what we have here...');

define('TABLE_HEADING_IMAGE', '');

define('TABLE_HEADING_MODEL', 'Model');

define('TABLE_HEADING_PRODUCTS', 'Product Name');

define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');

define('TABLE_HEADING_QUANTITY', 'Quantity');

define('TABLE_HEADING_PRICE', 'Price');

define('TABLE_HEADING_WEIGHT', 'Weight');

define('TABLE_HEADING_BUY_NOW', 'Buy Now');

define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');

define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');

define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');

define('TEXT_SHOW', '<b>Show:</b>');

define('TEXT_BUY', 'Buy 1 '');

define('TEXT_NOW', '' now');

define('TEXT_ALL_CATEGORIES', 'All Categories');

define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers');

} elseif ($category_depth == 'top') {

define('HEADING_TITLE', 'What is New Here?');

} elseif ($category_depth == 'nested') {

define('HEADING_TITLE', 'Categories');

}

?>

-->>END of file should be here. Make sure the stuff below here is not uploaded and that there are no spaces after ?><<--

 

Should end in ...

 

} elseif ($category_depth == 'nested') {

define('HEADING_TITLE', 'Categories');

}

?>

See the note above about where the end of your file should be.

Also, your define('TEXT_MAIN' has apostrophes which have not been escaped per the instructions in post #7 of this thread. What you have above should read

define('TEXT_MAIN', 'Steve D\´Gerolamo is the guiding force behind some of the finest garages in the world. Inside and out, they are engineered to meet the owner\´s current and future needs with an unsurpassed level of appointment and detail. From tools, lighting, and storage solutions to showcase automotive museums and fully equipped workshops, let Steve help you create your own ultimate garage.');

... if you want to REALLY see something that doesn't set up right out of the box without some tweaking,

try being a Foster Parent!

Link to comment
Share on other sites

Thanks for the info but it doesn't seem to be working. I put in the backslash as you suggested in front of both of the apostrophes and saved the file. When I go back to look at the file content again, the apostrophe is gone. When I try to lauch the store, nothing happens.

 

Any idea what I'm doing wrong?

 

I'm assuming all changes to to these files are live to the server (just like adding products and categories) with no need to do reset or upload at the bottom of the File Manager screen. Is this correct? Steve

Link to comment
Share on other sites

Thanks for the info but it doesn't seem to be working. I put in the backslash as you suggested in front of both of the apostrophes and saved the file. When I go back to look at the file content again, the apostrophe is gone. When I try to lauch the store, nothing happens.

 

Any idea what I'm doing wrong?

 

I'm assuming all changes to to these files are live to the server (just like adding products and categories) with no need to do reset or upload at the bottom of the File Manager screen. Is this correct? Steve

If you're using the file manager from within osC, that could be part of your problem right there - it does some funky things to files and could be creating problems when you use it for your upload.

 

Best thing to do is to use a basic text editor (like wordpad) and then upload your files to your server using an FTP program.

 

As far as being live to the server from within the osC file manager, I can't answer as I've never used it for amending my files.

... if you want to REALLY see something that doesn't set up right out of the box without some tweaking,

try being a Foster Parent!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...