Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Editing welcome message


ahmed5

Recommended Posts

http://www.oscommerce.com/forums/index.php?showtopic=78885

 

This thread gives an outline for how languages work in OSC.

 

To see what language definitions tep_customer_greeting() uses, then you need to find the function definition. That is in includes/functions/general.php. You will see that to edit this, you need to edit a language file, which the above link describes how to do for several different examples.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

This is the code for the function:

 

////
// Return a customer greeting
 function tep_customer_greeting() {
global $customer_id, $customer_first_name;

if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {
  $greeting_string = sprintf(TEXT_GREETING_PERSONAL, tep_output_string_protected($customer_first_name), tep_href_link(FILENAME_PRODUCTS_NEW));
} else {
  $greeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
}

return $greeting_string;
 }

 

I can't find the function definition in the language file for index.php. This is what i find:

 

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\'s 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\'s New Here?');
} elseif ($category_depth == 'nested') {
 define('HEADING_TITLE', 'Categories');
}

Link to comment
Share on other sites

You almost got there. You need to look in includes/languages/english.php for TEXT_GREETING_PERSONAL. That's where you change the text.

 

Thanks i've found it. However i can't seem to change the link. At the moment it's:

 

tep_href_link(FILENAME_PRODUCTS_NEW));

 

How do i link it to /catalog.php ??? this is a file i created myself, it has no php code at the top of the source code page like the pages that came with Oscommerce.

Link to comment
Share on other sites

You need to learn to do a text search within files. You can use the Windows search function to search within files for a particular line of text, or you can use an advanced text editor to do a search within files.

 

Searching for the text

 

FILENAME_PRODUCTS_NEW

 

Will show that text is defined in includes/filenames.php. This is a file that lists all filenames and assigns them to a constant. If you created a constant for your new file, contacts.php, then you would use the corresponding constant. If not, then you either add the definition, or you can specify a link as:

 

tep_href_link('catalog.php')

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...