rstn123 Posted November 27, 2002 Posted November 27, 2002 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
burt Posted November 27, 2002 Posted November 27, 2002 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...
jon_l Posted November 27, 2002 Posted November 27, 2002 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.
Ajeh Posted November 27, 2002 Posted November 27, 2002 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.
rstn123 Posted December 13, 2002 Author Posted December 13, 2002 burt, what version are you using that code in? I cant find $location = ''; in my product_info.php. Im using 2.2.
rstn123 Posted December 13, 2002 Author Posted December 13, 2002 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.
burt Posted December 14, 2002 Posted December 14, 2002 Put it in after: require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); It should work OK...
rmyles Posted January 26, 2003 Posted January 26, 2003 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?
Ajeh Posted January 26, 2003 Posted January 26, 2003 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:
rmyles Posted January 26, 2003 Posted January 26, 2003 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
rmyles Posted January 26, 2003 Posted January 26, 2003 Whoops, I spoke too soon, got the error message again :oops: not sure what to do now...
rmyles Posted January 26, 2003 Posted January 26, 2003 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?
Ajeh Posted January 26, 2003 Posted January 26, 2003 For giggles, check the /includes/functions/clean_html_comments.php file as well. And make sure it is the exact same error msg.
rmyles Posted January 26, 2003 Posted January 26, 2003 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
Ajeh Posted January 26, 2003 Posted January 26, 2003 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.
rmyles Posted January 26, 2003 Posted January 26, 2003 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?
Ajeh Posted January 26, 2003 Posted January 26, 2003 In there or in a file it references or in the file loading it ... :D
rmyles Posted January 26, 2003 Posted January 26, 2003 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.
Ajeh Posted January 26, 2003 Posted January 26, 2003 Somewhere there is a space hiding ... afraid I cannot tell you much more than that.
minghoo Posted May 1, 2004 Posted May 1, 2004 Hi guys, Is this works with MS1? i installed but it not working. anybody help? Thanks john My contributions: EZ new fields easy way add Qty box in your product_info.php
minghoo Posted May 1, 2004 Posted May 1, 2004 when i put the <?php echo $product_info_values['products_name']; ?>in the title, it doesn't display products name on the product page. guys i need help. thanks john My contributions: EZ new fields easy way add Qty box in your product_info.php
minghoo Posted May 6, 2004 Posted May 6, 2004 Finally, i found why this contr. doesn't work. if you enable the Use Search-Engine Safe URLs, it won't work. anybody can rewrite this code to work with Use Search-Engine Safe URLs? thanks john My contributions: EZ new fields easy way add Qty box in your product_info.php
xuoaddict Posted May 22, 2004 Posted May 22, 2004 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"
Recommended Posts
Archived
This topic is now archived and is closed to further replies.