Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

where are the products presentational code when viewing a category?


supastoked

Recommended Posts

Hi Folks,

I'm trying to find where the presentational code is kept for the sub-categories section when viewing a category. For example, from the sidebar browse categories menu, selecting category a (lingerie in this case) it opens the page with the sub categories at the top and the products for that top level category below.

 

An example of this can be seen here: http://www.essencia.org.uk/index.php/cPath/42. The reason i am trying to find this page is the annoying "n n n n n n n n n n n n" text that is displayed above the sub-categories, that i have no idea where its coming from and cant find where its located. I have checked all related pages, the language files, etc etc.. but cant find it anywhere.

 

I hope all of this makes sense - my brain is feeling pretty cooked today!!!

 

Any suggestions would be much appreciated!

 

Thanks,

Chris

Link to comment
Share on other sites

ISSUE:

Display shows the 'n' character in index page when categories are selected.

 

You have edited the index.php using the online file manager which has removed the \ backslashes from the code, this is a known issue with using the file manager to edit files, it is better to use an ftp program such as ws_ftp to download the file and edit it locally the ftp back to the server.

 

FIX:

To fix this issue you will need to find the 4 instances of "n"; on your index.php and change them to "\n";

 

around line #104 look for this code

 

while ($categories = tep_db_fetch_array($categories_query)) {
  $rows++;
  $cPath_new = tep_get_path($categories['categories_id']);
  $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
  echo '				<td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "n";
  if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
	echo '			  </tr>' . "n";
	echo '			  <tr>' . "n";
  }
}

 

change to this

 

while ($categories = tep_db_fetch_array($categories_query)) {
  $rows++;
  $cPath_new = tep_get_path($categories['categories_id']);
  $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
  echo '				<td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";
  if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
	echo '			  </tr>' . "\n";
	echo '			  <tr>' . "\n";
  }
}

 

and then around line #256 look for this code

 

while ($filterlist = tep_db_fetch_array($filterlist_query)) {
	  $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
	}
	echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');
	echo '</form></td>' . "n";
  }
}

 

and change to this

 

while ($filterlist = tep_db_fetch_array($filterlist_query)) {
	  $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
	}
	echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');
	echo '</form></td>' . "\n";
  }
}

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Hi Steve,

Your a king! Yeah, i was stuck using the file manager at first as the clients host didnt want to give ftp access :angry: but i eventually managed to get the ftp details ;) Also, i've been left stuck with cleaning some ebay sellers very very messy/clunky code and i dont think the guy knew half a pea about what he was doing!!

 

Anyways, its all good now - the code is still a mess, but that will have to be another job to redo the template - for now i am stoked that i'll be able to wrap this one up :D

 

Thanks again,

Chris

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...