Jump to content
Jack_mcs

Header Tags SEO

Recommended Posts

Hi Jack,

Sitemap.php is standing in the root but it has no header tag seo (head code).

I have a bootstrap version.

You said (The main file, in the root, has to have the Header Tags SEO <head> code. If this is a 2.3 shop then that will automatically be done.)

Do I have to put it in manually?

And what do I have to put in?

Share this post


Link to post
Share on other sites

In a 2.3 shop (any version), the header tags head code is added to the includes/template_top.php file so it gets included automatically for all pages. I assume you added it to that file or your other pages wouldn't work either. In that case, be sure the sitemap.php file is a 2.3 version (calls template_top.php). If both of those are true, then view its source to be sure the Header Tags SEO code is being included. If it is, then the problem is in Page Control. Maybe you didn't enter anything for the page, or something like that.

Share this post


Link to post
Share on other sites

@Jack_mcs

 

I found the fault why headertags not see the sitemap.

in includes/header_tags.php I had the following.

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

and it has to be:

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

Now it works all correctly. :thumbsup:

Edited by dinopacha

Share this post


Link to post
Share on other sites

Hi Jack,

 

I've been using HTC 3.2.9 on osC 2.3.3 for some time and it works very fine with PHP 5.3. Yesterday I started an upgrade to osc 2.3.3.4. That still works fine with PHP 5.3, but I want to upgrade to PHP 5.6 and that doesn't work yet. So now I started to upgrade HTC step by step to the latest version. The upgrade to 3.3.0 worked fine, but when upgrading to 3.3.1 a problem occured. In admin/categories.php I should find

      $products_head_title_tag = $HTTP_POST_VARS['products_head_title_tag'];
      $products_head_desc_tag = $HTTP_POST_VARS['products_head_desc_tag'];
      $products_head_keywords_tag = $HTTP_POST_VARS['products_head_keywords_tag'];
      $products_head_listing_text = $HTTP_POST_VARS['products_head_listing_text'];
      $products_head_sub_text = $HTTP_POST_VARS['products_head_sub_text'];
      $products_url = $HTTP_POST_VARS['products_url'];
    } else {
      $product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_head_listing_text, pd.products_head_sub_text, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id  from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");
      $product = tep_db_fetch_array($product_query);
      /*** End Header Tags SEO ***/

but that code is not included in admin/categories.php. HTC 3.2.9 had been the first version I used to install. I checked the files included in that release, but I didn't find anything what I've done wrong.

 

Do you have any idea, where the missing code can be found?

 

Yours, Martin

Share this post


Link to post
Share on other sites

@@AlbenShop24 There isn't such code in the later versions of oscommerce. While running through the individual update files will get you to where you need to be, it is a waste of time and effort for a new shop. I suggest you start over and use these steps:

 

First, if you are not using the Bootstrap version of oscommerce, then you should switch to it.

 

Once the new shop is ready to go, then use the files for the correct version and compare them to make changes. Instructions are not included for the BS version yet. They are for the non-BS version but I don't recall if they are up-to-date.

 

Assuming you have converted the database and have the original HTC database tables, apply the database changes in the manual update files. You only need to do that through version 3.3.

 

Then run the update file as headertags_seo_update.php?reset_options=true.

 

Good luck.

Share this post


Link to post
Share on other sites

Hello Jack,

 

I have installed Header Tags SEO V3.3.3_1 ond a oscommerce 2.3.4 BS (gold from Burt) and everything works fine except when i fill in a test keyword at one product and search for it: nothing shows up but in the admin HTS says that the keyword where is searched for was found.

I use the advanced_search_result.php from the HTS contribution.

 

What could be the case?

 

Further on: I want to use the Products Page Sub Text and include it in the search results: how do I do that?

Share this post


Link to post
Share on other sites

@@revamp For the first problem, you're not using one of my versions so I can't help much with that. 

 

For searching, I think the following will work though I've not tried it. This change is based on my version so it may not match the one you are using. In the advanced_search_result.php file, find

    $select_str .= ", hts.keyword ";

and add this beneath it

    $select_str .= ", pd.products_sub_text ";

Then find

            $where_str .= " or hts.keyword like '%" . tep_db_input($keyword) . "%'";

and add this beneath it

            $where_str .= " or pd.products_sub_text like '%" . tep_db_input($keyword) . "%'";

Share this post


Link to post
Share on other sites

 

 

 

@@revamp For the first problem, you're not using one of my versions so I can't help much with that. 

 

 

 

Sorry Jack, I use this contribution   http://addons.oscommerce.com/info/5851  and that carries your name...in the download it is called: HeaderTags_SEO_V_3.3.3_1.zip, sorry for the confusion.

 

Thanks for the hint with the search adjustment, I will try it.

Share this post


Link to post
Share on other sites

You said you are using version 3.3.3_1. I don't have a version like that.  There is a 3.3.1 and a 3.3.3 but I never use the underscore in my version numbers. Did you mistype?

Share this post


Link to post
Share on other sites

The search adjustment gives this:

 

1054 - Unknown column 'pd.products_sub_text' in 'where clause'

select count(distinct p.products_id) as total from products p left join manufacturers m using(manufacturers_id) left join specials s on p.products_id = s.products_id left join headertags_search hts on p.products_id = hts.product_id , products_description pd, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '2' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%revamp%' or p.products_model like '%revamp%' or m.manufacturers_name like '%revamp%' or hts.keyword like '%revamp%' or pd.products_sub_text like '%revamp%') )

[TEP STOP]

 

But when I change "pd.products_sub_text" to "pd.products_head_sub_text" (the actual database field) it works like a charme!

 

Thanks Jack.

Share this post


Link to post
Share on other sites

You said you are using version 3.3.3_1. I don't have a version like that.  There is a 3.3.1 and a 3.3.3 but I never use the underscore in my version numbers. Did you mistype?

 

As I explained (badly), I use version 3.3.3 and called it by mistake 3.3.3_1 (that is the name of the zip file, see it for yourself at http://addons.oscommerce.com/info/5851 ...

Share this post


Link to post
Share on other sites

I think the search problem for keywords is in "hts.keyword" (in advanced_search_result.php): to which table and tablefield does that refer?

Not to headertags_keywords I think because that table contains the keyword (revamp) I used for testing.

So shuold it be the products_description tabele? Then the field should be "products_head_keywords_tag"...

Share this post


Link to post
Share on other sites

@@revamp Regarding the advanced search change, your correction is how it should be.

 

Regarding the version, that's strange that the _1 is being added. I think I may have uploaded a 3.3.3 version that was missing something so I uploaded it again. The addon system must have noticed that and deleted the first one.

 

The word that is searched for is handled in the includes/modules/header_tags_keywords.php file. It checks to see if the word is in the categories, manufacturers or products or doesn't add it. It doesn't check the descriptions but since it is finding something, the word must be somewhere in there.

Share this post


Link to post
Share on other sites

@@revamp Regarding the advanced search change, your correction is how it should be.

 

Regarding the version, that's strange that the _1 is being added. I think I may have uploaded a 3.3.3 version that was missing something so I uploaded it again. The addon system must have noticed that and deleted the first one.

 

The word that is searched for is handled in the includes/modules/header_tags_keywords.php file. It checks to see if the word is in the categories, manufacturers or products or doesn't add it. It doesn't check the descriptions but since it is finding something, the word must be somewhere in there.

That is strange Jack, because when the search word is in one of the categories, manufacturers or products (title), why nothing is showing up when you search for the word?

 

I think it is in the hts.keyword , I think that is not declared properly: hts stands for the headertages_search table I presume and that table is empty...(as you explained before: $where_str .= " or hts.keyword like '%" . tep_db_input($keyword) . "%'";).

When I add/change that ($where_str .= " or hts.keyword like '%" . tep_db_input($keyword) . "%'";) to ($where_str .= $where_str .= " or pd.products_head_sub_text like '%" . tep_db_input($keyword) . "%'";) . "%'";) it works fine...

Share this post


Link to post
Share on other sites

Sorry for the persistence: I refer to the frog legs as you explain in the help with the keywords: frog legs is a name of a product but when someone searches for froglegs he/she won't find anything, so put in the keyword froglegs beside frog legs, you explain in the help...

Share this post


Link to post
Share on other sites

Yes, that is what it says. Did you mean to ask a question?

Yes I like to ask a question: why nothing shows up in the front shop when I search for a keyword?

I used "froglegs" as an example...

Share this post


Link to post
Share on other sites

Hello Jack,

 

Totally other question:

 

I see you use the Ultimate SEO URLs contribution from Chemo Bobby, how is your experience with that? Do you have a website where I can see it in use?

 

I use your Header Tags SEO since 2005 and I noticed that Google has no problems with it (thanks to your great Header Tags SEO contribution). The products are showing up in the search result with the old, ugly osCommerce paths (http://www.mysite.com/product_info.php?products_id=30 or http://www.mysite.com/index.php?cPath=1 and so on...)

 

I like to get rid off these ugly URLs and want to have something like:  http://www.mysite.com/froglegs or maybe better:  http://www.mysite.com/eatables/froglegs where eatables is the category where froglegs is in.

Share this post


Link to post
Share on other sites

@@revamp If you have a product with the name of froglegs, for example, and you search your site for froglegs and it doesn't show up, then there is a problem with your shops search code. It doesn't have anything to do with this addon unless, I suppose, if you made a mistake in the edits of the advanced_search_result.php file.

 

Ultimate SEO works great. I use it on my own site. But it doesn't provide the type of url's you mention. You can try the SEO 5 rewriter, which can provide urls similar to that, though it will cause words that are of no use to your site to be ranked and, in my opinion, water down the SEO affect.

Share this post


Link to post
Share on other sites

@@revamp If you have a product with the name of froglegs, for example, and you search your site for froglegs and it doesn't show up, then there is a problem with your shops search code. It doesn't have anything to do with this addon unless, I suppose, if you made a mistake in the edits of the advanced_search_result.php file.

 

Ultimate SEO works great. I use it on my own site. But it doesn't provide the type of url's you mention. You can try the SEO 5 rewriter, which can provide urls similar to that, though it will cause words that are of no use to your site to be ranked and, in my opinion, water down the SEO affect.

I use the advanced_search_result.php from the HTS contribution...

Share this post


Link to post
Share on other sites

I use the advanced_search_result.php from the HTS contribution...

Hmm, I'm getting an idea: I will compare the original file against yours...

Share this post


Link to post
Share on other sites

Hmm, I'm getting an idea: I will compare the original file against yours...

HMM they are the same except your adjustments and again I think it is in ($select_str .= ", hts.keyword ";):hts is not declared.

 

Share this post


Link to post
Share on other sites

HMM they are the same except your adjustments and again I think it is in ($select_str .= ", hts.keyword ";):hts is not declared.

When I add in the advanced_search_result.php "$select_str .= ", pd.products_head_keywords_tag ";"  same as above with "$select_str .= ", pd.products_head_sub_text ";" everything works fine?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×