Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Header Tags SEO


Jack_mcs

Recommended Posts

The manufacturers check box problem was with a fresh install.

 

This problem is with a version updated from an earlier version to 3.3.2a.

 

It's very sure that I make something wrong, but I don't find where.

 

Thanks for you support :)

Link to comment
Share on other sites

Hi Jack,

 

I want to remove the subcategory images and links from each pages.

 

I know, That I need to Comment out this line in index.php

 

echo ' <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . $htsDesc . '</a></td>' . "\n";

 

But, actually There is a change by Header Tags SEO. And I dont know what will happend.

 

Do you have anny ideas? or tipps?

 

Thanks,

Tamas

Edited by tpetneha
Link to comment
Share on other sites

You can safely remove that. You will lose the SEO benefit of it but if it makes more sense to your site to remove it, then that should be done.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hello Jack @@Jack_mcs,

 

I updated from version 3.3.0 to 3.3.2 and found that in:

 

product_reviews_info.php

 

It should be OsC 2.2:

 

<?php /*** Begin Header Tags SEO ***/
if (tep_not_null($header_tags_array['title_alt']))
$review['products_name'] = $header_tags_array['title_alt'];

 

Instead of::

 

<?php /*** Begin Header Tags SEO ***/
$review['products_name'] = $header_tags_array['title_alt'];

 

The product title will not show if "Title tag alternate" is empty.

 

Or did I miss something?

 

In OsC 2.3 seems to be the same and one "<?php" is missing:

 

Should be:

/*** Begin Header Tags SEO ***/ ?>
<a name="<?php echo $header_tags_array['title']; ?>"></a>
<?php
 if (tep_not_null($header_tags_array['title_alt']))
   $review['products_name'] = $header_tags_array['title_alt'];
 if (tep_not_null($review['products_model'])) {
   $products_name = $review['products_name'] . '<br><span class="smallText">[' . $review['products_model'] . ']</span>';
 } else {
   $products_name = $review['products_name'];
 }
 /*** End Header Tags SEO ***/

Instead of:

/*** Begin Header Tags SEO ***/ ?>
<a name="<?php echo $header_tags_array['title']; ?>"></a>
 $review['products_name'] = $header_tags_array['title_alt'];
 if (tep_not_null($review['products_model'])) {
   $products_name = $review['products_name'] . '<br><span class="smallText">[' . $review['products_model'] . ']</span>';
 } else {
   $products_name = $review['products_name'];
 }
 /*** End Header Tags SEO ***/
?>

 

regards

 

Rainer

Edited by raiwa
Link to comment
Share on other sites

Yeah, I made quite a few mistakes on the review page somehow. They've all been fixed in the next version and are mentioned here in the thread. Thanks for mentioning them, though.

 

For the $review['products_name'] issue, that won't be empty because the includes/header_tags.php file fills it in. But it is missing some code in the pre-2.3 version. Instead of

<?php /*** Begin Header Tags SEO ***/
 $review['products_name'] = $header_tags_array['title_alt'];

it should be

<?php /*** Begin Header Tags SEO ***/ ?>
<a name="<?php echo $header_tags_array['title']; ?>"></a>
<?php
 $review['products_name'] = $header_tags_array['title_alt'];

 

In the 2.3 version, the following block of code should be removed:

' /*** Begin Header Tags SEO ***/
 $review['products_name'] = $header_tags_array['title_alt'];
 if (tep_not_null($review['products_model'])) {
   $products_name = $review['products_name'] . '<br /><span class="smallText">[' . $review['products_model'] . ']</span>';
 } else {
   $products_name = $review['products_name'];
 }
 /*** End Header Tags SEO ***/ 

Edited by Jack_mcs

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 weeks later...

Hi Jack,

 

I'm manually updating and the following sql query is throwing errors:

 

DROP TABLE IF EXISTS headertags_social;
CREATE TABLE headertags_social (
unique_id int(4) NOT NULL auto increment,
section VARCHAR( 48 ) NOT NULL ,
groupname VARCHAR (24 ) NOT NULL, url VARCHAR ( 255 ) NOT NULL,
data TEXT NOT NULL , PRIMARY KEY (unique_id),
KEY idx_section (section)) ENGINE = InnoDB);

 

This is the error:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'auto increment,

section VARCHAR( 48 ) NOT NULL ,

groupname VARCHAR (24 ) NOT N' at line 2

Edited by mr_absinthe

Absinthe Original Liquor Store

Link to comment
Share on other sites

The whole store is now broken unfortunately because Table 'xxx_yyy.headertags_social' doesn't exist despite the fact that I have disabled social in settings. Can you please give me the whole sql code including the INSERT INTO?

Absinthe Original Liquor Store

Link to comment
Share on other sites

Hi Alex - It should be:

 

DROP TABLE IF EXISTS headertags_social;# MySQL returned an empty result set (i.e. zero rows).
CREATE TABLE headertags_social(
unique_id int( 4 ) NOT NULL AUTO_INCREMENT ,
section VARCHAR( 48 ) NOT NULL ,
groupname VARCHAR( 24 ) NOT NULL ,
url VARCHAR( 255 ) NOT NULL ,
data TEXT NOT NULL ,
PRIMARY KEY ( unique_id ) ,
KEY idx_section( section )
) ENGINE = InnoDB;

The better way to do it is to use the update file like this: ...com/headertags_seo_update.php?reset_options=true

 

That should get all of the needed changes inserted unless you are updating from before 3.2.3. It will work with the older versions but additional changes may be needed.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Thank you Jack for your swift reply, not sure what was wrong, I've been sitting here for hours - updating from version 2.4.9 believe it or not! I had to remove the old version first and manually change the database since the update php file was not working for me...

Absinthe Original Liquor Store

Link to comment
Share on other sites

You're welcome. :) Version 2.4.9 is the Header Tags Controller addon so the update file would not work with updating it, at least not completely.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I have managed finally. However I am unable to achieve the correct setting to have for category and diferent for each product. All I want is different title for category and different for each product without the category. I have tried almost every possible combination with check boxes on product_info page and I can have one or another... ? If I check to Include Category and Product, then the category title is not displayed on viewing category but it is included on product page.

I figured out! It is related to the index.php page, I have to keep Category and Product checked on index.php page (uncheck Root) and keep Product and Root checked on product%info.php page! :thumbsup:

Edited by mr_absinthe

Absinthe Original Liquor Store

Link to comment
Share on other sites

Jack, can you please send me a screen shot of the complete configuration screen? It looks like I have some duplicite entries there so I'll have to delete some of the manually from the database.

Absinthe Original Liquor Store

Link to comment
Share on other sites

I have to keep Category and Product checked on index.php page (uncheck Root) and keep Product and Root checked on product%info.php page! :thumbsup:

It's generally a mistake to have the root box checked for product_info.php. The exception is if you want particular text to show up on every product page.

 

For the settings, just run the update file without the reset_options parameter.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Jack, I'm still struggleling with the info pages... see the attached image - arrows are showing what is being also displayed on the page itself. No matter what I try, the page will not display its tags, it is displaying the default tags instead. Any idea what I might be doing wrong please?

 

When I look in the headertags table in is written correctly there.

post-63621-0-05266700-1402000902_thumb.jpg

Edited by mr_absinthe

Absinthe Original Liquor Store

Link to comment
Share on other sites

I did test and this is the result:

From Site:

Title ->

Meta Description -> Absinth - kvalitní Absint s 35mg thujonu. Absinth Original Innocent přichází... Nezaměnitelná chuť pravého absintu. V Ab

Meta Keywords -> absinthe, absint alkohol, absint, absinth, absinth original, pelyněk, kvalitní absint, pravý absinth

From Settings:

Title -> Manukový MED - Novozélandský manukový med z keře Manuka

Meta Description -> Unikátní Manuka med je certifikovaný novozélandský med, který se díky svým ověřeným léčivým vlastnostem řadí k tomu nejlepšímu co nám může příroda nabídnout.

Meta Keywords -> manuka, manukový med, med, novozélandský med, léčivý med, bio med

 

I have replaced the includes/header_tags.php file with the new one from the contribution. I have double checked the head code change for the file in the shop and it is correct. It is working fine for other files. I have compared this file with the working one and see no difference apart from the name of the file.

Edited by mr_absinthe

Absinthe Original Liquor Store

Link to comment
Share on other sites

I'm sorry but I can't follow the problem. You said "info pages," which implies one of the addons for additional pages but the url in your image isn't for such a page. But if this is for a standard page and you are using a pre-2.3 shop, then you have to add the Header Tags code to the <head> section of the file for that page. See the instructions regarding that or compare the file to one of the ones that is working.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

It is not related to the addon info pages, it is standard page, same as conditions, payment, about_us, etc. I have double checked the head code change for the file in the shop and it is correct. It is working fine for other files. I have compared this file with the working one and see no difference apart from the name of the file. This is the head code from the file:

 

<head>
<?php
/*** Begin Header Tags SEO ***/
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
 require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?>
 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
 <title><?php echo TITLE; ?></title>
<?php
}
/*** End Header Tags SEO by oscommerce-solution.com ***/
?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

Edited by mr_absinthe

Absinthe Original Liquor Store

Link to comment
Share on other sites

If you look at that page in Page Control and it has text entered in the root boxes and the root check box is checked (which your images shows for the page in it), then the admin side is setup correctly. The only other two conditions are that the code be in the <head> section and that an entry for the page is in the includes/header_tags.php file. It sounds like the last one is all that's left to check. There should be an entry for that page. If the page has not been setup correctly, meaning no entry in the filenames.php file, then the entry will be wrong and it won't work. If that looks good though, try replacing the file with the original from the package and then go into Page Control and select the add pages option. If it still fails, try running the test routine to see if that shows anything.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

OK, I've discovered what the problem is, now it would be nice to know what is causing it...

I've manually checked the admin, the <head> of the file and filenames.php, all OK. The problem was in the includes/header_tags.php file. Two files as an example:

This is the entry in the filenames.php

define('FILENAME_BANNERS', 'absinthe_banners.php');

And this was in the header_tags.php file:

// absinthe_banners.php
case (basename($_SERVER['SCRIPT_FILENAME']) === FILENAME_ABSINTHE_BANNERS):
if (! ReadCacheHeaderTags($header_tags_array, basename($_SERVER['SCRIPT_FILENAME']), '')) {
 $header_tags_array = tep_header_tag_page(FILENAME_ABSINTHE_BANNERS);
 WriteCacheHeaderTags($header_tags_array, basename($_SERVER['SCRIPT_FILENAME']), '');
}
break;

There is NO FILENAME_ABSINTHE_BANNERS in my filenames.php file.

Second example with the already mentioned file, filenames.php

define('FILENAME_MANUKA', 'manuka_med.php');

And this was in the header_tags.php file:

// manuka_med.php
case (basename($_SERVER['SCRIPT_FILENAME']) === FILENAME_MANUKA_MED):
if (! ReadCacheHeaderTags($header_tags_array, basename($_SERVER['SCRIPT_FILENAME']), '')) {
 $header_tags_array = tep_header_tag_page(FILENAME_MANUKA_MED);
 WriteCacheHeaderTags($header_tags_array, basename($_SERVER['SCRIPT_FILENAME']), '');
}
break;

Same as before, there is no FILENAME_MANUKA_MED in the filenames.php nor I've found it anywhere else. Obviously, manual edit of the header_tags.php file did the trick. But, what is causing it? Will it rename itself again or will it stay like that?

Edited by mr_absinthe

Absinthe Original Liquor Store

Link to comment
Share on other sites

I think you may have discovered a flaw in the way the code works. There are three conditions for Header Tags SEO to add a new page:

 

1 - The file has to exist in the root directory with the <head> code in place.

 

2 - The file must exist in the languages/English/ directory (or whichever language it is for).

 

3 - There must be an entry in the filenames file relating the first two.

 

You've done all of the above but didn't use the standard practice of having the names in filename definition match. The code in Header Tags assumes the names will be the same so it is comparing the FILENAME_XXX name with the actual file name in the languages directory. And, in your case they don't match so the file is skipped and not added to the includes/header_tags.php file.

 

So the code really should be using the actual filename for the comparison and, if found, then use the FILENAME used for it. I'll have to think through that change to make sure it doesn't introduce any problems, though I don't think it will.

 

In the meantime, all you can do is change the filenames file so that the definitions match the actual file names. So this

 

define('FILENAME_BANNERS', 'absinthe_banners.php');

would become

define('FILENAME_ABSINTHE_BANNERS', 'absinthe_banners.php');

Be sure to change the code in the shop that references those file name definitions.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Do you thing that changing it in the includes/header_tags.php file is bad idea?

From:



// absinthe_banners.php
case (basename($_SERVER['SCRIPT_FILENAME']) === FILENAME_ABSINTHE_BANNERS):
if (! ReadCacheHeaderTags($header_tags_array, basename($_SERVER['SCRIPT_FILENAME']), '')) {
         $header_tags_array = tep_header_tag_page(FILENAME_ABSINTHE_BANNERS);
         WriteCacheHeaderTags($header_tags_array, basename($_SERVER['SCRIPT_FILENAME']), '');
}
break;


to this



// absinthe_banners.php
case (basename($_SERVER['SCRIPT_FILENAME']) === FILENAME_BANNERS):
if (! ReadCacheHeaderTags($header_tags_array, basename($_SERVER['SCRIPT_FILENAME']), '')) {
         $header_tags_array = tep_header_tag_page(FILENAME_BANNERS);
         WriteCacheHeaderTags($header_tags_array, basename($_SERVER['SCRIPT_FILENAME']), '');
}
break;


Which is the actual entry in filenames.php file.

Absinthe Original Liquor Store

Link to comment
Share on other sites

The should work but that file gets changed with updates fairly often so you will need to remember to edit it again should that happen or should it ever have to be replaced for any reason. But if that happens a year from now you may not remember to make the edit which means you will have broken links. Of course, I hope to have it fixed within a year so maybe it's OK to wait. :)

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

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