Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Header Tags for novices


GemRock

Recommended Posts

Dear Ken

 

 

Alright, I am starting over again with OS Commerce's latest v2.2 RC2 for a full facelift

 

I have decided to install your contribution first as it looks excellent in the screenshots.

 

However, duing installation I have gotten as far as STEP 2. I added the first 2 pieces of code fine but part 3 where it asks to find this code in includes/application_top:

 

// add the products model to the breadcrumb trail

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

$model_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");

if (tep_db_num_rows($model_query)) {

$model = tep_db_fetch_array($model_query);

$breadcrumb->add($model['products_model'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));

}

}

 

This code is not present in my includes/application_top. This is to be replaced by

 

// added code to prepare for the title tag, description tag & keywords tag - By Gemrock

// IF IT'S FIRST TIME TO RUN, THEN ADD 3 NEW FIELDS - CAN BE DELETED ONCE RUN SUCCESSFULLY

if (!mysql_query("SELECT title_tag FROM " . TABLE_PRODUCTS_DESCRIPTION)){

tep_db_query("ALTER TABLE " . TABLE_PRODUCTS_DESCRIPTION . " ADD COLUMN title_tag VARCHAR(255) NULL, ADD COLUMN desc_tag TEXT NULL, ADD COLUMN keywords_tag VARCHAR(255) NULL");

}

if (!mysql_query("SELECT title_tag FROM " . TABLE_CATEGORIES_DESCRIPTION)){

tep_db_query("ALTER TABLE " . TABLE_CATEGORIES_DESCRIPTION . " ADD COLUMN title_tag VARCHAR(255) NULL, ADD COLUMN desc_tag TEXT NULL, ADD COLUMN keywords_tag VARCHAR(255) NULL");

}

// END OF CODE ADDING FIELDS

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

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

if (tep_db_num_rows($header_tags_query)) {

$header_tags = tep_db_fetch_array($header_tags_query);

$header_tags[products_name]= trim($header_tags[products_name]);

$header_tags[title_tag]= trim(strip_tags($header_tags[title_tag]));

$header_tags[desc_tag]= trim(strip_tags($header_tags[desc_tag]));

$header_tags[keywords_tag]= trim(strip_tags($header_tags[keywords_tag]));

$header_tags[products_description] = substr(preg_replace('/\s\s+/', ' ',(strip_tags($header_tags[products_description]))),0,1000);

// if a tag is less than 2 characters, then use default

if (strlen($header_tags[title_tag])< 2) {

//set product name as page title

$header_tags[title_tag]= $header_tags[products_name];

}

//add category name to page title

if (strlen($categories['categories_name'])>1) $header_tags[title_tag] = $categories['categories_name'] . ' ' . $header_tags[title_tag];

if (strlen($manufacturers['manufacturers_name'])>1) $header_tags[title_tag] .= ' ' . $manufacturers['manufacturers_name'] . ' ' . $header_tags[title_tag];

if (strlen($header_tags[desc_tag])< 2) $header_tags[desc_tag] = $header_tags[products_description];

if (strlen($header_tags[keywords_tag])< 2) $header_tags[keywords_tag] = $header_tags[products_name];

}

}

// end of added code - By Gemrock

 

 

 

Is that piece of code essential for the contribution to work?

 

 

Regards

Brent

Link to comment
Share on other sites

I wondering why I don't have my images showing up on the subcatagory area...click on catagory> subcatagory( ) , I did upload an image but it is not showing and when I click on the Main Catagory it states:

Let's See What We Have Here

There are no products to list in this category. Any Ideas or can link the exact thread, thx

Link to comment
Share on other sites

charles: the problem you described has nothing to do with my contribution, albeit it'd be very easy to fix, how? depends. ask in the general support forum.

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

Hi Ken and thank you for this great contribution! Very easy instructions and works great. I just have one issue and if you have addressed this already in this thread, accept my apologies and just point me in the right direction. I am currently using version 4 of HTN and I am also using STS on my oscommerce store. The add-on works perfectly when STS is not enabled, but as soon as I enable it, the tags and title disappear and all I see in the title bar is the default name of my store on all pages. I followed the instructions exactly and I even uninstalled the contribution and re-installed just to make sure I didnt miss a step. I was just wondering if there were any known issues using your add-on with STS?

 

Here is the link to the store >> Link

 

Any help you can provide would be greatly appreciated. :D

 

Thanks again!

Link to comment
Share on other sites

  • 2 weeks later...

Look, apologies in dvance fr this as I'm sure I'm going to look very silly when someone posts an obviou solution, ut I've been pulling my hair out and cant find where I've gone rong..

 

Editing Categoy Meta Tags works absoloutely fine, but when I edit product meta tags an hit the Update button, i get taken to an error page not found.

 

the reason for this being that the update button wants to go to:

 

 

http://admin/header_tags_edit.php?action=u...p;manufacturer=

 

 

when it should be poitning at:

 

http://http://www.DOMAINNAME/admin/header_...p;manufacturer=

 

 

cat understand what I'm missing here.

 

I've checked he configure.php file in admin and all seems ok there.

 

any ideas much appreciated.

 

thanks

Link to comment
Share on other sites

you are missing (in your post):

 

info RE whether you are upgrading or first time installation;

 

info RE whats the version of the contribution your are using and where you get it from.

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

you are missing (in your post):

 

info RE whether you are upgrading or first time installation;

 

info RE whats the version of the contribution your are using and where you get it from.

 

Ken

 

OOps sorry!

 

I'm using the latest version seo header tags v4 with the install file downloaed via the google link

 

thanks

Link to comment
Share on other sites

The solution is here: page 25 of this thread, ie, Post #485

 

the problem is the $PHP_SELF does not work on some servers, and I will not use it again anywhere now and in the future.

 

Good Luck!

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

The solution is here: page 25 of this thread, ie, Post #485

 

the problem is the $PHP_SELF does not work on some servers, and I will not use it again anywhere now and in the future.

 

Good Luck!

 

Ken

 

Many thanks for that.

 

I'll have a go and let you know the result.

 

Much appreciated.

Link to comment
Share on other sites

glad to hear that. so now you can go out and dancing on the ice enjoying the rare thick snow that is covering the whole of UK at the moment...

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

  • 2 weeks later...
hi, can someone upload the latest version ? the download links aren't working...

 

click on the last line of my signature, ie, "xhtml 1.0 strict compliant osCommerce v2.2 Final", then the Download tab, that will also take you to the header tags contribution. Remember to download the Installation Instruction as well as it is not included in the contribution zip file.

 

Ken

Edited by GemRock

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

Hi all,

 

How can I change it so, at least in the index page, my site name appears 1st in the title tag? I want it so it says "My Site - My Slogan" at the moment i've only been able to set it to "My Site - My Slogan - My Site" as it defaults to having my site name last.

 

Thanks for any help

 

Craig

Link to comment
Share on other sites

Hi, just installed and have a problem:

1054 - Unknown column 'cd.title_tag' in 'field list'

 

select c.categories_id, cd.categories_name, c.parent_id, cd.title_tag, cd.desc_tag, cd.keywords_tag from categories c, categories_description cd where c.categories_id = cd.categories_id and cd.language_id = '1' and c.parent_id = '0' order by c.sort_order, cd.categories_name

 

[TEP STOP]

 

can somebody help?

Link to comment
Share on other sites

read and follow the installation instructions CAREFULLY, and you will be OK.

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

  • 3 weeks later...
Thank you Ken for this contrib.

 

I am missing the Manufacturers tag.. is it possible get this back ?

i am not sure what exactly you mean?

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

Hello everyone,

 

Just came upon Ken's contribution and this thread. I am working on a new oscommcerce site and this sounds like something we definitely should implement.

 

My question: does anyone care to share their site so I can see how exactly it turns out after installing this contribution?

 

Thank you! :)

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...