Zen Cart Logo
Forums / General Questions / Desperately need help on this please

Desperately need help on this please

Locked

Views: 1,293

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
29 May 2008, 7:53 AM
#1
karenkte avatar

karenkte

Zen Follower

Join Date:
Feb 2008
Posts:
200
Plugin Contributions:
0

Desperately need help on this please

For several week now I've been having problems with the meta tags on my home page.

I am using 1.3.7

The title and keywords are fine but the description is just a mixture of the title and keywords whereas I want to say something more specific. I have followed these instructions:

  1. open your /includes/languages/english/YOURTEMPLATE/meta_tags.php

  2. add a new line anywhere between the <?php and the closing ?> which says:
    PHP Code:
    define('MY_IMPORTANT_HOME_PAGE_DESCRIPTION', 'blah blah blah blah');
    (substituting blah blah blah with your preferred home-page-only description, naturally)

  3. edit /includes/modules/YOURTEMPLATE/meta_tags.php
    around line 138 you have:
    PHP Code:
    define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . str_replace(array("'",'"'),'',strip_tags(HEADING_TITLE)) . SECONDARY_SECTION . KEYWORDS);
    change that to:
    PHP Code:
    define('META_TAG_DESCRIPTION', MY_IMPORTANT_HOME_PAGE_DESCRIPTION);

  4. Submit to search engines and watch closely

This is an extract from my two files:

  1. includes/modules/classic/meta-tags.php

f (isset($_GET['manufacturers_id'])) {
$sql = "select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'";
$manufacturer_metatags = $db->Execute($sql);
if ($manufacturer_metatags->EOF) {
define('META_TAG_TITLE', TITLE . TAGLINE);
define('META_TAG_DESCRIPTION', MY_IMPORTANT_HOME_PAGE_DESCRIPTION);
define('META_TAG_KEYWORDS', KEYWORDS . METATAGS_DIVIDER . str_replace(array("'",'"'),'',strip_tags(HEADING_TITLE)));
} else {
define('META_TAG_TITLE', str_replace('"','', $manufacturer_metatags->fields['manufacturers_name'] . PRIMARY_SECTION . TITLE . TAGLINE));

  1. includes/ languages/english/clssic/meta tags.php
<?php define('MY_IMPORTANT_HOME_PAGE_DESCRIPTION', 'An enchanting boutique packed with gorgeous childrens clothes and fancy dress costumes for special occasions, parties, birthdays, weddings, Christmas, Halloween......or simply to have fun'); /** * @package languageDefines * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: meta_tags.php 4273 2006-08-26 03:13:52Z drbyte $ */ // page title define('TITLE', 'Fairytale Fashions - Childrens Clothes and Fancy Dress Costumes'); // Site Tagline define('SITE_TAGLINE', 'An enchanting boutique packed with gorgeous childrens clothes and fancy dress costumes for special occasions, parties, birthdays, weddings, Christmas, Halloween......or simply to have fun!'); // Custom Keywords define('CUSTOM_KEYWORDS', 'Childrens Fancy Dress, Kids Fancy Dress, Childrens Dressing Up, Kids Dressing Up, Animal Fancy Dress, Kids Designer Wear, Kids Designer Clothes, Childrens Designer Clothes, Childrens Designer Wear, Fairy Dresses, Kids Skirts, Teenwear, Kids Clothes Online, Childrens Clothes Online, Ballerina Dresses, Nativity Costumes, Nursery Rhyme Costumes, Story Telling Costumes, World Book Day Costumes, Halloween Costumes, Kids Halloween Costumes, Bridesmaid Dresses, Flower Girl Dresses, T-shirts for Children, Childrens Disney Costumes, Kids Disney Costumes,'); Please can anyone see what is going wrong here - I have spent hours trying to fix this. Thanks
29 May 2008, 11:03 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Desperately need help on this please

Even though you've provided plenty of information, it would be a lot easier for us to see the problem (and increase your chances of a solution) if you provide a link to your site.

29 May 2008, 12:39 PM
#3
karenkte avatar

karenkte

Zen Follower

Join Date:
Feb 2008
Posts:
200
Plugin Contributions:
0

Re: Desperately need help on this please

29 May 2008, 3:13 PM
#4
ipaulpro avatar

ipaulpro

New Zenner

Join Date:
May 2008
Posts:
15
Plugin Contributions:
0

Re: Desperately need help on this please

Hey karenkte,

I'm no expert, but upgrading to 1.3.8a might do the trick.

In my /includes/languages/english/YOURTEMPLATE/meta_tags.php you will find this code:

// Home Page Only:
  define('HOME_PAGE_META_DESCRIPTION', '');
  define('HOME_PAGE_META_KEYWORDS', '');

I had no issues with simply filling in the home page description field.

Perhaps this was added in 1.3.8. To be sure, search for 'HOME_PAGE_META_DESCRIPTION' in your Admin/Tools/Developers Tool Kit.

If you are not interested in the upgrade, the code in /includes/modules/YOURTEMPLATE/meta_tags.php looks like this:

case ($this_is_home_page):
  define('META_TAG_TITLE', (HOME_PAGE_TITLE != '' ? HOME_PAGE_TITLE : (defined('NAVBAR_TITLE') ? NAVBAR_TITLE . PRIMARY_SECTION : '') . TITLE . TAGLINE));
  define('META_TAG_DESCRIPTION', (HOME_PAGE_META_DESCRIPTION != '') ? HOME_PAGE_META_DESCRIPTION : TITLE . PRIMARY_SECTION . (defined('NAVBAR_TITLE') ? NAVBAR_TITLE : '' ) . SECONDARY_SECTION . KEYWORDS);
  define('META_TAG_KEYWORDS', (HOME_PAGE_META_KEYWORDS != '') ? HOME_PAGE_META_KEYWORDS : KEYWORDS . METATAGS_DIVIDER . (defined('NAVBAR_TITLE') ? NAVBAR_TITLE : '' ) );
  break;

Hope that helps!

  • Paul
29 May 2008, 5:13 PM
#5
karenkte avatar

karenkte

Zen Follower

Join Date:
Feb 2008
Posts:
200
Plugin Contributions:
0

Re: Desperately need help on this please

Thanks for this.....I don't want to upgrade just yet so I've tried what you suggest for 1.3.7 and i still cant get this to work.

I would be very grateful if anyone knows how to sort this out!

Thanks

29 May 2008, 5:44 PM
#6
ipaulpro avatar

ipaulpro

New Zenner

Join Date:
May 2008
Posts:
15
Plugin Contributions:
0

Re: Desperately need help on this please

Just curious:

Did you remove all previous meta tag overrides when attempting my suggestion?

If not, try that. Otherwise, I don't know.

Sorry, and good luck.

  • Paul
29 May 2008, 6:22 PM
#7
karenkte avatar

karenkte

Zen Follower

Join Date:
Feb 2008
Posts:
200
Plugin Contributions:
0

Re: Desperately need help on this please

Paul,

Yes I did remove these.

Just tried it all again from scratch and still can't get it to work.

I suppose really I should upgrade but I am afraid that I will mess up something else if I do this......having taught myself everything on zencart from scratch I am sure this would not go smoothly and then I would have the headache of putting it right!! Believe me I am not technical at all and still amaze myself that I've managed to get my site this far just with the help of forums.

I would rather be able to find a solution to this from the forum because I think you only learn when you do something yourself. But I may have to pay my hosting company to sort this one out for me I think.

Thanks for trying to help though....I appreciate it.

Karen