Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sitemap SEO


Jack_mcs

Recommended Posts

I don't have it installed in that version but try changing this line

1 hour ago, artfulweb said:

if (strpos($cat['id'], (string)$current_category_id) === FALSE) continue;

to

          if (! isset($cat['id']) || (strpos($cat['id'], (string)$current_category_id) === FALSE)) continue;

Please let me know if it works so I can add it to the next version.

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

8 minutes ago, Jack_mcs said:

I don't have it installed in that version but try changing this line

to


          if (! isset($cat['id']) || (strpos($cat['id'], (string)$current_category_id) === FALSE)) continue;

Please let me know if it works so I can add it to the next version.

Thanks Jack, but unfortunately it still has the same error message.

Link to comment
Share on other sites

@artfulwebI just did a quick install of 7.1 and installed this addon but I'm not getting any warnings. What are you doing to see the failure?

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

Just now, Jack_mcs said:

@artfulwebI just did a quick install of 7.1 and installed this addon but I'm not getting any warnings. What are you doing to see the failure?

It does not fail, Jack, it is a warning in my logs that comes evey time someone clicks a product page so the error file becomes huge.

Link to comment
Share on other sites

@artfulwebYes, I understood what you were saying but I can't duplicate it here. I clicked all around the site but never got a warning. Are you using a non-English language? I only have English in my test shop so that might be it. Also, did you go to page control for this addon and click update? That is required to initialize it.

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

7 minutes ago, Jack_mcs said:

@artfulwebYes, I understood what you were saying but I can't duplicate it here. I clicked all around the site but never got a warning. Are you using a non-English language? I only have English in my test shop so that might be it. Also, did you go to page control for this addon and click update? That is required to initialize it.

Yes Jack I have done "Update" and it occurs both in French and English. The sitemaps show no problem, just the error logs. Using Php 7.3.17

Link to comment
Share on other sites

3 minutes ago, ecartz said:

It's the second parameter to strpos.  In this case $current_category_id

Thanks Matt, but I am still unable to find out why the php error message in my logs.

Link to comment
Share on other sites

@artfulwebThe $current_category_id is a core variable and should be set for all category and product pages. It appears to be not set in your installation for some reason, though I can't think of a reason why.  You can add this line above the one you mentioned

       echo 'ID '. $cat['id'] . ' - ' . $current_category_id . '<br>';

That should display all of the category ID's in your shop as well as the current category ID. They should all be numbers or strings like 1_4. If not, there is something unique to your shop that is causing the problem. In that case, you can install a test shop and just install this addon in it. Assuming it works, you can then compare your files to find out what is causing the problem. 

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

15 hours ago, ecartz said:

Try


if (empty($current_category_id) || (strpos($cat['id'], (string)$current_category_id) === false)) continue;

 

Thank you Jack, thank you Matt,

Matt's solution worked. I do not understand why there would be a problem with $current_category_id as my test site has no modifications to the category id and was a clean install of 1.0.7.1.. Do have Header Tags SEO, Ultimate SEO URLs, All Products SEO, Sitemap SEO installed so could one of those have changed something. It also shows on a client's site that he upgraded to PHOENIX 1.O.7.0 with no previous errors showing so I can not explain it. Just checked his site and added the fix and the error goes away. He upgraded from 1.0.5.0 directly to 1.0.7.0.

Thank you both.

Link to comment
Share on other sites

@artfulwebI'm glad his fix worked but it should not be necessary. I don't have the addons you mentioned installed in a 1.0.7.1 shop but none of them alter that variable.  Since I can't cause the warning, I can't find the cause of it. But if you need the fix, I suggest the following instead of what was posted since his fix will allow a needless database call to be made and an extra <div></div> to be added to the page. To apply the change I suggest, change

  if (!isset($_GET['manufacturers_id']) && SITEMAP_SEO_SHOW_INDIVIDUAL_CATEGORY_SITEMAP  == 'true') { 

to

  if (! empty($current_category_id) && !isset($_GET['manufacturers_id']) && SITEMAP_SEO_SHOW_INDIVIDUAL_CATEGORY_SITEMAP  == 'true') { 

 

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

25 minutes ago, Jack_mcs said:

@artfulwebI'm glad his fix worked but it should not be necessary. I don't have the addons you mentioned installed in a 1.0.7.1 shop but none of them alter that variable.  Since I can't cause the warning, I can't find the cause of it. But if you need the fix, I suggest the following instead of what was posted since his fix will allow a needless database call to be made and an extra <div></div> to be added to the page. To apply the change I suggest, change


  if (!isset($_GET['manufacturers_id']) && SITEMAP_SEO_SHOW_INDIVIDUAL_CATEGORY_SITEMAP  == 'true') { 

to


  if (! empty($current_category_id) && !isset($_GET['manufacturers_id']) && SITEMAP_SEO_SHOW_INDIVIDUAL_CATEGORY_SITEMAP  == 'true') { 

 

Thank you, Jack. Replaced it with that and it works fine on both sites.

Link to comment
Share on other sites

I wanted to use it with a Phoenix 1.0.7 ++ shop

the sitemaps are generated and are OK except the sitemapindex file

it contains just:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
</sitemapindex>

all the other maps are complete ....

Link to comment
Share on other sites

@rupruprupThe code you mentioned is not part of this addon. Please post your question in the support thread for whatever addon you are using.

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 noticed that when showing products the sitemap.php also displays products where the products_status is 0.  Maybe this is intentional but not for our site(s)

I changed the sitemap.php query on line 76 to:

$db_query = tep_db_query("select pd.products_id, pd.products_name from products p, products_description pd inner join products_to_categories p2c on pd.products_id = p2c.products_id where p.products_id=pd.products_id and p2c.categories_id = '" . (int)$category_id . "' and p.products_status='1' and pd.language_id = '" . (int)$languages_id . "'");

Regards Hans

 

Link to comment
Share on other sites

@koopmanh Thanks for pointing that out Hans. You should also change the commands in the sitemap_manufacturers.php and sitemap_product.php  files in the modules directory. I'll include these changes in the next version. Thank you for taking the time to mention it. :)

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

@Jack_mcs I have just tried to install this addon to a phoenix 1.0.7.7. store and have the following error in admin/sitemap_seo_page_control.php

Quote

Fatal error: Uncaught Error: Call to undefined function tep_image_submit() in /home/railway1/public_html/phoenixtest/admin14/sitemap_seo_page_control.php:289 Stack trace: #0 {main} thrown in /home/railway1/public_html/phoenixtest/admin14/sitemap_seo_page_control.php on line 289

The relevant lines in the code are

        <tr> 
         <td align="center"><?php echo (tep_image_submit('button_update.gif', IMAGE_UPDATE, 'name="update_pages"') ); ?></td>
        </tr> 

I take it  that its due to the buttons being changed in the BS admin versions. There is also a similar error in the sitemap_seo_box_control.php and the sitemap_seo_settings_control.php.

When I get it working correctly, I have also updated the front end pages to work with the new template file system if you are interested.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

@Jack_mcs I have managed to update the button code which seems to work where ever the button was needed in all the files.

        <tr> 
         <td align="center"><?php echo tep_draw_bootstrap_button(IMAGE_UPDATE, 'fas fa-refresh', null, 'primary', null, 'btn-success btn-block btn-lg'); ?></td>
        </tr>

I am now not getting all the pages to show in sitemap_seo_page_control.php. There is no error just no list of pages.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

4 hours ago, 14steve14 said:

When I get it working correctly, I have also updated the front end pages to work with the new template file system if you are interested.

Yes, please. I never turn down anything that will save me work. :)

4 hours ago, 14steve14 said:

There is no error just no list of pages.

Try turn of the modules in the settings - Show Related... The updated version I have here fixed some problems in those modules, as I recall. The version I have isn't ready for release but I am working on that. 

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

A new version had been uploaded with these changes:

  • Added a icon for the left column for Phoenix.
  • Changed code to only show active products. Found by member @koopmanh.
  • Changed code to fix php warnings.
  • Corrected error in function declaration in admin.
  • Moved the stylesheet file to ext/css/.

Please note that this update only contains changes for Phoenix. It has been tested with V 1.0.7.10.

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

On 11/16/2020 at 7:21 PM, Jack_mcs said:

Please note that this update only contains changes for Phoenix. It has been tested with V 1.0.7.10.

Hello Jack.

I have installed your new version and I am on 1.0.7.10. 

No errors but exactly the same issue as Steve: accessing admin/sitemap Seo/Page control does display the various available languages, however, absolutely no list of pages is shown: it is therefore impossible for me to edit a single thing on any page on any language.

Is this normal?

BTW, this:

On 8/25/2020 at 2:17 PM, Jack_mcs said:

Try turn of the modules in the settings - Show Related... The updated version I have here fixed some problems in those modules, as I recall. The version I have isn't ready for release but I am working on that. 

does NOT apear to solve the issue. 

Thank you

 

Link to comment
Share on other sites

A new version has been uploaded with these changes:

  • Changed the code for Phoenix so that all pages could be found.
  • Corrected a few coding mistakes. 

The changes are only for Phoenix.

TO update, just upload all of the files in the catalog_Only_New_Files directory.

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

1 hour ago, Jack_mcs said:

A new version has been uploaded with these changes:

  • Changed the code for Phoenix so that all pages could be found.
  • Corrected a few coding mistakes. 

The changes are only for Phoenix.

TO update, just upload all of the files in the catalog_Only_New_Files directory.

Uploaded new version and now the sitemap_seo_page_control.php in admin gives me 500 error...I think I am going to uninstall...

Link to comment
Share on other sites

23 minutes ago, mendoh said:

Uploaded new version and now the sitemap_seo_page_control.php in admin gives me 500 error.

That error, in a case like this, usually means something is missing or there is a mistake in the file. But what I uploaded is working here so it would seem to be a problem on your side. If you didn't replace all of the files, you will need to do that. Also, see if there is an error_log file since that might explain the failure.

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