Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Name and Category in Page Title


webbygonzo

Recommended Posts

Hi,

 

I've scoured the forums and can't seem to find any mention of adding the product name and category to the page titles.

 

Anyone know what that code would be?

 

I also want to add the category name on each of the products page.

 

Thanks for any assistance.

 

Best,

 

- Gonzo

Link to comment
Share on other sites

Try installing the Header Tags Controller contribution. It will do the first one. I'm not aware of a contribution for the second.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

 <tr>
	<td width="100%" class="pageheadings"><?php
								echo $tree[$current_category_id]['name'];
			?></td>
  </tr>

 

how about that for adding category names in product page ? (works for me)

 

 

What file is this?

Link to comment
Share on other sites

in product info

 

Mmm, of course, that sounds about right. But when I try this, it doesn't work. Where in the file would one add this code? Would the existing text have to be removed first?

Link to comment
Share on other sites

<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr>
	<td width="100%" class="PageHeading"><?php
								echo $tree[$current_category_id]['name'];
			?></td>
  </tr> 
	  <tr>
		<td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
		<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
	  </tr>
	</table>

 

dont really know as your product info is probably different to mine, but above is example of putting it in a product info that hasnt been modified. It then appears above the product name.

Link to comment
Share on other sites

cDynamic Meta Tags will add both Category and Product Name to the page title. By default it doesn't add the Category, but that's just a change of setting in the meta tag file.

 

Vger

 

I have ultimate SEO installed-will this work along with that?

Link to comment
Share on other sites

I have ultimate SEO installed-will this work along with that?

 

Hi

 

ad this(bolded) to the product info page line 124 plus minus

 

[code]<tr>

<td class="pageHeading"><?php echo $category_name; ?></td>

</tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>

<td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
</tr>
</table></td>
</tr>
<tr>[/code]

 

and this

   if (isset($HTTP_GET_VARS['manufacturers_id'])) {
if (!isset($HTTP_GET_VARS['filter_id']) || !tep_not_null($HTTP_GET_VARS['filter_id'])) {
$manufacturers_query2 = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
$manufacturers2 = tep_db_fetch_array($manufacturers_query2);
$category_name = $manufacturers2['manufacturers_name'];} else {
$categories_name_query = $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "'");
$categories_name = tep_db_fetch_array($categories_name_query);
$category_name = $categories_name['categories_name'];
}} else {
$categories_name_query = $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "'");
$categories_name = tep_db_fetch_array($categories_name_query);
$category_name = $categories_name['categories_name'];
}

 

 

inside the top <?php ?> of the page before the ?> ie inside php coding...

 

this will actually can be used in the index page aswell (install in a similar fashion) to0 if you go to a manufacturer it will show name instead,

hope this helps'

Rusty

-------------------------------------------

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...