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

Rearranging and reconfiguring categories problem

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

Member
  
Join Date: Jul 2004
Posts: 22
 

Default Rearranging and reconfiguring categories problem

Hi everyone,

This is my first experience with X-cart and its pretty cool. I'm using version 3.5.9 (linix) and am trying to change the way the navigation displays. If you look at http://www.solutionsforliving.biz/index.php you will see that I have the category navigation going across the top horizontally as images. I currently have them in the head.tpl file but believe that I need to change it to the categories.tpl, but I'm not sure. Ideally I would like the category image buttons to have a rollover effect, but I'm not sure where if that is possible. Also, I'm confused as to how I make each category button a functional link. And, since I'm begging for help, where the current categories are listed on the left side I would like to display the subcategories. The subcategories should remain until a new category is clicked on. Is this all possible? Any help and advice you can give me is much appreciated. Thank you in advance.

Mike
Reply With Quote
  #2  
Old 07-26-2004, 04:59 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

this is the code that will give you root categories in a horizontal line

Code:
<table cellpadding="5" cellspacing="0"><tr> {section name=cat_num loop=$categories} <td> <font class=CategoriesList>{$categories[cat_num].category_name}</font> </td> {/section} </tr> </table>
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 07-26-2004, 06:58 AM
 
mikea93449 mikea93449 is offline
 

Member
  
Join Date: Jul 2004
Posts: 22
 

Default

Thank you Shan! That works great to display the categories horizontally . I've put that code into the head.tpl file as can be seen at http://www.solutionsforliving.biz/index.php. What I would like to do is use the images right above the category listings as the actual category links instead of text. Also, in home.tpl I would like to replace the categories.tpl with the subcategories.tpl include but have the subcategories.tpl be reformatted to match the other menus. What should I do next?
Reply With Quote
  #4  
Old 07-26-2004, 07:37 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

save your images in skin1/navpics/ folder and name them so that the file name is that same as the category id with the gif extension.

for example your storage category image should be saved as 103.gif

Code:
<table cellpadding="5" cellspacing="0"><tr> {section name=cat_num loop=$categories} <td> <a href="home.php?cat={$categories[cat_num].categoryid}" > <img src ="{$ImagesDir}/navpics/{$categories[cat_num].categoryid}.gif"> </a> </td> {/section} </tr> </table>

you should be able to see what is going on from the code ive supplied now.

theres a setting in general settings about showing subcategories in the categories menu
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #5  
Old 07-26-2004, 04:17 PM
 
mikea93449 mikea93449 is offline
 

Member
  
Join Date: Jul 2004
Posts: 22
 

Default

Thank you again Shan! The fixes you stated worked perfectly! My categories menu that was showing on the left now reads Sub-Categories (categories.tpl) and displays the sub-categories for whatever category is clicked on at the top of the page.

The weird thing that happens is once you click on a sub-category item, the sub-categories disappear. Is there anyway to keep the sub-categories visible until a new category is clicked on?

Thank you again for your help!
Mike

Once again... the site is located at: http://www.solutionsforliving.biz/index.php
Reply With Quote
  #6  
Old 07-26-2004, 04:37 PM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

afraid not, its one of the drawbacks on how the categories are stored in the database in versions before v4.0.0

its because there are no more subcategories that nothing shows
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #7  
Old 07-26-2004, 04:46 PM
 
mikea93449 mikea93449 is offline
 

Member
  
Join Date: Jul 2004
Posts: 22
 

Default

Hi Shan,
Would upgrading to 4.0 help? Or is there any other way to modify the code to keep the subcategories in place?

Thank you,
Mike
Reply With Quote
  #8  
Old 07-26-2004, 04:49 PM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

Ive had the same problem myself

Ive not tried it in 4 yet but I see the way that categories are handled is better.

V4 is not realy ready for production sites yet even though Im developing one myself at the moment. its not due for release for a while though.

best way prior to v4 is to get rid of the categories side menu altogether and just use the subcategory links that appear in the center column
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #9  
Old 07-26-2004, 05:00 PM
 
mikea93449 mikea93449 is offline
 

Member
  
Join Date: Jul 2004
Posts: 22
 

Default

Actually, what I was hoping to do was to keep the subcategories on the left, then in the middle column, display featured products when the main category is clicked on, then product listings when the subcategory is selected. I don't suppose there would be anyway to write a new *.tpl file that would be able to keep the subcategories listed?

Thanks again,
Mike
Reply With Quote
  #10  
Old 07-27-2004, 03:44 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

i gave up in the end when trying it with v3.5.x
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 06:13 AM.

   

 
X-Cart forums © 2001-2020