View Single Post
  #7  
Old 03-25-2009, 02:03 AM
  Victor D's Avatar 
Victor D Victor D is offline
 

X-Adept
  
Join Date: Aug 2008
Posts: 643
 

Default Re: Root category display only

The categoryid is not passed thru location array by default.
So you can:
1. modify PHP code to pass it
2. pull all the categories with their ids from db, pass them to template and find id that corresponds required category name (PHP again)
3. Parse category URL to get it's number

The third way is the easiest one
like this:
Code:
{assign var=substr value=$location[1].1|regex_replace:"/^[^=]*/":""} {$substr|regex_replace:"/\D*/":""}

For the root cat it will print nothing since root cat URL is home.php
__________________
Regards,
Victor Dubiniuk

X-Cart Skins Store
- twenty two different skins for 4.1.x and 4.2.x;
- 4.3.x compatible versions are available;
- refresh you store now!

Smart menu X-Cart add-on for 4.1.8 - 4.3.x
Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x
Reply With Quote