Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding a new box ( Help Required )


jackgilbert

Recommended Posts

I have had a go at attempting to create a new box. Inside this new box i wanted a flash file. I have uploaded the flash file into my server. I then opened up notepad and tpyed in the following to add a new box:

<?php
/*
$Id: information.php,v 1.6 2003/02/10 22:31:00 hpdl Exp $

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

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/
?>
<!-- Welcome speech //-->
<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_WELCOME_SPEECH);

new infoBoxHeading($info_box_contents, false, false);

$info_box_contents = array();
$info_box_contents[] = array('text' => 
'<object id="music2" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" height="100" width="100" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param value="music2.swf" name="movie">
<param value="false" name="loop">
<param value="best" name="quality">
<param value="#6699CC" name="bgcolor"></object>');

new infoBox($info_box_contents);
?>
</td>
</tr>

 

I wanted my new box to be called: Welcome Speech.

 

After i did this i uploaded this welcome_speech.php to my server under catalog/includes/boxes

 

I then edited the left_column.php file and added in my new box "welcome_speech"

 

Here is my left_column.php file:

 

<?php
/*
$Id: column_left.php,v 1.1 2003/09/08 19:26:22 jhtalk Exp jhtalk $

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

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/
// STS: ADD
$sts_block_name = 'header2columnleft';
require(STS_RESTART_CAPTURE);
// STS: EOADD

if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_categories_box();
} else {
include(DIR_WS_BOXES . 'categories.php');
}

// STS: ADD
$sts_block_name = 'categorybox';
require(STS_RESTART_CAPTURE);
// STS: EOADD

if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_manufacturers_box();
} else {
include(DIR_WS_BOXES . 'manufacturers.php');
}

// STS: ADD
$sts_block_name = 'manufacturerbox';
require(STS_RESTART_CAPTURE);
// STS: EOADD

require(DIR_WS_BOXES . 'whats_new.php');

// STS: ADD
$sts_block_name = 'whatsnewbox';
require(STS_RESTART_CAPTURE);
// STS: EOADD

require(DIR_WS_BOXES . 'search.php');

// STS: ADD
$sts_block_name = 'searchbox';
require(STS_RESTART_CAPTURE);
// STS: EOADD

require(DIR_WS_BOXES . 'welcome_speech.php');

// STS: ADD
$sts_block_name = 'welcomespeechbox';
require(STS_RESTART_CAPTURE);
// STS: EOADD

require(DIR_WS_BOXES . 'information.php');

// STS: ADD
$sts_block_name = 'informationbox';
require(STS_RESTART_CAPTURE);
// STS: EOADD

require(DIR_WS_BOXES . 'shopping_cart.php');

// STS: ADD
$sts_block_name = 'cartbox';
require(STS_RESTART_CAPTURE);
// STS: EOADD

if (isset($HTTP_GET_VARS['products_id'])) include(DIR_WS_BOXES . 'manufacturer_info.php');

// STS: ADD
$sts_block_name = 'maninfobox';
require(STS_RESTART_CAPTURE);
// STS: EOADD

if (tep_session_is_registered('customer_id')) include(DIR_WS_BOXES . 'order_history.php');

// STS: ADD
$sts_block_name = 'orderhistorybox';
require(STS_RESTART_CAPTURE);
// STS: EOADD

if (isset($HTTP_GET_VARS['products_id'])) {
if (tep_session_is_registered('customer_id')) {
$check_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "' and global_product_notifications = '1'");
$check = tep_db_fetch_array($check_query);
if ($check['count'] > 0) {
include(DIR_WS_BOXES . 'best_sellers.php');
} else {
include(DIR_WS_BOXES . 'product_notifications.php');
}
} else {
include(DIR_WS_BOXES . 'product_notifications.php');
}
} else {
include(DIR_WS_BOXES . 'best_sellers.php');
}

// STS: ADD
$sts_block_name = 'bestsellersbox';
require(STS_RESTART_CAPTURE);
// STS: EOADD

if (isset($HTTP_GET_VARS['products_id'])) {
if (basename($PHP_SELF) != FILENAME_TELL_A_FRIEND) include(DIR_WS_BOXES . 'tell_a_friend.php');
} else {
include(DIR_WS_BOXES . 'specials.php');
}

// STS: ADD
$sts_block_name = 'specialfriendbox';
require(STS_RESTART_CAPTURE);
// STS: EOADD

if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
include(DIR_WS_BOXES . 'languages.php');

// STS: ADD
$sts_block_name = 'languagebox';
require(STS_RESTART_CAPTURE);
// STS: EOADD

include(DIR_WS_BOXES . 'currencies.php');

// STS: ADD
$sts_block_name = 'currenciesbox';
require(STS_RESTART_CAPTURE);
// STS: EOADD

}

?>

 

I then uploaded this to its original directory.

 

I then type in my store URL ( www.tignesinteriors.swsfreeserver.com/store ) and i notice that the new box which i have just created is not appearing. Can anyone help me please? Is it something i need to type in any other files. If so Please reply back A.S.A.P

 

Thanks,

Jack

Link to comment
Share on other sites

No i am not, ive just uploaded a downloaded template to the rightful directories. please can u help me?

Will i need sts to get it working or something?

 

 

Well from the cod eit is very clear that your site uses STS template.

 

So you need to mopdify display page also.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

How do i modify the display page? Please can you give me instructions as simple as possible and maybe if its possible can you post a code for the display page or tell me what to do and where to locate the display page.

Thanks in advance,

 

Jack.

Link to comment
Share on other sites

Please can someone help me, Thanks in advance,

Jack

HI,

Where you want to add the display box.In the left column or the right column or in the center.

 

You can expect reply if you are some what specific.

 

If left column go to includes/column_left.php and add include(>>>) see how includes is done for categories.

 

Now you take a code from either categorie.php or any ither file and modify the code and place it at proper place.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

Thanks but i have edited the column_left.php file as above at the top of the forum with my new box "welcome speech" in.

Ive also edited the welcome speech ( the flash file box )

and uploaded these files to their rightful directories.

Please can you tell me what code and things like that to paste in and why isnt my new box appearing?

www.tignesinteriors.swsfreeserver.com/store

Link to comment
Share on other sites

Thanks but i have edited the column_left.php file as above at the top of the forum with my new box "welcome speech" in.

Ive also edited the welcome speech ( the flash file box )

and uploaded these files to their rightful directories.

Please can you tell me what code and things like that to paste in and why isnt my new box appearing?

www.tignesinteriors.swsfreeserver.com/store

 

 

Hello,

Checked the source of file and didnt find anycode.

 

Can you paste your left column and the box code.

 

 

Satish Mantri

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

my new box's code is as follows:

<?php
/*
$Id: welcome_speech.php,v 1.6 2003/02/10 22:31:00 hpdl Exp $

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

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/
?>
<!-- Welcome speech //-->
<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_WELCOME_SPEECH);

new infoBoxHeading($info_box_contents, false, false);

$info_box_contents = array();
$info_box_contents[] = array('text' => 
'<object id="music2" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" height="100" width="100" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param value="music2.swf" name="movie">
<param value="false" name="loop">
<param value="best" name="quality">
<param value="#6699CC" name="bgcolor"></object>');

new infoBox($info_box_contents);
?>
</td>
</tr>
<!-- welcome_speech //-->

 

and my column_left code is as follows:

 

<?php
/*
 $Id: column_left.php,v 1.1 2003/09/08 19:26:22 jhtalk Exp jhtalk $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
 // STS: ADD
 $sts_block_name = 'header2columnleft';
 require(STS_RESTART_CAPTURE);
 // STS: EOADD

 if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_categories_box();
 } else {
include(DIR_WS_BOXES . 'categories.php');
 }

 // STS: ADD
 $sts_block_name = 'categorybox';
 require(STS_RESTART_CAPTURE);
 // STS: EOADD

 if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_manufacturers_box();
 } else {
include(DIR_WS_BOXES . 'manufacturers.php');
 }

 // STS: ADD
 $sts_block_name = 'manufacturerbox';
 require(STS_RESTART_CAPTURE);
 // STS: EOADD

 require(DIR_WS_BOXES . 'whats_new.php');

 // STS: ADD
 $sts_block_name = 'whatsnewbox';
 require(STS_RESTART_CAPTURE);
 // STS: EOADD

 require(DIR_WS_BOXES . 'search.php');

 // STS: ADD
 $sts_block_name = 'searchbox';
 require(STS_RESTART_CAPTURE);
 // STS: EOADD

require(DIR_WS_BOXES . 'welcome_speech.php');

 // STS: ADD
 $sts_block_name = 'welcomespeechbox';
 require(STS_RESTART_CAPTURE);
 // STS: EOADD

 require(DIR_WS_BOXES . 'information.php');

 // STS: ADD
 $sts_block_name = 'informationbox';
 require(STS_RESTART_CAPTURE);
 // STS: EOADD

 require(DIR_WS_BOXES . 'shopping_cart.php');

 // STS: ADD
 $sts_block_name = 'cartbox';
 require(STS_RESTART_CAPTURE);
 // STS: EOADD

 if (isset($HTTP_GET_VARS['products_id'])) include(DIR_WS_BOXES . 'manufacturer_info.php');

 // STS: ADD
 $sts_block_name = 'maninfobox';
 require(STS_RESTART_CAPTURE);
 // STS: EOADD

 if (tep_session_is_registered('customer_id')) include(DIR_WS_BOXES . 'order_history.php');

 // STS: ADD
 $sts_block_name = 'orderhistorybox';
 require(STS_RESTART_CAPTURE);
 // STS: EOADD

 if (isset($HTTP_GET_VARS['products_id'])) {
if (tep_session_is_registered('customer_id')) {
  $check_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "' and global_product_notifications = '1'");
  $check = tep_db_fetch_array($check_query);
  if ($check['count'] > 0) {
	include(DIR_WS_BOXES . 'best_sellers.php');
  } else {
	include(DIR_WS_BOXES . 'product_notifications.php');
  }
} else {
  include(DIR_WS_BOXES . 'product_notifications.php');
}
 } else {
include(DIR_WS_BOXES . 'best_sellers.php');
 }

 // STS: ADD
 $sts_block_name = 'bestsellersbox';
 require(STS_RESTART_CAPTURE);
 // STS: EOADD

 if (isset($HTTP_GET_VARS['products_id'])) {
if (basename($PHP_SELF) != FILENAME_TELL_A_FRIEND) include(DIR_WS_BOXES . 'tell_a_friend.php');
 } else {
include(DIR_WS_BOXES . 'specials.php');
 }

 // STS: ADD
 $sts_block_name = 'specialfriendbox';
 require(STS_RESTART_CAPTURE);
 // STS: EOADD

 if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
include(DIR_WS_BOXES . 'languages.php');

// STS: ADD
$sts_block_name = 'languagebox';
require(STS_RESTART_CAPTURE);
// STS: EOADD

include(DIR_WS_BOXES . 'welcome_speech.php');

 // STS: ADD
 $sts_block_name = 'welcomespeechbox';
 require(STS_RESTART_CAPTURE);
 // STS: EOADD

include(DIR_WS_BOXES . 'currencies.php');

// STS: ADD
$sts_block_name = 'currenciesbox';
require(STS_RESTART_CAPTURE);
// STS: EOADD

 }

?>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...