Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding Side infobox on the left


K0rd3rbackStyl3

Recommended Posts

Posted

I wanted to add two new info boxes displaying pictures. 1 of them is a paypal verified box with the logo and another thats a ssl encrypted box with logo (will upload to ssl later)

 

I made a file called paypalv.php:

 

<?php
<?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
*/
?>
<!-- information //-->
	 <tr>
	   <td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_PAYPALV);
new infoBoxHeading($info_box_contents, false, false);

$info_box_contents = array();
$info_box_contents[] = array('align' => 'center',
'text' => tep_image(DIR_WS_IMAGES . paypalv.jpg') );

//

new infoBox($info_box_contents);
?>

 

 

then I added this in the includes/languages/english.php

define('BOX_HEADING_PAYPALV', 'Paypal Verified');

 

 

now when I get to catalog/includes/column_left.php

 

This is what the file looks like:

<?php
/*
 $Id: column_left.php,v 1.1.1.1 2004/03/04 23:40:37 ccwjr Exp $

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

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/

 $column_query = tep_db_query('select display_in_column as cfgcol, infobox_file_name as cfgtitle, infobox_display as cfgvalue, infobox_define as cfgkey, box_heading, box_template, box_heading_font_color from ' . TABLE_INFOBOX_CONFIGURATION . ' where template_id = ' . TEMPLATE_ID . ' and infobox_display = "yes" and display_in_column = "left" order by location');
 while ($column = tep_db_fetch_array($column_query)) {

if ( file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/' . $column['cfgtitle'])) {
define($column['cfgkey'],$column['box_heading']);
$infobox_define = $column['box_heading'];
$infobox_template = $column['box_template'];
$font_color = $column['box_heading_font_color'];
$infobox_class = $column['box_template'];
//cache control side box detect
if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories4.php') ) {
 echo tep_cache_categories_box4();
} else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'manufacturers.php') ) {
 echo tep_cache_manufacturers_box();
} else {
require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/' . $column['cfgtitle']);
  }
  // end cache control code   
}else{
define($column['cfgkey'],$column['box_heading']);
$infobox_define = $column['box_heading'];
$infobox_template = $column['box_template'];
$font_color = $column['box_heading_font_color'];
$infobox_class = $column['box_template'];
require(DIR_WS_BOXES . $column['cfgtitle']);

}
}
?>

 

 

where should I put

require(DIR_WS_BOXES . paypalv.php');

 

I'm using a template by the way..

 

 

Thanks for any help you can provide.

Posted

basically you can add it where you want at the bottom in the middle just look at the code and make sure you aint cuttin something off.

 

Make sure you add the new filenames in the includes/filenames.php

 

O forgot to tell you, dont use require use include. Require tell the code that it has to be there and include means it doesnt have to be there. You also may have to put an else if statement in there as well for the nonsecure items issue with ssl.

Posted

It doesnt load my page correctly... :( it stops at the header and doesnt load anything else

 

this is what i have for column_left_php

 

 

<?php
/*
 $Id: column_left.php,v 1.1.1.1 2004/03/04 23:40:37 ccwjr Exp $

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

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/

 $column_query = tep_db_query('select display_in_column as cfgcol, infobox_file_name as cfgtitle, infobox_display as cfgvalue, infobox_define as cfgkey, box_heading, box_template, box_heading_font_color from ' . TABLE_INFOBOX_CONFIGURATION . ' where template_id = ' . TEMPLATE_ID . ' and infobox_display = "yes" and display_in_column = "left" order by location');
 while ($column = tep_db_fetch_array($column_query)) {

if ( file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/' . $column['cfgtitle'])) {
define($column['cfgkey'],$column['box_heading']);
$infobox_define = $column['box_heading'];
$infobox_template = $column['box_template'];
$font_color = $column['box_heading_font_color'];
$infobox_class = $column['box_template'];
//cache control side box detect
if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories4.php') ) {
 echo tep_cache_categories_box4();
} else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'manufacturers.php') ) {
 echo tep_cache_manufacturers_box();
} else {
require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/' . $column['cfgtitle']);
  }
  // end cache control code   
}else{
define($column['cfgkey'],$column['box_heading']);
$infobox_define = $column['box_heading'];
$infobox_template = $column['box_template'];
$font_color = $column['box_heading_font_color'];
$infobox_class = $column['box_template'];
require(DIR_WS_BOXES . $column['cfgtitle']);

}
}
require(DIR_WS_BOXES . paypalv.php');
?>

Posted

try this

 

$infobox_class = $column['box_template'];

require(DIR_WS_BOXES . $column['cfgtitle']);

require(DIR_WS_BOXES . paypalv.php');

 

}

}

?>

Posted

nope.. no go still only loads header..

 

heres what the column_left.php looks like:

<?php
/*
 $Id: column_left.php,v 1.1.1.1 2004/03/04 23:40:37 ccwjr Exp $

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

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/

 $column_query = tep_db_query('select display_in_column as cfgcol, infobox_file_name as cfgtitle, infobox_display as cfgvalue, infobox_define as cfgkey, box_heading, box_template, box_heading_font_color from ' . TABLE_INFOBOX_CONFIGURATION . ' where template_id = ' . TEMPLATE_ID . ' and infobox_display = "yes" and display_in_column = "left" order by location');
 while ($column = tep_db_fetch_array($column_query)) {

if ( file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/' . $column['cfgtitle'])) {
define($column['cfgkey'],$column['box_heading']);
$infobox_define = $column['box_heading'];
$infobox_template = $column['box_template'];
$font_color = $column['box_heading_font_color'];
$infobox_class = $column['box_template'];
//cache control side box detect
if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories4.php') ) {
 echo tep_cache_categories_box4();
} else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'manufacturers.php') ) {
 echo tep_cache_manufacturers_box();
} else {
require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/' . $column['cfgtitle']);
  }
  // end cache control code   
}else{
define($column['cfgkey'],$column['box_heading']);
$infobox_define = $column['box_heading'];
$infobox_template = $column['box_template'];
$font_color = $column['box_heading_font_color'];
$infobox_class = $column['box_template'];
require(DIR_WS_BOXES . $column['cfgtitle']);
$infobox_class = $column['box_template'];
require(DIR_WS_BOXES . $column['cfgtitle']);
require(DIR_WS_BOXES . paypalv.php');

}
}
?>

?>

Posted

you know what i did notice though was...

 

 

if i didnt edit the columns_left.php at all

 

and i added it using the infobox admin, it comes up.. but doesnt match the template layout..

 

 

take a look www.planet-animation.com/catalog/

Posted

i have

 

boxes.tpl.php

extra_html_output.php

footer.php

header.php

main_page.tpl.php

stylesheet.css

 

then 3 directories

mainpage_modules

images

boxes

 

all all their usual files

Posted

Ok look in your boxes.tpl.php, main_page.tpl.php, mainpage_modules, and boxes. Look for any other boxes that is in the left column and just copy the process for the new box and then you should have the new one show.

Posted

all of them are specific toward their own purpose, and with my lack of php knowledge i wouldnt know what to edit, but there sure is a lot of script....

 

 

did you happen to see my other post, 3 back... if i dont add anything to column left and add it using infobox admin it appears just not along with the template www.planet-animation.com/catalog/

Posted

Kool when you are completed ensure that your ssl works and that you dont get the "U have secure and unsecure items"

Posted

well i didn't install in the ssl directory. I didnt buy it until after the install, do you know how i could transfer everything in the ssl directoy after im done with everything without causing any conflicts, i doubt just dumping the whole catalog in the ssl folder will work. Thanks for your help! :)

Posted

Ok i took my script from a box that had a picture of paypal and credit cards (a 'we accept..' info box)

 

heres the script edited with the picture i want paypalv.JPG

 

<?php
/*
 Card Infobox, v 1.0 2002/12/04 by Kevin Park

 osCommerce
 http://www.oscommerce.com/

 Copyright (c) 2000,2001 osCommerce

 Released under the GNU General Public License

http://www.movion.com
go to any packages and see custom shop demo

 -------------------------------------------------------------------------------------------------------
 If you find my work usefull you can send me some money ...
 https://www.paypal.com/xclick/business=elari%40free.fr&item_name=elari&no_note=1&tax=0&currency_code=EUR
 If you need a custom install for Oscommerce, contact me....
 -------------------------------------------------------------------------------------------------------

*/
?>
<!-- Card Info Box //-->
	  <tr>
		<td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'left',
						   'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_PAYPALV . '</font>'
						  );
 new SideinfoBoxHeading($info_box_contents, false, false);

 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'center',
//							   'text'  => tep_image(DIR_WS_IMAGES . '/cards/cards.gif') .
//elari chanegd to provide a link to your payment acount
						   'text'  => tep_image(DIR_WS_IMAGES . 'cards/paypalv.JPG' , BOX_INFORMATION_CARD . MODULE_PAYMENT_PAYPAL_ID).
						   '<br>' . tep_image(DIR_WS_IMAGES . 'cards/cards2.gif', BOX_INFORMATION_CARD . MODULE_PAYMENT_PAYPAL_ID) . '</a><br>'
						   );

new SideinfoBox($info_box_contents);
?>
</td>
 <tr>
<th scope="row"><img src="templates/5324/images/infoBox_foot.jpg" width="158" height="27"></th>
 </tr>
<!-- card_eof //-->

 

However I can't stinkin get that card2.gif out by somehow ruining the php file and preventing my webpage from loading once it loads to this info box (wont load pass paypal verified infobox).

 

Can you show me what the code should look like, i think i'm deleting and interrupting other codes. Thanks again! :)

Posted

try this

$info_box_contents = array();
 $info_box_contents[] = array('align' => 'center',
						   'text'  => '<P><IMG HEIGHT=120 WIDTH=115 img src =" images/card2.gif"></P> <br>
									  <a href="https://www.paypal.com/us/verified/pal=XXXXXXXXXXX%2ecom" target="_blank"><img src="images/verification_seal.gif" border="0" alt="Official PayPal Seal"></A><br><b>Don\'t have a PayPal Account<br><a href="http://www.paypal.com" target="blank"><font color="blue">Click Here </font></a><br>To get a Free PayPal Account.');

new infoBox($info_box_contents);

 

the XXXX's is the email address for the javascript to go to the verification page of paypal

 

if you look under my profile you will see this in the column right on my site

Posted

thanks! I got it working.. YAY!! i really appreciate your help...

 

2 more things if i can..?

 

1. how can i marquee my bestsellers box like www.greatlakesanime.com (right side) not sure of the html code, where to put it, and how to include images..

 

2. how can i change the color of the boxes in the middle, for example, www.planet-animation.com if you click on account at the top, it comes up with 3 boxes in the middle which have red shades that are kind of bright.. i know its in the stylesheet.css but not sure what its under..

 

thanks again!! :)

Archived

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

×
×
  • Create New...