| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
seperate categories in different blocks | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
seperate categories in different blocks
I want to seperate the main categories in different blocks for better viewing.
For example, I have root categories: "flower", "chocalate"...... I also set up a root category named "Shop by occasions". There are some subcategories within "Shop by occasions", such as "anniversary", "birthday"..... I want cat & subcats of "Shop by occasions" NOT displaying in "category" box, but in a seperate box. So the final looking of the menu should like: CATEGORIES flowers chocalate ........ MANUFACTURERES ....... SHOP BY OCCASIONS anniversary birthday ....... There is a mod in herehere, but not really the way I want it. Any help? Thanks in advance!
__________________
x-cart 4.0.14 Pro |
|||||||
#2
|
|||||||||
|
|||||||||
a simple way to do it is to set the pos field of the categories so that anything with a value of say 500 + is for shop by occasion and anything below 500 is standard
next create a copy of the categories.tpl and then just set up a if statement to check the value of the pos field in each of them to display the right categories. something like Code:
__________________
Looking for a reliable X-cart host ? You wont go wrong with either of these. EWD Hosting Hands On Hosting |
|||||||||
#3
|
|||||||
|
|||||||
I combined some code from here and here
The results almost achieve what I want, but still not exactly. Now it looks like: ------------------------- CATEGORIES ------------------------- FLOWERS CAKE ------------------------- ------------------------- OCCASIONS ------------------------- BIRTHDAY LOVE ------------------------- (click "flower" or "cake" will show its subcategories) But for some reason, there is a blank area between "OCCASIONS" and "BIRTHDAY". And it's too close for "CAKE" and "OCCASIONS". There is another headache. In order to achieve this, I set all the occasions as root categories, and set the first occasion's POS. as 900. But by this way, it's too confusing for product management in backend. I'd like to setup a root categories as "Shop by Occasions" and all the occasions as subcategries. "Shop by Occasions" should appear as a seperate block instead of a category. Any help how can I modify the code? Below is my current categories.tpl: Code:
Thanks in advance!
__________________
x-cart 4.0.14 Pro |
|||||||
#4
|
|||||||||
|
|||||||||
Re: seperate categories in different blocks
Ok, I'm still a little lost.
As of right now the other Category is showing up but all of the links are below Category 1 and none other 2. Plus I want a total of 3 categories. Can someone please help???? Here is what I have for /customer/categories.tpl: {* $Id: categories.tpl,v 1.26 2005/11/17 06:55:37 max Exp $ *} {capture name=menu} {if $active_modules.Fancy_Categories ne ""} {include file="modules/Fancy_Categories/categories.tpl"} {assign var="fc_cellpadding" value="0"} {else} {if $categories[cat_num].pos < 20} {if $config.General.root_categories eq "Y"} {foreach from=$categories item=c} <a href="home.php?cat={$c.categoryid}">{$c.category}< /a> {/foreach} {else} {foreach from=$subcategories item=c key=catid} <a href="home.php?cat={$catid}">{$c.category}</a> {/foreach} {/if} {/if} {/if} {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title="Print Products" menu_content=$smarty.capture.menu } /customer/categories2.tpl: {* $Id: categories.tpl,v 1.26 2005/11/17 06:55:37 max Exp $ *} {capture name=menu} {if $active_modules.Fancy_Categories ne ""} {include file="modules/Fancy_Categories/categories.tpl"} {assign var="fc_cellpadding" value="0"} {else} {if $categories[cat_num].pos > 20} {if $config.General.root_categories eq "Y"} {foreach from=$categories item=c} <a href="home.php?cat={$c.categoryid}">{$c.category}< /a> {/foreach} {else} {foreach from=$subcategories item=c key=catid} <a href="home.php?cat={$catid}">{$c.category}</a> {/foreach} {/if} {/if} {/if} {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title="Print Packages" menu_content=$smarty.capture.menu }
__________________
Stealth Cords - Discrete Power Cords for Automotive Enthusiasts www.stealthcords.com X-Cart version: 4.1.9 |
|||||||||
#5
|
|||||||||
|
|||||||||
Re: seperate categories in different blocks
Quote:
Here is the original code.
__________________
Stealth Cords - Discrete Power Cords for Automotive Enthusiasts www.stealthcords.com X-Cart version: 4.1.9 |
|||||||||
|
|||
X-Cart forums © 2001-2020
|