Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Welcome message above products


Guest

Recommended Posts

Posted

I'm using an altered Template and I've seen on the stock version of OsC where they have an open space to type like a welcome message. Which file would I have to edit to change that?

 

Any help would be appreciated.

Posted
includes/languages/english/index.php

 

Don't see where I'm suppossed to change that at sorry!!!! Can you give me a general ideal if I post my code? or part of it?

Posted

Well this is how mines look.

 

Any suggestions? here is my site so you can see how it shows. http://www.snsdealz.com

 

define('TEXT_MAIN', 'This is a default setup of osCommerce Online Merchant. Products shown are for demonstrational purposes. <b>Any products purchased will not be delivered nor will the customer be billed</b>. Any information seen on these products is to be treated as fictional.<br><br><table border="0" width="100%" cellspacing="5" cellpadding="2"><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/1.gif') . '</td><td class="main" valign="top"><b>Error Messages</b><br><br>If there are any error or warning messages shown above, please correct them first before proceeding.<br><br>Error messages are displayed at the very top of the page with a complete <span class="messageStackError">background</span> color.<br><br>Several checks are performed to ensure a healthy setup of your online store - these checks can be disabled by editing the appropriate parameters at the bottom of the includes/application_top.php file.</td></tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/2.gif') . '</td><td class="main" valign="top"><b>Editing Page Texts</b><br><br>The text shown here can be modified in the following file, on each language basis:<br><br><nobr class="messageStackSuccess">[path to catalog]/includes/languages/' . $language . '/' . FILENAME_DEFAULT . '</nobr><br><br>That file can be edited manually, or via the Administration Tool with the <nobr class="messageStackSuccess">Languages->' . ucfirst($language) . '->Define</nobr> or <nobr class="messageStackSuccess">Tools->File Manager</nobr> modules.<br><br>The text is set in the following manner:<br><br><nobr>define(\'TEXT_MAIN\', \'<span class="messageStackSuccess">This is a default setup of the osCommerce project...</span>\');</nobr><br><br>The text highlighted in green may be modified - it is important to keep the define() of the TEXT_MAIN keyword. To remove the text for TEXT_MAIN completely, the following example is used where only two single quote characters exist:<br><br><nobr>define(\'TEXT_MAIN\', \'\');</nobr><br><br>More information concerning the PHP define() function can be read <a href="http://www.php.net/define" target="_blank"><u>here</u></a>.</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/3.gif') . '</td><td class="main" valign="top"><b>Online Documentation</b><br><br>Online documentation can be read at the <a href="http://www.oscommerce.info" target="_blank"><u>osCommerce Knowledge Base</u></a> site.<br><br>Support is available at the <a href="http://www.oscommerce.com/support" target="_blank"><u>osCommerce Support Site</u></a>.</td></tr></table><br>If you wish to download the solution powering this shop, or if you wish to contribute to the osCommerce project, please visit the <a href="http://www.oscommerce.com" target="_blank"><u>support site of osCommerce</u></a>. This shop is running on <font color="#f0000"><b>' . PROJECT_VERSION . '</b></font>.');
define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');
define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');
define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');

Posted

Ok I'm guessing that one of the files is missing the code to include the Text_Main so which file would that be in?

Posted
oh look at the first line of the code you posted before define('TEXT_MAIN', 'put your text here');

 

I'm not understanding what you are saying sorry. But here is all of my code for the index.php file (I hope this is allowed)

 

<?php
/*
 $Id: $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2007 osCommerce

 Released under the GNU General Public License
*/

define('TEXT_MAIN', 'Your Store Text Here');
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');
}
?>

Posted

ok in includes/languages/english/index.php

 

replace this:

 

define('TEXT_MAIN', 'This is a default setup of osCommerce Online Merchant. Products shown are for demonstrational purposes. <b>Any products purchased will not be delivered nor will the customer be billed</b>. Any information seen on these products is to be treated as fictional.<br><br><table border="0" width="100%" cellspacing="5" cellpadding="2"><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/1.gif') . '</td><td class="main" valign="top"><b>Error Messages</b><br><br>If there are any error or warning messages shown above, please correct them first before proceeding.<br><br>Error messages are displayed at the very top of the page with a complete <span class="messageStackError">background</span> color.<br><br>Several checks are performed to ensure a healthy setup of your online store - these checks can be disabled by editing the appropriate parameters at the bottom of the includes/application_top.php file.</td></tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/2.gif') . '</td><td class="main" valign="top"><b>Editing Page Texts</b><br><br>The text shown here can be modified in the following file, on each language basis:<br><br><nobr class="messageStackSuccess">[path to catalog]/includes/languages/' . $language . '/' . FILENAME_DEFAULT . '</nobr><br><br>That file can be edited manually, or via the Administration Tool with the <nobr class="messageStackSuccess">Languages->' . ucfirst($language) . '->Define</nobr> or <nobr class="messageStackSuccess">Tools->File Manager</nobr> modules.<br><br>The text is set in the following manner:<br><br><nobr>define(\'TEXT_MAIN\', \'<span class="messageStackSuccess">This is a default setup of the osCommerce project...</span>\');</nobr><br><br>The text highlighted in green may be modified - it is important to keep the define() of the TEXT_MAIN keyword. To remove the text for TEXT_MAIN completely, the following example is used where only two single quote characters exist:<br><br><nobr>define(\'TEXT_MAIN\', \'\');</nobr><br><br>More information concerning the PHP define() function can be read <a href="http://www.php.net/define" target="_blank"><u>here</u></a>.</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/3.gif') . '</td><td class="main" valign="top"><b>Online Documentation</b><br><br>Online documentation can be read at the <a href="http://www.oscommerce.info" target="_blank"><u>osCommerce Knowledge Base</u></a> site.<br><br>Support is available at the <a href="http://www.oscommerce.com/support" target="_blank"><u>osCommerce Support Site</u></a>.</td></tr></table><br>If you wish to download the solution powering this shop, or if you wish to contribute to the osCommerce project, please visit the <a href="http://www.oscommerce.com" target="_blank"><u>support site of osCommerce</u></a>. This shop is running on <font color="#f0000"><b>' . PROJECT_VERSION . '</b></font>.');

 

with this:

 

define('TEXT_MAIN', 'put your text here');

 

replace put your text here with what you want to be displayed on the page..

Posted

Nope that didn't work. I changed it to that and still only showing products on main page. I'm guessing because it's a template I might have to change something like application_top.php or something else. Not sure but I'm guessing one of those files is missing something to prompt the TEXT_MAIN function.???

Posted
did you upload the file to the server in the correct place and refresh the page?

 

I edited in the File Manager in my Cpanel. Do you see it on my site? http://www.snsdealz.com ?

Posted
okay now that you put up a link tell what you want to change?

 

I don't want to change anything on the left side but the right side. I want to put something like a welcome message on top of the products their, where I can have current promotions/sells and what not. I'm going to be adding the Point Module and wanted to have a small intro to that with a link with more information.

Posted

looking at the page source I see this:

 

<!-- body_text //-->

<td width="100%" class="col_center">

 

<table border="0" width="100%" cellspacing="0" cellpadding="0" class="cont_header_txt">

<tr>

 

<td>What's New Here?</td>

</tr>

</table>

 

<table cellpadding="0" cellspacing="0" border="0">

<tr><td style="padding:0px 0px 0px 0px;">

 

 

I don't know how your template is constructed but if you search for this bit of code you can insert what you want into this table..

Posted

Ok I think I found something but it is in

/includes/boxes/whats_new.php

 

 

The RED is where I'm guessing I would change or try to change/add my coding? What you think?

 

if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) {

?>

<!-- whats_new //-->

<tr>

<td class="">

<?php

$random_product['products_name'] = tep_get_products_name($random_product['products_id']);

$random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']);

 

$info_box_contents = array();

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

 

new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW));

 

if (tep_not_null($random_product['specials_new_products_price'])) {

 

$name_prod = '

<span><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . substr( $random_product['products_name'],0,MAX_DESCR_NAME_BOX) . '</a></span>

';

 

$whats_new_price = '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s>     ';

$whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>';

} else {

$whats_new_price = '<span class="productSpecialPrice">'.$currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])).'</span>';

 

$name_prod = '

<span><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . substr( $random_product['products_name'],0,MAX_DESCR_NAME_BOX) . '</a></span>

';

}

Posted

Well that didn't work.

 

Anyone please help lol

Posted

You want this to be put in under Top Selling Items and above the products correct?

Post your catalog/index.php file so we can see what it is calling so we can get you to it.

Posted
You want this to be put in under Top Selling Items and above the products correct?

Post your catalog/index.php file so we can see what it is calling so we can get you to it.

 

 

Well actually I want it on above "Top Selling Items" if at all possible. I was messing around with it and I can put it under "Top Selling Items" but not above that. Should I still post the index.php file?

Posted

Thats a little more tricky because that could throw off the layout of your design. If you have to have it above then I would almost suggest putting it in the header.php, but then it would show on every page and I don't think thats what you want. Although I'm sure it could be worked in with an if statement.

How exactly do want it to appear on your site?

Posted
Thats a little more tricky because that could throw off the layout of your design. If you have to have it above then I would almost suggest putting it in the header.php, but then it would show on every page and I don't think thats what you want. Although I'm sure it could be worked in with an if statement.

How exactly do want it to appear on your site?

 

Well for right now I just want to have it right over the "Top Selling Items" or even under the the MENU - NEW PRODUCTS - SPECIALS - MY ACCOUNT - CONTACT US.

 

My main thing is I just want it lined up right. I'm sure once I actually figure out how to get it to show in one of those places I can work it to look right. But if I can do an "if statement" in the Header that would be GREAT. Could I use the same one as it uses in the index.php? I know how to edit php but don't KNOW IT if you know what I mean.

Posted

Then I would suggest the header.php for now. Lets atleast get something there.Post your header.php and what you want in there and we will give it a shot.

BTW I know exactly what you mean. I'm the same way

Posted
Then I would suggest the header.php for now. Lets atleast get something there.Post your header.php and what you want in there and we will give it a shot.

BTW I know exactly what you mean. I'm the same way

 

Thanks man I would Just like it to say:

Welcome to SnS Dealz - They Got the Bapes?

Yeah We Got It 2

 

header.php Code:

<?php
/*
 $Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// check if the 'install' directory exists, and warn of its existence
 if (WARN_INSTALL_EXISTENCE == 'true') {
if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) {
  $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning');
}
 }

// check if the configure.php file is writeable
 if (WARN_CONFIG_WRITEABLE == 'true') {
if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) {
  $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning');
}
 }

// check if the session folder is writeable
 if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') {
if (STORE_SESSIONS == '') {
  if (!is_dir(tep_session_save_path())) {
	$messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning');
  } elseif (!is_writeable(tep_session_save_path())) {
	$messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning');
  }
}
 }

// check session.auto_start is disabled
 if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) {
if (ini_get('session.auto_start') == '1') {
  $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning');
}
 }

 if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) {
if (!is_dir(DIR_FS_DOWNLOAD)) {
  $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning');
}
 }

 if ($messageStack->size('header') > 0) {
echo $messageStack->output('header');
 }
?>
<!-- start -->
<table cellpadding="0" cellspacing="0" border="0" style="width:708px" align="center"> 
<tr>
	<td>
		<table cellpadding="0" cellspacing="0" border="0" style="height:425px">
			<tr>
				<td>
					<table cellpadding="0" cellspacing="0" border="0" style="height:68px; background:url(images/top.gif)" class="header">
						<tr>
							<td><?php echo tep_image(DIR_WS_IMAGES.'q1.gif')?></td>
							<td>
								<table cellpadding="0" cellspacing="0" border="0" style="width:68px">
									<tr>
										<td>
											<strong><?php echo BOX_HEADING_LANGUAGES?>:</strong><br>
										</td>
									</tr>
								</table>
							</td>
							<td>
								<table cellpadding="0" cellspacing="0" border="0" style="width:103px">
									<tr>
										<td><?php
if (!isset($lng) || (isset($lng) && !is_object($lng))) {
include(DIR_WS_CLASSES . 'language.php');
$lng = new language;
}
$languages_string = '';
reset($lng->catalog_languages);
while (list($key, $value) = each($lng->catalog_languages)) {
$languages_string .= '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a>  ';
}
echo $languages_string;
?><br></td>
									</tr>
								</table>
							</td>
							<td><?php echo tep_image(DIR_WS_IMAGES.'z.gif')?></td>
							<td><?php echo tep_draw_separator('spacer.gif', '19', '1'); ?></td>	
							<td>
								<table cellpadding="0" cellspacing="0" border="0" style="width:20px">
									<tr>
										<td><?php echo tep_image(DIR_WS_IMAGES.'z1.gif')?><br></td>
									</tr>
								</table>
							</td>
							<td>
								<table cellpadding="0" cellspacing="0" border="0" style="width:226px">
									<tr>
										<td><strong><?php echo BOX_HEADING_SHOPPING_CART?>  </strong><a href="<?php echo tep_href_link('shopping_cart.php')?>"><?php echo $cart->count_contents()?> <?php echo BOX_SHOPPING_CART_EMPTY?></a><br></td>
									</tr>
								</table>
							</td>
							<td><?php echo tep_image(DIR_WS_IMAGES.'z.gif')?></td>
							<td><?php echo tep_draw_separator('spacer.gif', '21', '1'); ?></td>
							<td>
								<table cellpadding="0" cellspacing="0" border="0" style="width:69px">
									<tr>
										<td>
											<strong><?php echo BOX_HEADING_CURRENCIES?>:</strong><br>
										</td>
									</tr>
								</table>
							</td>
							<td>
								<table cellpadding="0" cellspacing="0" border="0" style="width:121px">
									<tr>
										<td><?php
echo tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get');
reset($currencies->currencies);
$currencies_array = array();
while (list($key, $value) = each($currencies->currencies)) {
  $currencies_array[] = array('id' => $key, 'text' => $value['title']);
}
$hidden_get_variables = '';
reset($HTTP_GET_VARS);
while (list($key, $value) = each($HTTP_GET_VARS)) {
  if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
	$hidden_get_variables .= tep_draw_hidden_field($key, $value);
  }
}
echo tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" class="jamp"') . $hidden_get_variables . tep_hide_session_id();
echo '</form>';
?></td>
									</tr>
								</table>
							</td>
							<td><?php echo tep_image(DIR_WS_IMAGES.'q2.gif')?></td>
						</tr>
					</table>
					<table cellpadding="0" cellspacing="0" border="0" style="height:357px">
						<tr>
							<td>
								<br style="line-height:15px">
								<a href="<?php echo tep_href_link('index.php')?>"><?php echo tep_image(DIR_WS_IMAGES.'p.jpg')?></a><br>
								<a href="<?php echo tep_href_link('index.php')?>"><?php echo tep_image_button('m1.gif')?></a><a href="<?php echo tep_href_link('products_new.php')?>"><?php echo tep_image_button('m2.gif')?></a><a href="<?php echo tep_href_link('specials.php')?>"><?php echo tep_image_button('m3.gif')?></a><a href="<?php echo tep_href_link('account.php')?>"><?php echo tep_image_button('m4.gif')?></a><a href="<?php echo tep_href_link('contact_us.php')?>"><?php echo tep_image_button('m5.gif')?></a><br>	
								<?php echo tep_image(DIR_WS_IMAGES.'li.gif')?><br>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
<!-- end -->
<?php
 if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr class="headerError">
<td class="headerError"><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></td>
 </tr>
</table>
<?php
 }

 if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr class="headerInfo">
<td class="headerInfo"><?php echo htmlspecialchars($HTTP_GET_VARS['info_message']); ?></td>
 </tr>
</table>
<?php
 }
?>
<!-- start -->
	</td>
</tr>
<tr>
	<td style="background:#272727;">
<!-- end -->

<?php 
define(MAX_DESCR_1,'50');

define(MAX_DESCR_NAME,'35');
define(MAX_DESCR_NAME_SHOPPCART,'35');
define(MAX_DESCR_BESTS,'19');
define(MAX_DESCR_REVIEWS,'50');
define(MAX_DESCR_NAME_BOX,'15');
?>

 

Hope that's not too much ;)

Posted

Find this section

 

<table cellpadding="0" cellspacing="0" border="0" style="height:357px">

<tr>

<td>

<br style="line-height:15px">

<a href="<?php echo tep_href_link('index.php')?>"><?php echo tep_image(DIR_WS_IMAGES.'p.jpg')?></a><br>

<a href="<?php echo tep_href_link('index.php')?>"><?php echo tep_image_button('m1.gif')?></a><a href="<?php echo tep_href_link('products_new.php')?>"><?php echo tep_image_button('m2.gif')?></a><a href="<?php echo tep_href_link('specials.php')?>"><?php echo tep_image_button('m3.gif')?></a><a href="<?php echo tep_href_link('account.php')?>"><?php echo tep_image_button('m4.gif')?></a><a href="<?php echo tep_href_link('contact_us.php')?>"><?php echo tep_image_button('m5.gif')?></a><br>

<?php echo tep_image(DIR_WS_IMAGES.'li.gif')?><br>

</td>

</tr>

</table>

</td>

</tr>

</table>

<!-- end -->

 

Inbetween the </table> and </td> towards the bottom add this

<table cellpadding="0" cellspacing="0" border="0">
 <tr>
   <td><?php echo TEXT_MAIN; ?></td>
 </tr>
</table>

Then in your catalog/includes/languages/english/index.php file edit define('TEXT_MAIN', 'your info here');

Like

define('TEXT_MAIN', 'Welcome to SnS Dealz - They Got the Bapes?<BR>
Yeah We Got It 2');

I used the text_main part because it does not appear that you are using it. If you are using then change TEXT_MAIN to something els in both files.

Archived

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

×
×
  • Create New...