Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

making an info box


kewldude_3001

Recommended Posts

You can make changes to an info box you are not using by changing the language wording and gut out the php code but leaving in the php start and end tags, and put in html with your images inside. Or you could use one of the anything info box contribs.

Link to comment
Share on other sites

Okay, here's what I just did... (you'll need to make some mods of course)...

 

(1) I created a new file called catalog/includes/boxes/custombox.php. In it, I have this code...

<?php
/*  custombox.php -- v0.1  */
?>
<!-- START: Do custom stuff here. -->
	  <tr>
		<td>
<?php
// Create the box outline and heading...
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_CUSTOMBOX);
new infoBoxHeading($info_box_contents, false, false);	// T/F's for left and right corners resp.


// Fill the box with stuff...
$info_box_contents = array();
$info_box_contents[] = array('text' => '<img src="images/pymt_icons_pp.gif" width="59" height="22"><br><br>' .
									 '<img src="images/pymt_icons_4cc.gif" width="140" height="22"><br><br>' .
									 '<img src="images/quickssl_anim.gif"><br>');

new infoBox($info_box_contents);
?>
		</td>
	  </tr>
<!-- END: Do custom stuff here. //-->

 

 

(2) I added a definition for BOX_HEADING_CUSTOMBOX in the file catalog/includes/languages/english.php by adding these two lines...

// custom_box box text in includes/boxes/custombox.php
define('BOX_HEADING_CUSTOMBOX', 'This box is mine!');

 

 

(3) I put the box on the left of the screen by adding this code near the end of catalog/includes/column_left.php...

 require(DIR_WS_BOXES . 'custombox.php');

 

 

That's it. You can see my sample (on a test-setup of osC I created) here.

 

Cheers,

-Neil.

Link to comment
Share on other sites

For a center box below the what's New box your add this piece of code just below the new products

 

<tr>

<td class="main"><?php echo TEXT_MAIN_2; ?></td>

</tr>

 

It will look like this:

		  <tr>
		<td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
	  </tr>
<?php
include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
?>
	<tr>
		<td class="main"><?php echo TEXT_MAIN_2; ?></td>
	  </tr>


	</table></td>

 

Then open your includes/languages/english/index.php and add this code just below the

 

define('TEXT_MAIN', 'Text that appears above your what's new box');

 

Add text define('TEXT_MAIN_2', 'this is the format area of your new html box with images and or text ');

Link to comment
Share on other sites

what would be the code if i wanted whats in text_main to be inside the box/table.

 

would it be:

 

<tr>
		<td class="main"><?php echo TEXT_MAIN; ?></td>
	  </tr>

 

added before:

 

<tr>
		<td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?>
		</td>
	 </tr>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...