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

Need to add second category menu added to left menu

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-26-2008, 02:21 PM
 
Janice Canada Janice Canada is offline
 

Member
  
Join Date: Jan 2008
Posts: 12
 

Default Need to add second category menu added to left menu

Hi;

I want to have a second products menu on the left side. I'm building an arts & crafts store in x-cart pro 4.1.9. My main products menu sorts by art medium...glass, wood etc. I also want a menu that lists products by type...Home and Garden, Jewellery etc. I read an older post "Simple Custom Menu Revisited - Categorymenu" about adding a menu but I couldn't match the code in my tpl files.

Does anyone know how to do this?

Thanks,
Janice
__________________
XCart Pro version 4.1.9
Reply With Quote
  #2  
Old 02-27-2008, 12:12 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: Need to add second category menu added to left menu

By default, the category described by the following list of fields:

examples for one:

PHP Code:
[3] => Array 
         ( 
             [
parentid] => 
             
[categoryid_path] => 
             
[category] => Books 
             
[avail] => 
             
[order_by] => 10 
             
[subcategory_count] => 
             
[product_count] => 10 
             
[is_icon] => 
             
[image_path] => ./images/C/c_3.gif 
             
[categoryid] => 
             
[icon_url] => http://localhost/images/C/c_3.gif 
         



What are the types of conversation?

You need to menu categories or products?

In the description of the category has no type, the type is just a product.
Reply With Quote
  #3  
Old 02-27-2008, 04:22 AM
  TelaFirma's Avatar 
TelaFirma TelaFirma is offline
 

X-Adept
  
Join Date: Nov 2002
Location: North Carolina USA
Posts: 930
 

Default Re: Need to add second category menu added to left menu

What you can do is add new categories in Admin and then add the products to all the categories that are relevant. Then, set the "POS" (or orderby) value for the "type" categories to very high numbers - say 1010, 1020, 1030, 1040...

Then you can change the categories.tpl file to only display categories below 1000, then create a duplicate of the categories.tpl and list those over 1000.

{foreach from=$categories item=c}
{if $c.order_by lt 1000}

...

{/if}
{/foreach}

then

{foreach from=$categories item=c}
{if $c.order_by gt 1000}

...

{/if}
{/foreach}
Reply With Quote
  #4  
Old 02-27-2008, 04:23 AM
 
Janice Canada Janice Canada is offline
 

Member
  
Join Date: Jan 2008
Posts: 12
 

Default Re: Need to add second category menu added to left menu

Thanks Yurij

Xcart usually has two menus for selling: products and manufacturers. I need a third menu that groups products by type. For example, if I was selling clothing it would mean that I need a main Products menu for pants, shirts, sweaters. But I want a second product listing by fabric type: cotton, wool etc.

My store is still under construction but you can see it at www.artisanvine.com/xcart/ The "Medium" menu needs to be split with the second menu starting with "Home and Garden".
Thanks for any help!
Janice
__________________
XCart Pro version 4.1.9
Reply With Quote
  #5  
Old 02-27-2008, 05:23 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: Need to add second category menu added to left menu

Better take advantage of the proposed option - TelaFirma.
He had flaws, but it the easiest and cheapest.
Adding additional classifier products - labour.

menu - Product Type
10 pants
20
shirts
30
sweaters
...........

menu -
fabric type
1010 cotton
1020 wool
1030 ............


hen adding a new product, just point to it additional category - "fabric type".
Reply With Quote
  #6  
Old 02-27-2008, 09:00 AM
 
Janice Canada Janice Canada is offline
 

Member
  
Join Date: Jan 2008
Posts: 12
 

Default Re: Need to add second category menu added to left menu

Thanks Telefirma;
I'm really new to xcart so I hope you can help me a bit more.

I've added the code to a new categories file - categories_type.tpl and added the include to customer/home.tpl. When I did that all my content disappeared except the products menu which still contained the "type" list as well.

New code:

categories_type.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 $config.General.root_categories eq "Y"}
{foreach from=$categories item=c}
{if $c.order_by gt 900}
<font class="CategoriesList"><a href="home.php?cat={$c.categoryid}" class="VertMenuItems">{$c.category}</a></font><br />
{/if}
{/foreach}

{else} {foreach from=$subcategories item=c key=catid}
<font class="CategoriesList"><a href="home.php?cat={$catid}" class="VertMenuItems">{$c.category}</a></font><br />
{/if}
{/foreach}
{/if}
{/if}
{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu cellpadding=$fc_cellpadding}


Then I added this to customer/home.tpl

<td class="VertMenuLeftColumn">
{if $categories ne "" and ($active_modules.Fancy_Categories ne "" or $config.General.root_categories eq "Y" or $subcategories ne "")}
{include file="customer/categories.tpl" }
<br />
{include file="customer/categories_type.tpl" }
{/if}

Any help would be great!

Janice
__________________
XCart Pro version 4.1.9
Reply With Quote
  #7  
Old 02-27-2008, 09:58 AM
  TelaFirma's Avatar 
TelaFirma TelaFirma is offline
 

X-Adept
  
Join Date: Nov 2002
Location: North Carolina USA
Posts: 930
 

Default Re: Need to add second category menu added to left menu

All you really need in your new file is:

{capture name=menu}
{foreach from=$categories item=c}
{if $c.order_by gt 900}
<font class="CategoriesList"><a href="home.php?cat={$c.categoryid}" class="VertMenuItems">{$c.category}</a></font><br />
{/if}
{/foreach}
{/capture}
{include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu}
Reply With Quote
  #8  
Old 02-27-2008, 11:08 AM
 
Janice Canada Janice Canada is offline
 

Member
  
Join Date: Jan 2008
Posts: 12
 

Default Re: Need to add second category menu added to left menu

THANK YOU!

It worked perfectly!

Janice
__________________
XCart Pro version 4.1.9
Reply With Quote
  #9  
Old 03-01-2008, 09:38 PM
  rkdiddy's Avatar 
rkdiddy rkdiddy is offline
 

Advanced Member
  
Join Date: Mar 2005
Posts: 60
 

Default Re: Need to add second category menu added to left menu

Are you able to add a third category. I was thinking you would have to set the lt OR gt to a between a number range. Is this possible?
__________________
Stealth Cords - Discrete Power Cords for Automotive Enthusiasts
www.stealthcords.com
X-Cart version: 4.1.9
Reply With Quote
  #10  
Old 03-03-2008, 07:17 PM
 
enrique enrique is offline
 

Member
  
Join Date: Dec 2005
Location: Mexico
Posts: 15
 

Default Re: Need to add second category menu added to left menu

Quote:
Originally Posted by Janice Canada
THANK YOU!

It worked perfectly!

Janice

Janice Canada
Would you please explain in more detail how you fix this?
Appreciate any help.
__________________
Tike
xcart v 4.1.9 [unix]
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 03:44 PM.

   

 
X-Cart forums © 2001-2020