X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Site map page (https://forum.x-cart.com/showthread.php?t=12393)

Maree 10-09-2005 01:32 AM

Just want to say Thank You to Fernando for this mod and his excellent instructions.

pauldodman 10-12-2005 04:50 AM

Hi,

As far as this mod goes, I have it working on version 3.5.10. Not sure if this will help Brian or any others who have had trouble on this branch of x-cart, but this is my sitemap.php file.

Code:

<?php

require "../top.inc.php";
require "../config.php";
require $xcart_dir."/include/categories.php";

$smarty->assign("main","sitemap");
$smarty->assign("location", $location);
$smarty->display("customer/home.tpl");

?>


I have this within my customer folder; I think everything else is the same.

However, it still has limitations; mainly as it only really displays the categories, it is not a true sitemap. Still doesn't have a page title, or work as part of the html catalog. Maybe someone can finish it off.

Otherwise I would suggest Firetank's Sitemap module as it is fully comprehensive and I reckon is excellent value for money. I have seen so called marketing companies charge бё1500 to guarantee top Google rankings and done little more than create a sitemap!

wiper 12-29-2005 11:12 AM

Thanks to everyone for usefull code, but I have problem with that, becouse in my eshop are nearly 2000 categories, so its not the smartest way becouse its doing quite big server load:( Probably it needs come cron static html page generating, but I dont know how how to do it in sitemap.php. Any tip is welcome:)

groovico 12-30-2005 08:09 PM

Quote:

Originally Posted by wiper
Thanks to everyone for usefull code, but I have problem with that, becouse in my eshop are nearly 2000 categories, so its not the smartest way becouse its doing quite big server load:( Probably it needs come cron static html page generating, but I dont know how how to do it in sitemap.php. Any tip is welcome:)


You might be interested in our commercial advanced site map, it's designed for working with larger sites in a search engine optimised manner.

http://www.firetanksoftware.com/fts/customer/X-cart-Site-Map-advanced-pid-70.html

It also optionally offers an auto rebuild cached version too along with control over category depth, products etc

wiper 12-31-2005 03:01 AM

Quote:

You might be interested in our commercial advanced site map, it's designed for working with larger sites in a search engine optimised manner.
http://www.firetanksoftware.com/fts/customer/X-cart-Site-Map-advanced-pid-70.html
It also optionally offers an auto rebuild cached version too along with control over category depth, products etc

I already have it:) but the problem with your version is, that it is not working on my server with PHP 5.0.4:( I dont know why, but it worked with older php version. Probably some functions are not ok.

groovico 12-31-2005 11:22 AM

Quote:

Originally Posted by wiper
Quote:

You might be interested in our commercial advanced site map, it's designed for working with larger sites in a search engine optimised manner.
http://www.firetanksoftware.com/fts/customer/X-cart-Site-Map-advanced-pid-70.html
It also optionally offers an auto rebuild cached version too along with control over category depth, products etc

I already have it:) but the problem with your version is, that it is not working on my server with PHP 5.0.4:( I dont know why, but it worked with older php version. Probably some functions are not ok.


Thats strange, could you send an email about the problem through our contact page on http://www.firetanksoftware.com and we'll take a look at it for you.

chrisinoz 01-26-2006 05:23 PM

Hi Fernando

I also thank you for this contribution.

Worked fine first time but when I logged in as a member it said it could not find the page.

Cheers

Chris
4.017

mitash 01-30-2006 03:19 AM

Hi fernando

You are a champion!!

Just tried your code, Absolutely fantastic.

Well done on writing this and for sharing it..

Cheers

Realsecurity 01-30-2006 11:22 AM

Is the above mod for sitemap safe to use ???? with mention of X-carts post im not sure i whether to use this mod or not,,,,,,

cubefree 02-02-2006 02:53 PM

I am getting a curious message here: http://cedarbrooksauna.com/cart/sitemap.php

Page not found!
The requested page does not exist or you are not allowed to access it!

It set the code exactly as fernando displayed earlier in this thread... any clue what causes that to display instead of the sitemap itself?

moneysaver67 02-11-2006 11:51 AM

all,

I personally added

Code:

$smarty->assign("title", "Sitemap Title");

to my sitemap.php to include a page title...

Jerrad 02-12-2006 01:53 AM

Thanks moneysaver67, but I've added your code to the sitemap, but it still doesn't show a page title...
Maybe it's possible you show your sitemap.php?
Thanks in advance! :D

JWait 02-12-2006 06:41 AM

Quote:

Originally Posted by cubefree
I am getting a curious message here: http://cedarbrooksauna.com/cart/sitemap.php

Page not found!
The requested page does not exist or you are not allowed to access it!

It set the code exactly as fernando displayed earlier in this thread... any clue what causes that to display instead of the sitemap itself?


I had the same problem... until I replaced skin1/customer/home_main.tpl with the one with the added the required code. (doh!) :lol:
The "you are not allowed to access it" part also indicates it may be a file permissions problem, so check that also if it continues.

Hyperdelicious 03-09-2006 10:17 AM

sitemap mod not working with 4.1.0
 
I had this sitemap working with 4.0.13 and since updating cart to 4.1.0 the sitemap mad isn't working any more ... page only shows bullets nothing more ... any ideas?

I'd also like the sitemap to list all products ... any one accomplish this or have ideas?

mltriebe 04-07-2006 05:02 PM

Is this compatable with google site maps? I added this and it works great so a big thanks to Fernando, but google says its an unsupported format.

Is it this mod or did I mess something up someplace.

Mike

bridal-land 04-09-2006 10:06 AM

im getting the following error.

Warning: Smarty error: unable to read template resource: "customer/sitemap.tpl" in /home/brida3/public_html/Smarty-2.5.0/Smarty.class.php on line 1042

could this be from the dsefu mod

Any help would be great thanks
Mike

patrick24601 04-10-2006 11:16 AM

OK. I've installed this and it is working great but...

Since I've installed this and the 301 redirect post from the sticky I cannot log into my site as a customer. I add to the cart, I go to checkout and it asks me to login (even though it tells me my name on the home page) and then it just comes back to the main page.

Is the issue the site map or the 301 redirect?

subzero 04-17-2006 06:49 PM

Quote:

Originally Posted by CopperB
Just wondering if anyone knows of a way to be able to use/view the sitemap when using the html catalog?

If I access the website via the html catalog and click on the sitemap link I get the error The requested URL /xcart/catalog/sitemap.php was not found on this server

Thanks


sorta found a fix for this with a bit of help on here

if u copy the contents of you sitemap.tpl then create a new staic page called sitemap and past the contents of the sitermap.tpl in there and click the parse smarty tags box and save all changes then when u create your html catalogue it will make a file called sitemap-sp-**.html for you ** being the static page number

hope this helps

patrick24601 04-19-2006 04:43 AM

I am having a problem with this mod.

When I installed it I had several top level categories with subcats and only one of the subcats had products. And then it worked great.

I just updated one of my other subcategories to now have products and I cannot get those to show up in the sitemap. It almost looks like the data is cached someplace and needs a refresh.

To see this go to www.patrickallmond.com

If you click on 'MP3' on the left hand side you will see that I have several subcategories.

But you click on sitemap you will see those don't show up in the site map.

Any help would be appreciated.

bridal-land 04-20-2006 06:38 PM

Anyone have this working in 3.5x yet. Im still getting this error


Warning: Smarty error: unable to read template resource: "customer/sitemap.tpl" in /home/brida3/public_html/Smarty-2.5.0/Smarty.class.php on line 1042


I would love to get this working.

Jerrad 05-26-2006 11:12 PM

Quote:

Originally Posted by patrick24601
I am having a problem with this mod.

When I installed it I had several top level categories with subcats and only one of the subcats had products. And then it worked great.

I just updated one of my other subcategories to now have products and I cannot get those to show up in the sitemap. It almost looks like the data is cached someplace and needs a refresh.

To see this go to www.patrickallmond.com

If you click on 'MP3' on the left hand side you will see that I have several subcategories.

But you click on sitemap you will see those don't show up in the site map.

Any help would be appreciated.


I'm having exactly the same problem as Patrick.
New and/or changed categories show up fine, but new added subcategories won't show.
But when a subcategory is renamed, it will be updated correctly in the sitemap...

Anybody had the same problem and found a way to fix this?

Thanks in advance!

weckie 05-28-2006 07:34 AM

Re: sitemap mod not working with 4.1.0
 
Quote:

Originally Posted by Hyperdelicious
I had this sitemap working with 4.0.13 and since updating cart to 4.1.0 the sitemap mad isn't working any more ... page only shows bullets nothing more ... any ideas?

I'd also like the sitemap to list all products ... any one accomplish this or have ideas?


I have installed in on to 4.1.1 but it shows only three cats, i am having more than that. Anyone?
see it at: http://www.weckonline.nl/weckonline/shop/sitemap.php

v2 06-18-2006 11:55 PM

is it possible to make an xml file of this sitemap? So you can post it on Google?

nfc5382 07-23-2006 10:56 AM

works perfect, thanks!

3DLover 07-24-2006 12:19 AM

$allcategories broken in 4.1.2 ???? - Possible BUG?
 
I've been working with X-Cart for only one week now so I may be off base here, but I think I know why this mod is not working on the current version of X-Cart.

I've been hacking at the code a bit, and it appears that the $allcategories variable is not returning _ALL_ of the categories, just the root categories. I've also found that when you have cat=X as part of the URL (HTTP Get variable) and you replace X with a known category number, the $allcategories contains the root categories plus any subcategories of X. Now, I have never used any versions other than 4.1.2, but this does not seem to be the behavior that is to be expected. In the code that Fernando posted, it clearly appears that he is truly expecting a full dump of every category in the $allcategories variable. This is a bit of code I wrote to dump out all of the information in the $allcategories variable:

Code:

{foreach from=$allcategories item=mycat key=catid}
  {$catid} -

  {foreach from=$mycat item=x key=y}
    ({$x} - {$y})

  {/foreach}
 

{/foreach}


On a slightly different topic, I noticed several ppl mention that this mod was resource hungry when used on sites with large numbers of categories. The reason for this is easy to understand by looking at Fernando's code... he is continually looping through the $allcategories var each time he sees a category with sub categories. In trying to figure out the above bug, and also improve the speed of this mod, I discovered the $subcategories variable. It's interesting because it only contains the categories of a specific parent category. If I change the URL to include the cat=X GET var, it gives me the sub cats in a nice short array. I figured I'd be clever and change $cat like so: {assign var="cat" value=X} (making X a valid category number) Unfortunately, this makes no difference. It appears that $subcategories is assigned only once, and can only be controlled when $cat is assigned in a HTTP GET. Does anyone know how to make a function that would return an array of subcategories for a specific parent category?

hansmoen 07-25-2006 05:23 AM

Page Title
 
Quote:

Originally Posted by moneysaver67
all,

I personally added

Code:

$smarty->assign("title", "Sitemap Title");

to my sitemap.php to include a page title...


Using the Flexi Rectangle skin I had to use:

Code:

$location[] = array("Sitemap Title", "/sitemap.php");
$smarty->assign("location", $location);


in sitemap.php



HK

X-Cart 4.0.18 Gold - Flexi Rectangle

leorulz 08-22-2006 12:56 PM

Re: Site map page
 
i have installed Fernando's module for my x-cart 4.1.2, but somehow i am getting gibberish:[*][*][*][*][*]Diamond Watches
[/list][*][*][*][*][/list].
You can look here at http://www.dreamindiamonds.com/store/sitemap.php.

Can anybody help me out?
Thanks.

jayzee 08-23-2006 07:47 AM

Re: Site map page
 
has anyone worked outhow to get this working on 4.1.2?

seems that $allcategories now only holds top level categories in it and not subcategories which is why it doesn't work.

Now if I remeber right fancy categories should get all the info needed, will have a look now and see if i can find the answer.

J

candleshopcreations 09-17-2006 03:12 PM

Re: Site map page
 
Quote:

Originally Posted by PremiumPonyParts
Make sure that when you link to it in your files, your pointing it to the root, not just calling it by sitemap.php so do xcartdir/sitemap.php

otherwise, when the catalog calls it, its gonna do xcartdir/catalog/sitemap.php

Also, your sitemap won't link to the HTML pages you've made. But the Advanced Site Map that you can buy does, and works great.


ok, i tried to make this change but then the file is not there. this is what is in my categories.tpl:

<FONT class="CategoriesList"><A href="/store/sitemap.php" class=VertMenuItems>{$lng.lbl_sitemap}</A></FONT>

i'm guessing i called something wrong? b/c here's what i get

Site map[*]Decorative[*]Floating Candles[*]Floating Candles - 5 packs[*]Foating Candle Guest Favors[/list][*]Gifts for Baby[*]Guest Favors for Baby Showers[*]Just for baby[/list][*]Guest Favors[*]Handcrafted cards[*]New Products![*]Pillar Candles[*]Tealights and Votives[*]Tealights and Votives - 5 packs[*]Tealights and Votives - Guest Favors[/list][*]Weddings[*]Wedding Decorations[*]Wedding Guest Favors[/list][/list]
thanks,

candleshopcreations 09-17-2006 06:37 PM

Re: Site map page
 
Just wanted to say thank you to John at Safety Web Net for fixing my sitemap. This simply stellar customer service and it wasn't even his product! Highly recommend Safety Web Net!

jayzee 09-18-2006 12:51 AM

Re: Site map page
 
could you post your sitemap files so we can see how they got round you problem.
thanks

J

Impact_1 01-11-2007 02:23 PM

Re: Site map page
 
Any new code for this? 4.1.3 or above?

PhilJ 01-11-2007 02:32 PM

Re: Site map page
 
Here's a basic sitemap, though it doesn't show categories.
http://www.xcartmods.co.uk/click.php?id=10

medici 04-03-2007 12:26 PM

Re: Site map page - Links
 
I can't figure out how to link the site map's text to the appropriate category/subcategory page. Any help would be appreciated.

HTML Code:

{* $Id: sitemap.tpl,v 1.00 2005/02/24 09:53:29 max Exp $ *}
{include file="dialog.tpl" title="Site Map" content=$smarty.capture.sitemap extra="width=100%"}
{capture name=sitemap}
<ul type="square">
{*** start unordered list***}
{section name=l1_cat_num loop=$allcategories}
{*** loop ALL categories ***}
{if $allcategories[l1_cat_num].parentid eq 0}
{*** loop root categories/parentid 0 - level 1***}
<li>
{$allcategories[l1_cat_num].category}
 
{if $allcategories[l1_cat_num].subcategory_count gt 0}
{*** check if root cat has child cats ***}
 
<ul type="square">
{section name=l2_cat_num loop=$allcategories}
{*** loop through sub cats with matching parent id ***}
 
{if $allcategories[l2_cat_num].parentid eq $allcategories[l1_cat_num].categoryid}
<li>
{$allcategories[l2_cat_num].category}
{if $allcategories[l2_cat_num].subcategory_count gt 0}
{*** check if parent has child cats***}
 
<ul type="square">
 
{section name=l3_cat_num loop=$allcategories}
 
{if $allcategories[l3_cat_num].parentid eq $allcategories[l2_cat_num].categoryid}
<li>
{$allcategories[l3_cat_num].category}
 
{if $allcategories[l3_cat_num].subcategory_count gt 0}
{*** check if parent has child cats***}
 
<ul>
 
{section name=l4_cat_num loop=$allcategories}
 
{if $allcategories[l4_cat_num].parentid eq $allcategories[l3_cat_num].categoryid}
<li>
{$allcategories[l4_cat_num].category}
{/if}{/section}</ul>
{/if}{/if}{/section}</ul>
{/if}{/if}{/section}</ul>
{/if}{/if}{/section}</ul>
{/capture}


groovedis 04-25-2007 09:58 AM

Re: Site map page
 
Not working for me either. All I get is our categories and subcategories listed like this...

[*]New releases[*]Albums[*]Breaks[*]DJ Tools[*]Downtempo, Leftfield[*]Drum & Bass[*]Electro[*]Grime[*]Hip Hop[*]House[*]Indie[*]Mash-Ups[*]Nu Jazz, Broken Beat[*]Reggae, Dub[*]Reissue, Jazz, Funk[*]Soul[*]Techno[*]World[/list][*]Singles[*]Breaks[*]Downtempo, Leftfield[*]Drum & Bass[*]Electro[*]Grime[*]Hip Hop[*]House[*]Indie[*]Mash-Ups[*]Nu Jazz, Broken Beat[*]Reedit[*]Reggae, Dub[*]Reissue, Jazz, Funk[*]Soul[*]Techno[*]World[/list][/list][*]Restocks

etc.

Any help?

JWait 05-02-2007 07:40 AM

Re: Site map page
 
Here is what I am using....

Code:

{* $Id: sitemap.tpl,v 1.00 2005/02/24 09:53:29 max Exp $ *}
{capture name=sitemap}
<ul> {*** start unordered list***}
{section name=l1_cat_num loop=$allcategories} {*** loop ALL categories ***}
  {if $allcategories[l1_cat_num].parentid eq 0} {*** loop root categories/parentid 0 - level 1***}
      <li><a href="home.php?cat={$allcategories[l1_cat_num].categoryid}">{$allcategories[l1_cat_num].category}</a></li>

      {if $allcategories[l1_cat_num].subcategory_count gt 0} {*** check if root cat has child cats ***}
        <ul>
            {section name=l2_cat_num loop=$allcategories} {*** loop through sub cats with matching parent id ***}
              {if $allcategories[l2_cat_num].parentid eq $allcategories[l1_cat_num].categoryid}
                  <li><a href="home.php?cat={$allcategories[l2_cat_num].categoryid}">{$allcategories[l2_cat_num].category}</a></li>

              {if $allcategories[l2_cat_num].subcategory_count gt 0} {*** check if parent has child cats***}
                  <ul>
                    {section name=l3_cat_num loop=$allcategories}
                        {if $allcategories[l3_cat_num].parentid eq $allcategories[l2_cat_num].categoryid}
                          <li><a href="home.php?cat={$allcategories[l3_cat_num].categoryid}">{$allcategories[l3_cat_num].category}</a></li>

                        {if $allcategories[l3_cat_num].subcategory_count gt 0} {*** check if parent has child cats***}
                          <ul>
                              {section name=l4_cat_num loop=$allcategories}
                                {if $allcategories[l4_cat_num].parentid eq $allcategories[l3_cat_num].categoryid}
                                    <li><a href="home.php?cat={$allcategories[l4_cat_num].categoryid}">{$allcategories[l4_cat_num].category}</a></li>

                        {/if}{/section}</ul>

            {/if}{/if}{/section}</ul>

      {/if}{/if}{/section}</ul>

  {/if}{/if}{/section}
</ul>
{/capture}

{include file="dialog.tpl" title="Site map" content=$smarty.capture.sitemap extra="width=100%"}


medici 05-02-2007 11:19 AM

Re: Site map page
 
Nice work JWait. It works great.

groovedis 05-02-2007 11:44 AM

Re: Site map page
 
Yeah this works perfectly. Thanks JWait!

sbstart 05-30-2007 09:26 AM

Re: Site map page
 
when I pull up my sitemap my categories and products look like this:

[*] [*] [*] [*] [*] [/list]http://www.sbstartupco.com/store/sitemap.php

any help would be greatly appreciated

version 4.1

JWait 06-01-2007 09:58 AM

Re: Site map page
 
The code I posted is for version 4.0.19. Version 4.1.x is totally different and as far as I know there is not a working sitemap for those versions.


All times are GMT -8. The time now is 04:20 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.