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

sitemap.php customization

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-25-2012, 11:03 AM
 
denali denali is offline
 

Member
  
Join Date: Apr 2010
Posts: 14
 

Default sitemap.php customization

As it is now, it just lists the product names. But I would like to add the short description (products:descr) to the listing as well.

I found the fuction page of the sitemap module (modules/sitemap/func.php) and was able to swap out line 334:

$select[] = "$sql_tbl[products].product AS name";

to $select[] = "$sql_tbl[products].descr AS name";

which did substitute the description for the name in the sitemap. But I would like both the name of the product and the description of the product in the sitemap, and I don't know enough about how this works to get them to both show up in the sitemap link.

I tried changing the skin/common_files/modules/item_products.tpl along with the func.php file, but I'm not grasping how to do this.

I want, I think, something like this in the item_products.tpl:

{foreach from=$items item="item" key="num"}
<li><a href="{$item.url}" title="{$item.name|escape}">{$item.name|amp} - {$item.descr|amp}</a></li>
{/foreach}

so it would look like this <link>54321A - Moth wing scales</link>

I need some guidance on what I need to modify to get that.
__________________
x-cart 4.4.3
Reply With Quote
  #2  
Old 04-25-2012, 11:05 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: sitemap.php customization

$select[] = "$sql_tbl[products].product AS name"; // keep the line
$select[] = "$sql_tbl[products].descr AS description"; // add this

then in the template refer to it as $item.decsription
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 04-25-2012, 11:25 AM
 
denali denali is offline
 

Member
  
Join Date: Apr 2010
Posts: 14
 

Default Re: sitemap.php customization

Thank you, but it doesn't work
__________________
x-cart 4.4.3
Reply With Quote
  #4  
Old 04-25-2012, 12:06 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: sitemap.php customization

Clear cart's cache
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 04-26-2012, 06:10 AM
 
denali denali is offline
 

Member
  
Join Date: Apr 2010
Posts: 14
 

Default Re: sitemap.php customization

Thanks, found the problem, edited the wrong tpl. I wanted to edit the item_catagories_recurs.tpl, not the item_products.tpl.

Works great.
__________________
x-cart 4.4.3
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


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 12:55 PM.

   

 
X-Cart forums © 2001-2020