Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Header Tags Controller v2 --mod


camburst

Recommended Posts

Hello Forum, I ran across this problem with the Header TagsControllerv2

contribution. Any product from the product_info.php does not have a <title>. <meta content> and <meta description> that reflects the product -

 

example

http://www.thewebmakerscorner.com/theshop/...products_id=113

 

The product is called "cats" but it still says "webmakers corner" at the top and the meta tags dont change either.

 

 

Im still learning PHP so Im sure theres a better way to do this. My mod basically adds the name of the product for the title and grabs some of the product description to generate meta tags and combines it with the ones declared in the english/header_tags.php

 

Note-

 

Im using a early version of 2.2 - I believe its 20020917, maybe later versions dont have this problem.

 

1. Install Headertags 2 exactly from the readme

 

2. open includes/header_tags.php ---- find line

// PRODUCT_INFO.PHP (around line 49)

notice the first line is commented out - depending on your version you'll need the first or second line - to make sure which line you need open up product_info.php around line 57 look at this code $product_info =***** find which one matches and comment out the other

 

3. Now go a couples lines down to the if statement

(original)

if (empty($the_product_info['products_head_desc_tag'])) {

$the_desc= HEAD_DESC_TAG_ALL;

 

(update -------------- the description)

if (empty($the_product_info['products_head_desc_tag'])) {

$grabstring = $the_product_info['products_description'];

$rest = substr("$grabstring", 0, 60); // grabs the first 60 characters from the description

$the_desc= $rest."..., ".HEAD_DESC_TAG_ALL;

 

4. update the keywords

(original)

if (empty($the_product_info['products_head_keywords_tag'])) {

$the_key_words= HEAD_KEY_TAG_ALL;

 

(update -------------- the keywords)

if (empty($the_product_info['products_head_keywords_tag'])) {

$the_key_words= $rest."..., ".HEAD_KEY_TAG_ALL;

 

 

5. Update the Title

(original)

if (empty($the_product_info['products_head_title_tag'])) {

$the_title= HEAD_TITLE_TAG_ALL;

 

(update -------------- the title)

if (empty($the_product_info['products_head_title_tag'])) {

$the_title= $the_product_info['products_name'];

 

 

6. If you put your site name in the languages/header_tags.php -- you dont need to do this.

(original)

echo ' <title>' . $the_title . '</title>' . "n";

 

(update -------------- the title------)

echo ' <title>Yoursitegoeshere.com -' . $the_title . '</title>' . "n";

 

This is aimed more at the beginners.

OSC forum has been a big help for me, Im giving something back.

 

also ----- remember to backup your files

 

 

Thanks, Jody

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