Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

All Manufacturers link


warrenerjm

Recommended Posts

Posted

Hi

 

I have installed the All Manufacturers v2.1b ok

 

I have tried to rearrange the code to figure this out but with noluck...so please can you help?

 

In my Specials box I have a text link at the bottom, centered saying "View all discount products"

In my categories box I have a text link at the bottom, centered saying " View all products"

 

I would like the same thing for "View all manufacturers" in the manufacturers box.

 

The instructions say:

 

4. You can now add the link somewhere in your catalog, example for the infobox:

add to catalog/includes/boxes/information.php, this line:

 

'<a href="' . tep_href_link(FILENAME_MANUFACTURERS, '', 'NONSSL') . '">' . BOX_INFORMATION_ALLMANUFACTURERS . '</a><br>' .

 

**** or in your manufacturers box:

 

[replace] in includes/boxes/manufacturers.php

 

new infoBoxHeading($info_box_contents, false, false);

 

to

 

new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_MANUFACTURERS));

 

The information box text link works, but the manufacturers box just shows an arrow in the header.

 

Please can you help me with the manufactureres box code?

 

<!-- manufacturers //-->
	  <tr>
		<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_MANUFACTURERS);

new infoBoxHeading($info_box_contents, false, false);

if ($number_of_rows <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) {
// Display a list
  $manufacturers_list = '';
  while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
	$manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
	if (isset($HTTP_GET_VARS['manufacturers_id']) && ($HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id'])) $manufacturers_name = '<b>' . $manufacturers_name .'</b>';
	$manufacturers_list .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a><br>';
  }

  $manufacturers_list = substr($manufacturers_list, 0, -4);

  $info_box_contents = array();
  $info_box_contents[] = array('text' => $manufacturers_list);
} else {
// Display a drop-down
  $manufacturers_array = array();
  if (MAX_MANUFACTURERS_LIST < 2) {
	$manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
  }

  while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
	$manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
	$manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
								   'text' => $manufacturers_name);
  }

  $info_box_contents = array();
  $info_box_contents[] = array('form' => tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get'),
							   'text' => tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"') . tep_hide_session_id());
}

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

 

Thanks

Julie

Posted

Also please :D what does this do?

 

This is just a simple fix to ensure that your session isn't lost if cookies aren't enabled...

 

I couldn't remember if i had previously modified the file, so i am just listing the change.

 

Find this line around 104:

echo '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id'] . '=' . $manufacturers['manufacturers_name'], 'NONSSL', false) . '">'. $manufacturers['manufacturers_name'] . ' <br> ';

 

and change to

 

echo '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id'] . '=' . $manufacturers['manufacturers_name'], 'NONSSL') . '">'. $manufacturers['manufacturers_name'] . ' <br> ';

 

That's it! We don't want our customers losing their cart contents now do we...

 

Rob

 

ie changing 'NONSSL',false) to 'NONSSL')

 

Thanks for helping me :thumbsup:

 

Julie

Archived

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

×
×
  • Create New...