This is a discussion on combine the info box to categories box within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; hello, Need to know if it is possible to combine the links in the information box to the categories box. ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| hello, Need to know if it is possible to combine the links in the information box to the categories box. I would like to have just one nave bar with all my site links in it. You can see my modded categories box at www.fridgemags.com for a better idea. The links at the bottom left I would like to put up into the categories box. Thanx for any info |
| Sponsored Links | ||
| ||
|
#2
| |||
| |||
| Yes, open categories.php located in catalog/includes/boxes/ locate this bit of code, located around line 132 Code: $info_box_contents[] = array('text' => $categories_string);
Code: $info_box_contents[] = array('text' => $categories_string .
'<br><a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>');
__________________ There\'s something about fireman, day and night they are always fireman! |
|
#3
| |||
| |||
| thanx, worked like a charm. one more question now. is there a way to get the links to look the same as the rest of them? they dont have the line between them and the bullet infront of them. my code in my categries box is as follows. Code: <?php
/*
$Id: categories.php,v 1.23 2002/11/12 14:09:30 dgw_ Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2002 osCommerce
Released under the GNU General Public License
*/
function tep_show_category($counter) {
global $foo, $categories_string, $id, $aa;
for ($a=0; $a<$foo[$counter]['level']; $a++) {
if ($a == $foo[$counter]['level']-1)
{
$categories_string .= "<font color='#ff0000'>&nbsp;&nbsp;&nbsp;</font>";
} else
{
$categories_string .= "<font color='#ff0000'>&nbsp;&nbsp;&nbsp;&nbsp;</font>";
}
}
if ($foo[$counter]['level'] == 0)
{
if ($aa == 1)
{
$categories_string .= "<hr>";
}
else
{$aa=1;}
}
$categories_string .= '<nobr><a nowrap href="';
if ($foo[$counter]['parent'] == 0) {
$cPath_new = 'cPath=' . $counter;
} else {
$cPath_new = 'cPath=' . $foo[$counter]['path'];
}
$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
$categories_string .= '">' . tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif', '') . '&nbsp;';;
if ( ($id) && (in_array($counter, $id)) ) {
$categories_string .= "<b><font color='#ff0000'>";
}
// display category name
$categories_string .= $foo[$counter]['name'];
if ( ($id) && (in_array($counter, $id)) ) {
$categories_string .= '</font></b>';
}
// if (tep_has_category_subcategories($counter)) {
// $categories_string .= '-&gt;';
// }
$categories_string .= '</nobr></a>';
// if (SHOW_COUNTS == 'true') {
// $products_in_category = tep_count_products_in_category($counter);
// if ($products_in_category > 0) {
// $categories_string .= '&nbsp;(' . $products_in_category . ')';
// } }
$categories_string .= '<br>';
if ($foo[$counter]['next_id']) {
tep_show_category($foo[$counter]['next_id']);
}
}
?>
<!-- categories //-->
<tr>
<td>
<?php
$aa = 0;
$info_box_contents = array();
$info_box_contents[] = array('align' => 'left',
'text' => BOX_HEADING_CATEGORIES
);
new InfoBoxHeading($info_box_contents, true, false);
$categories_string = '';
// add links to products with no category
$product_query = tep_db_query("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = 0 and p.products_id = pd.products_id and pd.language_id ='" . (int)$languages_id . "' order by pd.products_name " );
while ($no_category = tep_db_fetch_array($product_query)) {
$no_cat_product_id = $no_category['products_id'];
$no_cat_products_name = $no_category['products_name'];
$myref = "<a href=" . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $no_cat_product_id) . '>' . $no_cat_products_name . '</a><br><br>';
$categories_string .= $myref;
}
// end links to products with no category
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
while ($categories = tep_db_fetch_array($categories_query)) {
$foo[$categories['categories_id']] = array(
'name' => $categories['categories_name'],
'parent' => $categories['parent_id'],
'level' => 0,
'path' => $categories['categories_id'],
'next_id' => false
);
if (isset($prev_id)) {
$foo[$prev_id]['next_id'] = $categories['categories_id'];
}
$prev_id = $categories['categories_id'];
if (!isset($first_element)) {
$first_element = $categories['categories_id'];
}
}
//------------------------
if ($cPath) {
$new_path = '';
$id = split('_', $cPath);
reset($id);
while (list($key, $value) = each($id)) {
unset($prev_id);
unset($first_id);
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
$category_check = tep_db_num_rows($categories_query);
if ($category_check > 0) {
$new_path .= $value;
while ($row = tep_db_fetch_array($categories_query)) {
$foo[$row['categories_id']] = array(
'name' => $row['categories_name'],
'parent' => $row['parent_id'],
'level' => $key+1,
'path' => $new_path . '_' . $row['categories_id'],
'next_id' => false
);
if (isset($prev_id)) {
$foo[$prev_id]['next_id'] = $row['categories_id'];
}
$prev_id = $row['categories_id'];
if (!isset($first_id)) {
$first_id = $row['categories_id'];
}
$last_id = $row['categories_id'];
}
$foo[$last_id]['next_id'] = $foo[$value]['next_id'];
$foo[$value]['next_id'] = $first_id;
$new_path .= '_';
} else {
break;
}
}
}
tep_show_category($first_element);
$info_box_contents = array();
$info_box_contents[] = array('align' => 'left',
'text' => $categories_string .
'<br><a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>');
// WebMakers.com Added: All products or All Products Multiple Purchase
// new infoBox($info_box_contents);
// WebMakers.com Added: Show All Products Listing
if (SHOW_ALL_PRODUCTS_BOX=='1') {
$info_box_contents[] = array('align' => 'center" valign="top',
'text' => '<hr><a href="' . tep_href_link(FILENAME_ALLPRODS, '', 'NONSSL') . '">' . BOX_INFORMATION_ALLPRODS . '</a>');
}
// WebMakers.com Added: Show multiple product listing add for all products
if (SHOW_PRODUCT_LISTINGS_MULTI_ADD_BOX=='1') {
// All Products Multiple Purchase
$info_box_contents[] = array('align' => 'center" valign="top',
'text' => '<hr><a href="' . tep_href_link(FILENAME_PRODUCTS_ALL, '', 'NONSSL') . '">' . BOX_INFORMATION_PRODUCT_ALL . '</a>');
}
new InfoBox($info_box_contents);
?>
</td>
</tr>
<!-- categories_eof //-->
|
|
#4
| |||
| |||
| I had a brain fart. The lines are just <hr> horizontal rules, Normal html. But what is the code to dynamically call the image so i can add the bullet in front? newbie with php or should i just use the hard code html in front of each link? |
|
#5
| |||
| |||
| It is just html coding add this Code: <img src="http://fridgemags.com/images/checkout_bullet.gif" border="0"> Code: <a href="' . tep_href_link( see if that works
__________________ There\'s something about fireman, day and night they are always fireman! |
|
#6
| |||
| |||
| yep that worked, I really need to pick up a book on php. I kept trying to insert the code you gave me but was inserting in the wrong place and the links where not showing up. Thanx bunches for the help. Sure this thread will help others out also. |
| Sponsored Links | ||
| ||
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Want to show categories AND sub categories in index.php!! | calle | osCommerce 2.2 Modification Help | 0 | 10-27-2004 12:51 PM |
| CATEGORIES BOX does not display categories list | glk | osCMax v1.7 Discussion | 2 | 03-05-2004 11:09 AM |
| help! manufacturers more info pop-up help! | Anonymous | osCMax v1.7 Discussion | 0 | 02-16-2004 04:32 PM |
| How do I add a new link to an info box? | Anonymous | osCMax v1.7 Discussion | 3 | 09-11-2003 02:33 PM |