Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Completed simple site map mod

   X-Cart forums > X-Cart 4 > Dev Questions
Thread Tools Search this Thread
Old 12-04-2008, 03:39 PM
MACWIllo MACWIllo is offline

Join Date: Nov 2006
Posts: 17

Default Completed simple site map mod

Hi guys,

I spent a while browsing the forums to find a simple site map mod that anyone was giving away, in the end i just decided to build one myself. You can check it out here at

All it does is grab the active content of your speed bar, and all your active categories and products within them and display them as a list.

Code is below, I've also got CDSEO Pro installed so if you don't have that you'll need to omit those references (and also think about getting it cause its a musthave mod).

Create new file called sitemap.php:
<?php /*****************************************************************************\ Mod by Pete Hare, Jairus P/L December 4 2008 \*****************************************************************************/ define('OFFERS_DONT_SHOW_NEW',1); // WCM - CDSEO Pro Links require "./auth.php"; include $xcart_dir."/modules/cdseolinks/cdseo_redirects.php"; // / WCM - CDSEO Pro Links require $xcart_dir."/include/categories.php"; $categories_sm = $categories; foreach ($categories_sm as $k => $c){ # # Get products data for current category and store it into $products array # $old_search_data = $search_data["products"]; $old_mode = $mode; $search_data["products"] = array(); $search_data["products"]["categoryid"] = $c[categoryid]; $search_data["products"]["search_in_subcategories"] = ""; $search_data["products"]["category_main"] = "Y"; $search_data["products"]["category_extra"] = "Y"; $search_data["products"]["forsale"] = "Y"; if(!isset($sort)) $sort = $config["Appearance"]["products_order"]; if(!isset($sort_direction)) $sort_direction = 0; $mode = "search"; include $xcart_dir."/include/search.php"; $search_data["products"] = $old_search_data; $mode = $old_mode; $categories_sm[$c[categoryid]][products] = $products; } # # Assign Smarty variables and show template # $smarty->assign("main","sitemap"); $smarty->assign("categories_sm",$categories_sm); # Assign the current location line $location = array(); $location[] = array("Home", "home.php"); $location[] = array("Site Map", "sitemap.php"); $smarty->assign("location", $location); func_display("customer/home.tpl",$smarty); ?>

Create new file in skin1/modules/sitemap/sitemap.tpl:
<table cellpadding="0" cellpadding="0" width="100%"> <tr> <td style="padding-top: 0px; padding-left: 10px; padding-right: 10px;"><p align="center" class="style2"><font class="CategoriesTitle">Sitemap</font></p> {section name=sb loop=$speed_bar} {if $speed_bar[sb].active eq "Y"} <p><a onclick="{$speed_bar[sb].link}">{$speed_bar[sb].title}</a></p> {/if} {/section} {foreach from=$categories_sm item=c key=catid name=fancycat} <p><a href="home.php?cat={$catid}">{$c.category|escape}</a></p> {foreach from=$c.products item=p key=productid name=products} <ul> <li><a href="product.php?productid={$p.productid}&amp;cat={$catid}&amp;page={$navigation_page}">{$p.product}</a></li> </ul> {/foreach} {/foreach} </tr> </table>

In skin1/customer/home_main.tpl add into the if satements:
{elseif $main eq "sitemap"} {include file="modules/sitemap/sitemap.tpl"}

The mods working fine for me, I have not tested it on any other versions of x-cart (this is 4.1.

X-cart 4.1.8
Reply With Quote
Old 07-18-2010, 01:01 AM
  stevep's Avatar 
stevep stevep is offline

Advanced Member
Join Date: Jul 2005
Location: uk
Posts: 58

Default Re: Completed simple site map mod

nice one works for me
X-Cart version 4.4.5
PHP 5.2.13
MySQL server 5.0.51a-community-log
MySQL client 5.0.51a
Web server Apache/2.2.8 (Unix) mod_ssl/2.2.8
Operation system Linux
Perl 5.008008
Reply With Quote
   X-Cart forums > X-Cart 4 > Dev Questions

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT -8. The time now is 02:35 PM.


X-Cart forums © 2001-2020