Jump to content
Jack_mcs

Sitemap SEO

Recommended Posts

Hi. Great add-on. I'm using the "Enable & Disable Categories" contribution and was wondering what do I need to change to force the sitemap to not display the hidden categories. Also, I want to display only manufacturers that have linked products and hide those that have no products. How can I do that?

 

Thanks in advance.

Share this post


Link to post
Share on other sites

I don't use that contribution so I don't know what code to add to limit the category. It would have to be added to the sitemap module files where categories are called. For the manufacturers, I think changing this line in includes/modules/sitemap_manufacturers.php file

	  $products_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " .  TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join  " .		    TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p2c.products_id = p.products_id left join  " .  TABLE_CATEGORIES . " c on p2c.categories_id = c.categories_id where p.products_status > 0 and c.categories_id = " . $mapCID);

to

	  $products_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " .  TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join  " .		    TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p2c.products_id = p.products_id left join  " .  TABLE_CATEGORIES . " c on p2c.categories_id = c.categories_id where p.products_status > 0 and p.products_quantity > 0 and c.categories_id = " . $mapCID);

Share this post


Link to post
Share on other sites

Hi Jack,

 

I managed to disable the hidden categories by adding c.categories_status = '1' to the following query in category_tree.php and category_tree_no_products.php:

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c left join " . TABLE_CATEGORIES_DESCRIPTION . " cd on c.categories_id = cd.categories_id where c.categories_status = '1' and cd.language_id = '" . (int)$languages_id . "' order by c.parent_id, c.sort_order, cd.categories_name");

I changed the line like you suggested in includes/modules/sitemap_manufacturers.php and includes/modules/sitemap.php, but unfortunately it didn't change how the manufacturers are being displayed. Any other ideas?

Share this post


Link to post
Share on other sites

Jack,

 

I get the following error when I go to sitemap.php

Fatal error: Cannot redeclare in_multi_array() (previously declared in /home/****/public_html/includes/functions/general.php:1377) in /home/*****/public_html/includes/functions/sitemap.php on line 132

 

Thanks,

Blaine

Share this post


Link to post
Share on other sites

In the includes/functions/sitemap.php and includes/modules/sitemap.php files, find

in_multi_array

and change it to something else, like

sitemap_in_multi_array

Share this post


Link to post
Share on other sites

In the includes/functions/sitemap.php and includes/modules/sitemap.php files, find

in_multi_array

and change it to something else, like

sitemap_in_multi_array

Thank you sir.

Share this post


Link to post
Share on other sites

No, I don't recommend the Dynamic Sitemap contribution. This one and the "Google XML Sitemap SEO" are better for the onsite and offsite site maps.

Share this post


Link to post
Share on other sites

Found another minor HTML issue in sitemap_manufacturers.php

 

Change:

echo '<tr><td width="10"> </td><td class="sitemap_indvidual">' . TEXT_NO_MANUFACTURERS_FOUND . '</td></tr>';

 

To:

echo '<tr><td><table><tr><td width="10"> </td><td class="sitemap_indvidual">' . TEXT_NO_MANUFACTURERS_FOUND . '</td></tr></table></td></tr>';

 

The original code caused an HTML parsing error by putting too many table cells in a column that has only been taking 1 table cell per row. This error would only be seen if you had a product with no manufacturer set for a product.

Share this post


Link to post
Share on other sites

Another HTML change in sitemap_category.php

 

Change:

$mapCatStr = '<div>
 <tr>
	 <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	 <tr>
		 <td class="sitemap_indvidual">' . $catname['cname'] . '</td>
	 </tr>
	 </table></td>
 </tr></div>';

 

To:

$mapCatStr = '<div>
 <table border="0" width="100%" cellspacing="0" cellpadding="0">
	 <tr>
		 <td class="sitemap_indvidual">' . $catname['cname'] . '</td>
	 </tr>
	 </table></div>';

 

 

Also, is anyone having issues with Firefox not picking up the css styles? All the colors are showing properly in IE9 but no styles are properly displaying in Firefox.

Share this post


Link to post
Share on other sites

Could there be a mistake in the install instructions or did I miss something.

Installed on osC v2.3.3 and V2.3.1

Had to insert in includes/languages/english/modules/boxes/bm_information.php

define('MODULE_BOXES_INFORMATION_SITEMAP_SEO', 'Site Map');

To get the information box to read "Site Map"

Was this left out of the install instructions?? Or did I overlook something.

Posted just in case others are having the same problem. Works perfect now.

Thanks for a great contrib.


"Do what I'm thinking Not what I said." https:windowanddoorparts.us

Share this post


Link to post
Share on other sites

I checked the latest version and that definition is present. Maybe you have an older version?

Share this post


Link to post
Share on other sites

Could there be a mistake in the install instructions or did I miss something.

Installed on osC v2.3.3 and V2.3.1

Had to insert in includes/languages/english/modules/boxes/bm_information.php

define('MODULE_BOXES_INFORMATION_SITEMAP_SEO', 'Site Map');

To get the information box to read "Site Map"

Was this left out of the install instructions?? Or did I overlook something.

Posted just in case others are having the same problem. Works perfect now.

Thanks for a great contrib.

 

Yup i just downloded and installed this, and same issue here... Thanks for pointing it out, cuz i was a little confused for a moment.

Share this post


Link to post
Share on other sites

Jack,

 

I Upgraded from 1.8 to 1.9. You originally did the install of SEO 1.7 and 1.8 (I believe.) I am running 2.2rcsomething. In order to upgrade it says just to replace the new files only. Did that. When you look at a product info page it shifts my product description taking up the entire description area and the area where column right goes, forcing column right to be on left side directly below column left.

 

I restored the backup and it goes away. So just to make sure it wasn't other add-on updates that I have been doing, I upload the files again. Same result. It doesn't do it on any other pages other than productinfo pages. Any clue where to look? I restored it again and it is gone now.

 

http://absolutelyscooterparts.net

Share this post


Link to post
Share on other sites

If you look at the history file you will see there were two changes made for appearance. One of those must be causing this problem. The changes would be one or more of the module files and the sitemap.php file. You could try replacing one of those at a time to find the problem. Or comparethem with the 1.8 files to see the difference. The appearance changes are not required for proper operation so you can skip those as long as you know that is all that was changed in the file.

Share this post


Link to post
Share on other sites

Hello ! I got two things installed in my oscommerce shop 2.3.3, sitemap seo and sitemap seo 5 pro. Both working fine unless there's one small thing:

In the Sitemap itself the product links are working fine. So if you click on a product, the product page opens. But the main categories have wrong links. What can that be ?

Here the url:

http://dsc-electronics.com/sitemap.php

Share this post


Link to post
Share on other sites

This addon just uses the standard oscommerce link function. If the links are not formatted correctly, it has to be due to the url rewriter you are using. You can turr SEO 5 off to verify the links work correctly.

Share this post


Link to post
Share on other sites

Just tested, it's not SEO 5. The problem still exists. Also, in the "menu" listing of the website the links are okay, only in the sitemap the links are broken.

Share this post


Link to post
Share on other sites

Then there is something wrong with the link function in your site. This addon doesn't create any urls from its own code. It just uses the shops code to do that. There's no way to test this that I can think of, beyond what you've done so far, so I don't have any other suggestions for you. If you can't get it to work and wish to, then you would need to pay someone to look at the code.

Share this post


Link to post
Share on other sites

Jack,

 

If I added some pages in the information box section and wanted them to show up in the Sitemap, how would I do that.

Share this post


Link to post
Share on other sites

Go to box control and enable the Information box. Also be sure there is text for the box section in the settings.

Share this post


Link to post
Share on other sites

Would it matter if I am using Information Pages Unlimited?

 

Because that is what I tried and I get errors.

 

Also, the links don't match up with my pages (i.e shipping and privacy pages)

Edited by ggrant3

Share this post


Link to post
Share on other sites

Box Control only works with infoboxes with hard code links so that won't help you. But the code is built to handle those links. You have to enable it in the settings and it should load them.

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

×