Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SEO Metatags Question


hacketjoe

Recommended Posts

Posted

I have added the SEO Metatags Module to my site and on the home page it is pulling the heading "OSCommerce, OSCommerce" on each of my link pages it pulls the link title and then followed by OSCommerce.

 

On my product pages it is pulling the product heading correctly.

 

How can I change the heading on at least the home page to show something other than "OSCommerce"

Posted

hacketjoe - this is most likely due to the fact that you have not renamed your store name.

 

To rename your store: go into your admin section. Choose Configuration, then choose My Store. The very first option that is on the left is Store Name - I'm guessing that it is set to OsCommerce (mine was) and when you change it, it will change what this contribution is showing you.

 

I have a question for anyone else using this contribution - I have gotten it to work on the main page and the category pages - HOWEVER, once I open up a product page, it shows like this " - OsCommerce" - the product title is missing! I've looked through the files and have come up with this...

The changes that SEO Metatags 1.2 makes are to catalog/product_info.php for the product title - but my installation of OsCommerce (051113) doesn't use that one when it displays products - it uses catalog/index.php

 

Anyone know how I can modify the install to correctly display the product titles? I figure I need to modify index.php, but that will conflict with what is already there (I've tried with no success) - anyone know how I get this installation to use product_info.php when displaying products?

Posted

Yeah, you know you're a dork when you reply to your own message.

 

If someone was having the problem that I was talking about above...well, here is the solution - hope it helps someone!

 

This code goes in your index.php file (catalog/index.php), replacing this line:

 

<title><?php echo $page_title . ' - ' . strip_tags(TITLE, ""); ?></title>

 

What the following does: tests to see if there is a products_id - I was doing this outside of the html code before, and by echoing the variable, found out that it wasn't initialized yet. By doing it inside the html code, it is initialized.

 

If there is a products_id, then it goes through the code that was previously in the products_info.php file and gets the name of the product, then applies it to the title of the site. If there is no products_id, then it uses the default title (works for category headings as well)

 

<?php

if (isset($HTTP_GET_VARS['products_id'])){

//begin seo_metatags
$seo_info_query = tep_db_query("select pd.language_id, p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id,
p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'" . " and pd.language_id ='" .  (int)$languages_id . "'");
$seo_product_info = tep_db_fetch_array($seo_info_query);
$seo_product_name = strip_tags ($seo_product_info['products_name'], "");
$seo_product_description = strip_tags ($seo_product_info['products_description'], "");
$seo_product_model = strip_tags ($seo_product_info['products_model'], "");

$seo_manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'), " . TABLE_PRODUCTS . " p  where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id");
$seo_manufacturers = tep_db_fetch_array($seo_manufacturer_query);
$seo_manufacturer_name = strip_tags ($seo_manufacturers['manufacturers_name'], "");
$page_title = $seo_product_name;
// end seo_metatags


?>

<title><?php echo $page_title . ' - ' . strip_tags(TITLE, ""); ?></title>

<?php
 } else {
?>

<title><?php echo $page_title . ' - ' . strip_tags(TITLE, ""); ?></title>

<?php
}
?>

Posted

Unfortunately I did change the store name to my site name. I was hoping that was the problem, that would have been an easy solution. Any other suggestions?

Posted
Unfortunately I did change the store name to my site name. I was hoping that was the problem, that would have been an easy solution. Any other suggestions?

 

Did you In /languages/english.php ... page title define('TITLE', 'osCommerce') change osCommerce to Your Title?

Just between us, remember there are only 10 kinds of people in the world; those who understand binary and those who don't!!

 

Remember, learning is a "do-it-yourself" experience; although, not necessarily a "do-it-BY-yourself" experience.

 

The quickest way to learn is to forget to BACKUP!

Archived

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

×
×
  • Create New...