Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Easy Meta tags


toyicebear

Recommended Posts

Hello toyicebear, I hope you can help me. I did a fresh install of osCommerce RC2. I installed Ultimate SEO, STS 4, and Easy Meta Tags. The instructions say to add <?php include(DIR_WS_INCLUDES . 'easy_meta_tags.php'); ?> wherever I want the meta tags to be generated. I have followed the instructions that you provided for STS users as well as added <?php include(DIR_WS_INCLUDES . 'easy_meta_tags.php'); ?> to index.php, product_info.php, and product_info_reviews.php. When I go to the main page it has my "test" meta that i set. But when I go to categories/products, it simply is showing my domain, and that is it. I have customized templates in STS for product_info and index.php. If you need any more information please let me know. I have been trying to get a Meta Tag generator working for days now! Thanks.

Link to comment
Share on other sites

  • Replies 229
  • Created
  • Last Reply

Top Posters In This Topic

Hello toyicebear, I hope you can help me. I did a fresh install of osCommerce RC2. I installed Ultimate SEO, STS 4, and Easy Meta Tags. The instructions say to add <?php include(DIR_WS_INCLUDES . 'easy_meta_tags.php'); ?> wherever I want the meta tags to be generated. I have followed the instructions that you provided for STS users as well as added <?php include(DIR_WS_INCLUDES . 'easy_meta_tags.php'); ?> to index.php, product_info.php, and product_info_reviews.php. When I go to the main page it has my "test" meta that i set. But when I go to categories/products, it simply is showing my domain, and that is it. I have customized templates in STS for product_info and index.php. If you need any more information please let me know. I have been trying to get a Meta Tag generator working for days now! Thanks.

 

You should not follow both instructions sets, just the sts install instructions.

Link to comment
Share on other sites

I have done that but it didnt work so I tried something different. Does there need to be in META tags at all in the STS templates?

 

 

If you use STS then yes there needs to be done modifications to the sts class file to show meta info. (But not the individual files, just the one file listed in the install instructions)

Edited by toyicebear
Link to comment
Share on other sites

If you use STS then yes there needs to be done modifications to the sts class file to show meta info. (But not the individual files, just the one file listed in the install instructions)

 

I have done that. What kind of stuff needs to be done to the sts_template and my other template files? Does there need to be a TITLE tag? If you would please contact me on msn at [email protected]. Thanks.

Link to comment
Share on other sites

STS INSTALL. (Only for those who have the sts v4 template system installed)

 

1. in includes/modules/sts_inc/general.php

 

add this code before the last ?>

 

$sts->start_capture();

include(DIR_WS_INCLUDES . 'easy_meta_tags.php');

$sts->stop_capture ('metatags');

 

2. in includes/classes/sts.php

 

locate this code:

 

$this->template['headcontent'] = $this->template['headcontent'].$this->template['headertags']. "\n";

 

and replace it by this code:

 

$this->template['headcontent'] = $this->template['headcontent'].$this->template['metatags']. "\n";

 

 

3. In your language file(s) add this code before the final ?>: (For english that would be in this file includes/languages/english.php)

 

define('DEFAULT_META_TITLE', 'your meta title');

define('DEFAULT_META_DESCRIPTION', 'your meta description');

define('DEFAULT_META_KEYWORDS', 'your meta keywords');

 

4. Change the meta info text defines to the ones you want for your site.

Edited by toyicebear
Link to comment
Share on other sites

STS INSTALL. (Only for those who have the sts v4 template system installed)

 

1. in includes/modules/sts_inc/general.php

 

add this code before the last ?>

 

$sts->start_capture();

include(DIR_WS_INCLUDES . 'easy_meta_tags.php');

$sts->stop_capture ('metatags');

 

2. in includes/classes/sts.php

 

locate this code:

 

$this->template['headcontent'] = $this->template['headcontent'].$this->template['headertags']. "\n";

 

and replace it by this code:

 

$this->template['headcontent'] = $this->template['headcontent'].$this->template['metatags']. "\n";

 

 

3. In your language file(s) add this code before the final ?>: (For english that would be in this file includes/languages/english.php)

 

define('DEFAULT_META_TITLE', 'your meta title');

define('DEFAULT_META_DESCRIPTION', 'your meta description');

define('DEFAULT_META_KEYWORDS', 'your meta keywords');

 

4. Change the meta info text defines to the ones you want for your site.

 

I found the problem. I did a fresh install. If I install Easy Meta Tags BEFORE installing Ultimate SEO URLS, then it works. THanks.

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

Just wanted to say thanks very much. This works perfectly for what I need, and the simplicity to install was great. Also nice to know that it's simple enough that it's unlikely to go wrong (and that I could fix / alter it if I really needed to).

 

Great work :-D

Link to comment
Share on other sites

How can I make it so the model # also shows up in the title and keywords?

 

Thanks,

Shuey

 

Its possible by modifying includes/easy_meta_tags.php

Link to comment
Share on other sites

Its possible by modifying includes/easy_meta_tags.php

 

what would be the proper syntax?

 

i changed it so it shows the model, but not sure of the syntax to also have it show the products_name? anyone?

 

$meta_title_tag = $product_meta['products_model'];

 

 

thanks

Link to comment
Share on other sites

what would be the proper syntax?

 

i changed it so it shows the model, but not sure of the syntax to also have it show the products_name? anyone?

 

$meta_title_tag = $product_meta['products_model'];

 

 

thanks

 

$meta_title_tag = $product_meta['products_name'] . ' - ' . $product_meta['products_model'];

Link to comment
Share on other sites

Nick

 

I just had to write this brief note. Have shop on osC 2.2MS with a host of mods including SEO-G lastest version, QT Pro, Credit Account, coupons etc, etc.

 

Easy Meta Tags and SEO-G seem (as you said earlier) to go very well together and already have noted better SEO all round. I know one can be more specific and detailed in this field but your contribution was up and running automatically in minutes and there were simply NO clashes/error messages.

 

If only everything in osC was so, so simple. GREAT EFFORT - many thanks!

 

Michael

Link to comment
Share on other sites

  • 3 weeks later...
I think the meta tag contribution is awesome! I do have a question though. What if there is a SSL code on there? Because mine is redirected from http to https, and I think it conflicts with the spider and the crawls. I used http://www.scrubtheweb.com/abs/meta-check.html to check mine.

 

 

It sounds like your website is not correctly configured.

 

A oscommerce site should only switch to ssl when going to the checkout part.

Link to comment
Share on other sites

Would I be able to fix that, or can that only be done by the host provider?

 

 

Check your includes/configure.php file

Link to comment
Share on other sites

OK, I'm there.. what exactly am I looking for though? (I'm new to this)

 

 

This has nothing at all to do with the Easy Meta Tags mod, so if you have any further questions do start a new tread in the general support forum.

 

But here are some hints...

 

define('HTTP_SERVER', '');

 

should be something like this

 

define('HTTP_SERVER', 'http://YOUR_WEBSITE_ADDRESS');

 

Where YOUR_WEBSITE_ADDRESS ofcourse should be replaced by your websites url.

 

and make sure http:// is used and not https://

Edited by toyicebear
Link to comment
Share on other sites

I am a complete newbie at all this

 

I am installing v 1.5

 

I dont know what this means

 

 

 

 

could you give us a clue on where to find it

 

TIA

Put your meta tag information in as instructed.

eg

// Easy Meta Tags 1.5 - Edit to suit your site, results appear in index.php and product_info.php

define('DEFAULT_META_TITLE', 'your meta title - edit to suit in english.php');

define('DEFAULT_META_DESCRIPTION', 'your meta description');

define('DEFAULT_META_KEYWORDS', 'your meta keywords');

These ones are not automatically created, so you will have to work ot what you want. Google can help.

Link to comment
Share on other sites

Nice contribution, however I may have found a bug! >_<

 

For example, if I was selling USB Cables and this was my description:

 

24" USB Cable

 

The meta tag gets cut short because the quotes after the 24 close the content attribute's value and therefore the only keyword assigned to this meta tag is 24.

 

Example:

<meta name="keywords" content="24" USB Cable" />

 

I did see this reply "Well you could modify this file: includes/easy_meta_tags.php to strip out " from descriptions and names "

 

Can someone point me in the right direction on how to modify this? I understand it would be an edit of the following, but I am not quite sure how to get the ereg_replace and preg_replace to work properly.

 

$meta_description = ereg_replace('<[^>]*>', '', $product_meta['products_description']);
$meta_description = preg_replace('/\s\s+/', ' ',$meta_description);

 

 

I would also like to add the category name after the product name just as someone else had asked here. Has anyone done this successfully?

Link to comment
Share on other sites

I've figured out how to get the category name to show after the product name. I've modified this file so much though I dont know what to share. Here's something to play with for those of you interested.

 

I can tell you that I added this:

 

$category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc where cd.categories_id = pc.categories_id and pc.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and cd.language_id = '" . (int)$languages_id . "'");
$category = tep_db_fetch_array($category_query);

 

after this:

 

$product_meta_query = tep_db_query("select products_name, products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

 

and then this is what I changed to add the category after the products name:

 

$product_meta['products_name'] . ' | ' . $category['categories_name']

 

That returns a tag like this: PRODUCTS NAME | PRODUCTS CATEGORY

 

I'm still working on the double quote thing... If I figure it out I'll let you know.

Link to comment
Share on other sites

Sorry to bother everybody but could someone explain what difference this contribution makes, physically, to the page?

 

I have viewed the source before and after and cant spot any difference!! or am I looking at the wrong thing?

 

Nigel

Link to comment
Share on other sites

Sorry to bother everybody but could someone explain what difference this contribution makes, physically, to the page?

 

I have viewed the source before and after and cant spot any difference!! or am I looking at the wrong thing?

 

Nigel

 

 

It does not add anything to the visible part of the page at all.....

 

 

It does add the 3 meta tags to the code, which only can be viewd by choosing view source in your browser.

 

title , meta keywords and meta description

 

You will also see the name/title of the page in the browser top....

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...