Jump to content
Jack_mcs

Sitemap SEO

Recommended Posts

I've not used this particular SEO sitemap, but here is some quick and easy code to try - this will output an array of data so that you can basically do whatever you want with it...

$c2p = array();
$category_2_product_query = tep_db_query("select p2c.*, p.products_image, pd.products_name from products_to_categories p2c left join products p on p.products_id = p2c.products_id left join products_description pd on p.products_id = pd.products_id where p.products_status = 1 and pd.language_id = '" . (int)$languages_id . "'");
while ($category_2_product = tep_db_fetch_array($category_2_product_query)) {
  $c2p[$category_2_product['categories_id']][] = $category_2_product;
}

$_tree = new category_tree();
$tree = $_tree->getArray();

foreach ($tree as $a => $b) {
  $c = end(explode('_', $b['id']));
  
  $tree[$a]['products'] = $c2p[$c];
}

echo '<pre>';
print_r($tree);
echo '</pre>';

I do not know if that will be useful to anyone but it may give ideas...


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
Share on other sites
2 hours ago, cigarsforless said:

with hundreds of categories and over 4500 products in them, I do not list products in the sitemap but am wondering if anyone has an idea how to implement just showing products for a selected category? 

ie: an arrow in front of the category that when clicked would expand just the products in that category as opposed to the link on top that shows all of them

Unfortunately that would not be a simple change. The addon uses a different class file depending upon whether the "show products" link is clicked or not. You would have to change one of the class files to handle showing the product and then only If it was one of the ones you wanted to show. And the icon for that category would have to be changed so it is clickable, which it isn't now.

You might be better off installing the All Products SEO addon. It can display by category and uses pagination so the number of products would not be an issue.

Share this post


Link to post
Share on other sites

Where exactly can i find the sitemap? I've installed this mod (before 2.3 variant) to my osC so i could link sitemap file to Google but only thing it does is listing all categories (sitemap.php) and two dropdown lists in product_info.php.  i assume it is not the main purpose of this mod ;)

Share this post


Link to post
Share on other sites

This isn't meant to work with google as a sitemap. It creates a site map on the site that the customers can use. The search engines will use it too but only as they find it on the site. For sitemaps you can submit to google, you need the Google Sitemap addon.

Share this post


Link to post
Share on other sites

on mobile, the links are tiny and closely spaced, what needs to be done to make the results responsive or formatted like the rest of the site (2.4.3.1 Frozen)


Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to BS 2.3.4.1 Frozen)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Share this post


Link to post
Share on other sites
35 minutes ago, cigarsforless said:

on mobile, the links are tiny and closely spaced, what needs to be done to make the results responsive or formatted like the rest of the site (2.4.3.1 Frozen)

They should be fine. Did you add the line to your user.css file to use this addons css file? If so, you can edit the media parts in sitemap_seo.css.

Share this post


Link to post
Share on other sites
Posted (edited)

oops, my bad, I forgot that part. thanks for the quick reply Jack

EDIT, no, I see that I did indeed add that

Edited by cigarsforless

Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to BS 2.3.4.1 Frozen)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Share this post


Link to post
Share on other sites

found the culprit in sitemap_seo.css

@media (max-width: 640px) {
 div.sitemap { font-size:10px;}
 #sitemap-display-wrapper {flex-direction: column;}
 .site-map-contact {font-size:10px;}
}

font-size:10px; is the culprit!


Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to BS 2.3.4.1 Frozen)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Share this post


Link to post
Share on other sites

hi @Jack_mcs

been playing around with the sitemap and trying to get the products to hide unless clicked by using jquery and css as per the example here

http://jsfiddle.net/7Rqqd/

my main issue is getting the <div class="hidden-content">...........</div> to be placed only at beginning and end of each categories products.

the goal is to hide all products unless the category link (or an arrow in front of it) is clicked and then the products are expanded for that category only

I've been playing around with classes/category_tree_standard.php but can't quite seem to get it to work correctly
thought maybe you could have a go at it as you know your code better than I can try and figure it out.


Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to BS 2.3.4.1 Frozen)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Share this post


Link to post
Share on other sites

As mentioned, that will not be a simple change, though it is possible. I can't offer help for such changes in support threads due to time-constraints.

Share this post


Link to post
Share on other sites
6 minutes ago, Jack_mcs said:

As mentioned, that will not be a simple change, though it is possible. I can't offer help for such changes in support threads due to time-constraints.

thanks anyways, I'll keep at it and post here if I have any success


Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to BS 2.3.4.1 Frozen)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Share this post


Link to post
Share on other sites
6 hours ago, cigarsforless said:

thanks anyways, I'll keep at it and post here if I have any success

Not sure you need any fancy js script to do that. Bootstrap has the, class="collapse" which will do that for you. All you need to do is apply that to the div to hide with a id to triger it on click. Just remember each div will need a unique id to triger it.

something like this. It's been applied to the first few links on the test site https://chilleddisplays.co.uk/sitemap.php

<li><a data-toggle="collapse" data-target="#demo" href="#"><span class="title">Action | CE BS4 test site</span></a>
<div id="demo" class="collapse">
<ul><li><a href="https://chilleddisplays.co.uk/index.php/view/all/manufacturers_id/8"><span class="title">GT Interactive | CE BS4 test site</span></a>
</li><li><a href="https://chilleddisplays.co.uk/product_info.php/products_id/22"><span class="title">Unreal Tournament | CE BS4 test site</span></a>
<li><a href="https://chilleddisplays.co.uk/product_info.php/products_id/12"><span class="title">Die Hard With A Vengeance | CE BS4 test site</span></a>
</li><li><a href="https://chilleddisplays.co.uk/index.php/view/all/manufacturers_id/4"><span class="title">Fox | CE BS4 test site</span></a>
<li><a href="https://chilleddisplays.co.uk/product_info.php/products_id/16"><span class="title">Courage Under Fire | CE BS4 test site</span></a>
</div>

To be honist i'm not sure what the use of this is as the site map should have links to all pages and osC catogorys are pages in themselves so should be links?

Note the above is just an example and not a recomended sitemap format.


 

Share this post


Link to post
Share on other sites
1 hour ago, JcMagpie said:

Not sure you need any fancy js script to do that. Bootstrap has the, class="collapse" which will do that for you. All you need to do is apply that to the div to hide with a id to triger it on click. Just remember each div will need a unique id to triger it.

something like this. It's been applied to the first few links on the test site https://chilleddisplays.co.uk/sitemap.php


<li><a data-toggle="collapse" data-target="#demo" href="#"><span class="title">Action | CE BS4 test site</span></a>
<div id="demo" class="collapse">
<ul><li><a href="https://chilleddisplays.co.uk/index.php/view/all/manufacturers_id/8"><span class="title">GT Interactive | CE BS4 test site</span></a>
</li><li><a href="https://chilleddisplays.co.uk/product_info.php/products_id/22"><span class="title">Unreal Tournament | CE BS4 test site</span></a>
<li><a href="https://chilleddisplays.co.uk/product_info.php/products_id/12"><span class="title">Die Hard With A Vengeance | CE BS4 test site</span></a>
</li><li><a href="https://chilleddisplays.co.uk/index.php/view/all/manufacturers_id/4"><span class="title">Fox | CE BS4 test site</span></a>
<li><a href="https://chilleddisplays.co.uk/product_info.php/products_id/16"><span class="title">Courage Under Fire | CE BS4 test site</span></a>
</div>

To be honist i'm not sure what the use of this is as the site map should have links to all pages and osC catogorys are pages in themselves so should be links?

Note the above is just an example and not a recomended sitemap format.

the jquery script supplies the toggle to show and hide the links

<script type="text/javascript">
    $(".hide-products").click(function() {
        $(this).find(".hidden-content").toggle(); 
    });
</script>

what I am having trouble with is where in the code to place the divs so they appear on only the categories. with the above js, no unique id is required, just need the following to appear at beginning of category link <div class="hidden-content"> and the closing </div> at the end of said category. something like this...

  <div class="hide-products">
        Category 1 link here     
        <div class="hidden-content">
          <li>category 1 product 1 link</li>
          <li>category 1 product 2 link</li>
          <li>category 1 product 3 link</li>
          <li>category 1 product 4 link</li>
        </div>
  </div>

the css is this

.hidden-content {
    display: none;
    border: 1px solid black;
}

 


Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to BS 2.3.4.1 Frozen)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Share this post


Link to post
Share on other sites

Sorry i must have  misunderstood what you were trying to do. The js you linked to I could not get it to work in BS4 site.

The problem I think your going to have is that a link is clickable so your not going to be able to use it to trigger the unhide. You will need some other object to do that.

Your going to have to add 2 class's to every collapse you need anyway which is why I suggested bootstrap collapse class, it's stable and works, but hey lot's of ays to skin this cat as they say 😊

<div class="hide-products">
        Click here to see category 1 products     
        <div class="hidden-content">
          <li>category 1 product 1 link</li>
          <li>category 1 product 2 link</li>
          <li>category 1 product 3 link</li>
          <li>category 1 product 4 link</li>
        </div>
  </div>

If you check on the js fiddle with this which you are trying to do, you will see it opens hidden content and goes to link at the same time.

<div class="content-holder"><a href="https://chilleddisplays.co.uk/index.php">
        Expand Content 1</a>
        <div class="hidden-content">Bunch of hidden content for div 2
            <br/>
            Lorem... Ipsum...
        </div>
    </div>

<div class="content-holder">
        Expand Content 2
        <div class="hidden-content">Bunch of hidden content for div 2
            <br/>
            Lorem... Ipsum...
        </div>
    </div>

 


 

Share this post


Link to post
Share on other sites

the sitemap uses 2 category tree classes, 1 with just categories, 1 with cats and products.

as I have over 200 categories and 5k products it results in a massive page

trying to get it so if user want to search for a product, they can click on the category to list products, but only show the ones they have opened, rather than a massive page that takes forever to scroll through


Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to BS 2.3.4.1 Frozen)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Share this post


Link to post
Share on other sites

for me in

Sitemap Seo on

oscommerce 2341 FrozenCE

this needed  to be added to  english.php

 

catalog\admin\includes\languages\ english.php

 

 

/***** Begin Sitemap_SEO *****/
define('MODULES_ADMIN_MENU_HEADING_SITEMAP_SEO', 'Sitemap SEO');
define('MODULES_ADMIN_MENU_SITEMAP_SEO_BOX_CONTROL', 'Box Control');
define('MODULES_ADMIN_MENU_SITEMAP_SEO_PAGE_CONTROL', 'Page Control');
define('MODULES_ADMIN_MENU_SITEMAP_SEO_SETTINGS_CONTROL', 'Settings Control');
/***** End Sitemap_SEO *****/

 

 

@Jack_mcs

Share this post


Link to post
Share on other sites

You shouldn't have had to do that. No changes are needed in admin to install this addon. I know there is an english.php file in the files to be changed directory but that is just there because I forgot to delete it. It won't hurt anything to add to the english file but shouldn't be needed.

Share this post


Link to post
Share on other sites

Hello Jack, @Jack_mcs how are you?

I have a question for you. The Sitemap of images that generates this addon is only of the main image? Or does it also generate index of the long images of a product?

Best regards

Valqui

Share this post


Link to post
Share on other sites

@valquiria23I'm sorry but I don't understand your question. This addon doesn't have anything to do with images. Maybe you meant to ask in the google sitemap thread? If you meant this one, please explain in more detail.

Share this post


Link to post
Share on other sites

Hi Jack,

I'm going to update from 2.0 to 2.2 and I look that in 'catalog/includes/functions/sitemap.php' still call to 'catalog/includes/filenames.php' to check if exists a define on the file using the function "GetFileName()".

In 'catalog/includes/modules/sitemap.php' on line 61 are this code:

     if ($boxes['page_link_name'] === strtoupper($boxes['page_link_name'])) { //may not be a defined name
         $filename = GetFileName($boxes['page_link_name']);
     } else {
         $filename = $boxes['page_link_name'] ;  
     }

Are this ok? 

Thanks in advance

Share this post


Link to post
Share on other sites

That file is no longer used so the boxes section won't work as in previous shops. That will be fixed in a future version, though I don't know when that will be. For this one, change this line

$file = DIR_FS_CATALOG . $end . 'includes/filenames.php';

to

return '';

 

Share this post


Link to post
Share on other sites
On 6/11/2019 at 3:05 PM, zpupster said:

for me in

Sitemap Seo on

oscommerce 2341 FrozenCE

this needed  to be added to  english.php

 

catalog\admin\includes\languages\ english.php

 

 


/***** Begin Sitemap_SEO *****/
define('MODULES_ADMIN_MENU_HEADING_SITEMAP_SEO', 'Sitemap SEO');
define('MODULES_ADMIN_MENU_SITEMAP_SEO_BOX_CONTROL', 'Box Control');
define('MODULES_ADMIN_MENU_SITEMAP_SEO_PAGE_CONTROL', 'Page Control');
define('MODULES_ADMIN_MENU_SITEMAP_SEO_SETTINGS_CONTROL', 'Settings Control');
/***** End Sitemap_SEO *****/

 

 

@Jack_mcs

Seems to missing file, I have the same issue.

catalog/includes/languages/english/modules/boxes/bm_sitemap_seo.php  <--- Exists.

catalog/admin/includes/languages/english/modules/  <--- Not exists.

Best regards

Share this post


Link to post
Share on other sites

There was meant to be a file in admin/includes/languages/English/modules/boxes/ named sitemap_seo.php with those lines. Having the file there prevents the need to change an existing file. The way you added it will work too.

Share this post


Link to post
Share on other sites

Hi Jack,

Inside "After_2.3_BS_ONLY\catalog_Only_New_Files\admin\includes\languages\english" only exists:

- sitemap.php

- version_checker.php

don't exists "modules/boxes" inside

Best regards

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

×