Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

problem adding new box on left hand side


Guest

Recommended Posts

HI,

 

Having problems adding a new box to the left hand of my site, above the Information and below the quick find

 

 

Tryed looking at

http://www.oscommerce.info/docs/english/e_add_box_page.html

http://www.oscommerce.info/kb/Catalog_Guid...g_Area/Boxes/66

 

but the code they show gives me errors and there other example scripts dont look like what i seem to have in my files?

 

trying to add a box with 3 links to other pages and a title

 

 

any help would be good

Link to comment
Share on other sites

Boxes are added in catalog/includes/column_left.php

Link to comment
Share on other sites

yeah i read that bit in that file i have

 

<?php
/*
 $Id: column_left.php,v 1.15 2003/07/01 14:34:54 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

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

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



?>

 

it says add the below

 

<tr>
 <td>
##BOX CONTENT HERE##
 </td>
</tr>

 

which would mak it look like this wouldnt it,

<?php
/*
 $Id: column_left.php,v 1.15 2003/07/01 14:34:54 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

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

 if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_manufacturers_box();
 } else {
//include(DIR_WS_BOXES . 'manufacturers.php');
}
<tr>
 <td>
##BOX CONTENT HERE##
 </td>
</tr>

 require(DIR_WS_BOXES . 'whats_new.php');
require(DIR_WS_BOXES . 'search.php');
require(DIR_WS_BOXES . 'information.php');



?>

 

but i get an error

Link to comment
Share on other sites

Or more in keeping with osCommerce coding use the below ..

 

 

<tr>
<td>
<?php
 // Enter your heading between the two '' below replacing  MY HEADING
 $my_box_heading = 'MY HEADING';
 // Enter your box text between the two '' below replacing  MY BOX TEXT
 $my_box_text = 'MY BOX TEXT';
 $info_box_contents = array();
 $info_box_contents[] = array('text' => htmlspecialchars($my_box_heading));

 new infoBoxHeading($info_box_contents, false, false);

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

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

Link to comment
Share on other sites

does this look ok?

 

 

<?php

/*

$Id: column_left.php,v 1.15 2003/07/01 14:34:54 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

if ((USE_CACHE == 'true') && empty($SID)) {

echo tep_cache_categories_box();

} else {

include(DIR_WS_BOXES . 'categories.php');

}

 

if ((USE_CACHE == 'true') && empty($SID)) {

echo tep_cache_manufacturers_box();

} else {

//include(DIR_WS_BOXES . 'manufacturers.php');

}

 

<tr>

<td>

<?php

// Enter your heading between the two '' below replacing MY HEADING

$my_box_heading = 'Guides etc';

// Enter your box text between the two '' below replacing MY BOX TEXT

$my_box_text = '<a href="guides.php">Guides</a><br>

<a href="wholesale.php">Wholesale</a>';

$info_box_contents = array();

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

 

new infoBoxHeading($info_box_contents, false, false);

 

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

 

new infoBox($info_box_contents);

?>

</td>

</tr>

require(DIR_WS_BOXES . 'whats_new.php');

require(DIR_WS_BOXES . 'search.php');

require(DIR_WS_BOXES . 'information.php');

 

 

 

?>

Link to comment
Share on other sites

ok thats not it get Parse error: syntax error, unexpected '<' in /home/socom/domains/socomtactical.net/public_html/includes/column_left.php on line 24

Link to comment
Share on other sites

echo '
<tr>
<td>';
// Enter your heading between the two '' below replacing MY HEADING
$my_box_heading = 'Guides etc';
// Enter your box text between the two '' below replacing MY BOX TEXT
$my_box_text = '<a href="guides.php">Guides</a><br>
<a href="wholesale.php">Wholesale</a>';
$info_box_contents = array();
$info_box_contents[] = array('text' => htmlspecialchars($my_box_heading));

new infoBoxHeading($info_box_contents, false, false);

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

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

 

Is the actual code if you are placing it in column_left.php as you suggest

Link to comment
Share on other sites

hmm getting there says Guides etc in the header and in the main section and when i put the <a href="guides.php">Guides</a><br>

<a href="wholesale.php">Wholesale</a> after the my box text it just shows <a href="guides.php">Guides</a><br>

<a href="wholesale.php">Wholesale</a> not showing links

Link to comment
Share on other sites

Link to comment
Share on other sites

echo '
<tr>
<td>';
$info_box_contents = array();
$info_box_contents[] = array('text' => htmlspecialchars('Guides etc'));

new infoBoxHeading($info_box_contents, false, false);

 $info_box_contents[] = array('text' => '<a href="' . tep_href_link('guides.php') . '">' . htmlspecialchars('Guides') . '</a><br />' .
									 '<a href="' . tep_href_link('wholesale.php') . '">' . htmlspecialchars('Wholesale') . '</a><br />');

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

Link to comment
Share on other sites

Then you have put the extra Guides etc line in there somewhere.

Link to comment
Share on other sites

<?php

/*

$Id: column_left.php,v 1.15 2003/07/01 14:34:54 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

if ((USE_CACHE == 'true') && empty($SID)) {

echo tep_cache_categories_box();

} else {

include(DIR_WS_BOXES . 'categories.php');

}

 

if ((USE_CACHE == 'true') && empty($SID)) {

echo tep_cache_manufacturers_box();

} else {

//include(DIR_WS_BOXES . 'manufacturers.php');

}

 

echo '

<tr>

<td>';

$info_box_contents = array();

$info_box_contents[] = array('text' => htmlspecialchars('Guides etc'));

 

new infoBoxHeading($info_box_contents, false, false);

 

$info_box_contents[] = array('text' => '<a href="' . tep_href_link('guides.php') . '">' . htmlspecialchars('Guides') . '</a><br />' .

'<a href="' . tep_href_link('wholesale.php') . '">' . htmlspecialchars('wholesale') . '</a><br />');

 

new infoBox($info_box_contents);

echo '

</td>

</tr>';

 

require(DIR_WS_BOXES . 'whats_new.php');

require(DIR_WS_BOXES . 'search.php');

require(DIR_WS_BOXES . 'information.php');

 

 

 

?>

 

 

thats my left com file,

 

also what code is it i include so http://socomtactical.net/guides.php includes all the shopping cart details ie header left right etc?

Link to comment
Share on other sites

Oooops

 

echo '
<tr>
<td>';
$info_box_contents = array();
$info_box_contents[] = array('text' => htmlspecialchars('Guides etc'));

new infoBoxHeading($info_box_contents, false, false);
$info_box_contents = array();
$info_box_contents[] = array('text' => '<a href="' . tep_href_link('guides.php') . '">' . htmlspecialchars('Guides') . '</a><br />' .
									 '<a href="' . tep_href_link('wholesale.php') . '">' . htmlspecialchars('Wholesale') . '</a><br />');

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

Link to comment
Share on other sites

thanks mate, doing it this way do i still need to edit all the other files? so you can see the shopping cart etc on guides.php etc

Link to comment
Share on other sites

I imagine it's just standard header, column_left, column_right, footer stuff.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...