Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Easy meta tags?


rstn123

Recommended Posts

Posted

Is there an easy way to add meta tags? I downloaded the contribution but it seems a bit complicated and labor intensive. Can somone suggest some options or share thier experiances with the contribution?

 

Thanks

Posted

I've implemented 'dynamic' Meta Tags by using the title of the products and the description of the product.

 

In product_info.php find:

 

$location = ''; (its about line 17)

 

Directly after it add:

 

if (isset($products_id)) {

   $product_info = tep_db_query("select p.products_id, pd.products_name, pd.products_description from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.language_id = '" . $languages_id . "'");

   $product_info_values = tep_db_fetch_array($product_info);



   $keywords = strip_tags($product_info_values['products_description']);

   $keywords = substr($keywords, 0, 250);

}

 

Find the <title> </title> line and replace it with:

 

<title><?php echo TITLE; ?> | <?php echo $product_info_values['products_name']; ?></title>

 

Directly after your new title line, add:

 

<meta name="keywords" content="<?php echo $product_info_values['products_name']; ?> | <?php echo TITLE; ?>">

<meta name="description" content="<?php echo $keywords; ?>">

 

No work, and a good solution. All you have to do is make sure you give your product a good descriptive name, and a great description...

Posted

The Header Tags contribution took me about 30 minutes to install. It gives you the impression that it is complicated, when it isn't. Give it a go.

 

Jon.

Posted

I get tricky like that on code just to scare you ... :shock:

 

It's really not all that horrible just a lot of methods to set up the various tags for each page.

 

You can also add additional case statements to setup other tag settings as needed for your site.

  • 3 weeks later...
Posted

does anyone know how I could get Burts mod to work in 2.2? I think its the most logical and convienent way of going out adding meta tags.

  • 1 month later...
Posted

I've installed Lindas contribution (It was easier than I thought) I haven't changed all of the 30+ files yet.

 

when I move to checkout from the cart I receive this message:

 

Warning: Cannot add header information - headers already sent by (output started at /usr/local/plesk/apache/vhosts/talespinners.ca/httpdocs/catalog/includes/functions/header_tags.php:11) in /usr/local/plesk/apache/vhosts/talespinners.ca/httpdocs/catalog/includes/functions/general.php on line 23

 

 

What's wrong?

Posted

Check the two filenames mentioned in your error msg for spaces or blank likes before or after the <?php and ?>

 

I found a couple spaces this morning in a language file general.php was calling from.

 

The name was plain as day in the error message. But did I look at the language file? No of course not ... :shock:

 

I did 20 minutes later for giggles ... and dang if there weren't two spaces beneath the last ?> in that file. :roll:

 

Took out the spaces ... and the miracle occured! :listen:

Posted

I feel I am in the presence of genius!!

 

There was indeed an extra space at the end of the headers file mentioned above. I removed it and voila! Works great!

 

Thank you sooo much

Ron

Posted

OK, I've taken catalog/includes/functions/header_tags.php out of the equation and everything is fine. Given that I haven't modified this file, any ideas?

Posted

For giggles, check the /includes/functions/clean_html_comments.php file as well.

 

And make sure it is the exact same error msg.

Posted

I've checked all of the 4 files that come with the mod and removed the extra space on the bottom of the files. I still get the same message (I verified that it's the same message).

 

Thanks again for your help Linda

Posted

Round two ... check the tops of the files before the <?php

 

And sometimes a blank like near the top below a

 

<?php

// blah blah blah

?>



<?php

 // more blah, blah, blah



?>

 

Will break it.

 

Also if you know the ones on your computer are nice and clean, delete them on the server and reload them.

Posted

Results of round 2:

 

Found one instance of the space above the <?p and fixed it. Same message :x

 

I always refresh the files on the server when I change them so I didn't bother trying that again.

 

Once again "for giggles" I removed the header file mentioned above and the reference to in in application_top and the error message didn't reappear. Although I'm no php programmer, the programmer in me says the problem's there. What do you think?

Posted

Sorry about that,

 

1. I deleted catalog/includes/functions/header_tags.php from the server.

 

2. Commented out the lined in application_top that read:

require(DIR_WS_FUNCTIONS . 'header_tags.php');

 

Now that I think about it the first step was uneccessary but oh well...

 

After I did that I hit the checkout button from the cart and it worked as it should.

Posted

Somewhere there is a space hiding ... afraid I cannot tell you much more than that.

  • 1 year later...
  • 3 weeks later...
Posted

I added this to my site and so I dont have any error messages, but how do you test to see if it is working?

life is short "Eat Desert First"

Archived

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

×
×
  • Create New...