Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

categories page problem


ivylane

Recommended Posts

Posted

It looks like somehow an "n" is getting inserted in the loop that adds each sub-category to the page, but it is hard to tell the exact cause from the source code. Have you added any contributions? If so, you might have a typo.

 

When I click on a category that has more categories within it,.. the page as a bunch of n's down the page. There is an 'n' for every additional category.

 

You can see it on my site at:

 

http://shopivylane.com/catalog/index.php?cPath=34

 

Any help would be greatly appreciated.

Posted
It looks like somehow an "n" is getting inserted in the loop that adds each sub-category to the page, but it is hard to tell the exact cause from the source code. Have you added any contributions? If so, you might have a typo.

 

 

When you say have I added any 'contributions',.. what do you mean??

 

Thanks so much!!

Posted
When you say have I added any 'contributions',.. what do you mean??

 

Thanks so much!!

 

 

Have you added any source codes written to add features to your cart. Also, have you tried to rewrite any of the source files?

Posted
Have you added any source codes written to add features to your cart. Also, have you tried to rewrite any of the source files?

 

 

I have done some stuff,.. but I am not even what file this issue is dealing with. Can you tell me what file,.. and I can check out any typo's.

 

thanks!

  • 2 weeks later...
Posted

Hi, I just replied to your PM about which files might have the problem. Hope it helps.

 

I have done some stuff,.. but I am not even what file this issue is dealing with. Can you tell me what file,.. and I can check out any typo's.

 

thanks!

Posted

Found this by doing a search, hope it helps your problem.

 

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 then 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"; 
 } 
  }

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

  • 4 months later...
Posted

I was working on a separate issue and tumbled across this is in the knowledge base and remembered you had this issue. Basically what wendyjames posted, but this is the reference. I see you still have the problem - hope you can resolve it:

http://www.oscommerce.info/kb/212

Archived

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

×
×
  • Create New...