V4 - keeping first level subcategories viewable at all times
Hey all,
I'm working with the newest version of x-cart and let me start off by saying that there are a lot of improvements ~ thx x-cart team!! Now for my delimia. I've made a couple of simple mods to the cart. http://www.designertrends.com/temp/amish/home.php The first is simply showing the categories in a horizontal line across the header. Here is the code: Code:
{* $Id: categories_test.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *} The second shows available subcategories (if applicable) where the categories menu would normally go. I inserted a simple if statement in customer/home.tpl which takes the place of the categories include statment. Here is the code for that: Code:
{if $subcategories ne "" and $current_category.category ne "" and $config.General.root_categories ne "Y"} You'll notice that I have added a file named subcategories.tpl within the customer directory (not to be confused with customer/main/subcategories.tpl). Here is the code for that file: Code:
{* $Id: subcategories.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *} If you follow the url I provided, it will take you to the home page. If you click on one of the categories that has a subcategory (books, videos or dolls) you'll notice the subcategories are shown on the left. That all works great and I'm pleased with it BUT when you click on a subcategory such as videos/cd audio, all of the subcategories (cd audio, dvd, video cassettes) under the root category (videos) disappear. I would like to keep the first level subcategories visable no matter which subcategory you are in. Any ideas or suggestions would be greatly appreciated. |
Here you go,
I did just this the other day, its a bit crafty how it works but it does the job. It only works for a single level of subcategories though Code:
| This is for V4 |
B-E-A-Utiful - thx so much shan.
By the way, if anyone else wants to use this mod in the future, I had to change the if statement in customer/home.tpl to this: Code:
{if $current_category.category ne "" and $config.General.root_categories ne "Y"} Now back to fine tuning skin.css ](*,) |
Thanks ALOT... That is very helpful. One additional question: Is there a way to make it so the subcategories appear in columns horizontally? Im trying to figure this out but I might be at a dead end..
THANKS AGAIN! -mike |
you should be able to use the code that shan provided. I removed the | in his code and replaced it with a
b/c it was lining them up horz. Good luck and let me know if you need more help. |
heres a similar thread for doing this in versions prior to V4
http://forum.x-cart.com/viewtopic.php?p=54761#54761 |
I have everything working except the:
{if $subcategories ne "" and $current_category.category ne "" and $config.General.root_categories ne "Y"} { include file="customer/subcategories.tpl" } {/if} code that should display the subcategories of the left hand side once a root categorie is "clicked". I place this code where the categories include statment was in the customer/home.tbl file. If I comment out the {if} statement the subcategorie menu loads fine and will display the correct subcategorie for the root categorie that is clicked. Why would the if statement not work. Did I put it in the wrong place? I'm running version 4.0.6. Thanks for your help.. |
You may want to check this mod out. It works with categories of any depth, although it will only list the first level of sub-categories for the current category.
Open customer/categories.tpl replace: Code:
{if $config.General.root_categories eq "Y"} With... Code:
{if $config.General.root_categories eq "Y"} Cheers, |
hey, nice tool, good coding!!!
i'm using version 4.0.11. i've done many mods and hacks with this great shopsystem. But one problem i couldn't solve. On the right side there is a navigation panel with the following structure: MAINPAGE: MAINCATEGORIES -entry1 -entry2 -entry3 -entryn Detailpage of one MAINCATEGORY: MAINCATEGORIES -entry1 -entry2 -entry3 -entryn SUBCATEGORIES to the selected maincat -sub_entry_child1_1 -sub_entry_child1_2 -sub_entry_child1_3 -sub_entry_child1_n Never the less there are only maincategories with one "child". If i've choosen one sub_entry, the following box shuld be shown SUBCATEGORIES -sub_entry_child1_1 -sub_entry_child1_2 -sub_entry_child1_3 -sub_entry_child1_n That means if i've selected a product or one sub_category a box with all subcategories should be shown. How can i realize this ???? i've there's somebody with icq, my uin is 123126029, please help me!!! |
Quote:
i've been after the problem for a few weeks now. saw a mod this morning that might be it, but i'm still working on it. i'll try to keep everyone updated. it's the never ending {parentid} vs. {categoryid} |
All times are GMT -8. The time now is 07:16 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.