X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Need to add second category menu added to left menu (https://forum.x-cart.com/showthread.php?t=37874)

Janice Canada 02-26-2008 02:21 PM

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

Yurij 02-27-2008 12:12 AM

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.

TelaFirma 02-27-2008 04:22 AM

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}

Janice Canada 02-27-2008 04:23 AM

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

Yurij 02-27-2008 05:23 AM

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".

Janice Canada 02-27-2008 09:00 AM

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

TelaFirma 02-27-2008 09:58 AM

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}

Janice Canada 02-27-2008 11:08 AM

Re: Need to add second category menu added to left menu
 
THANK YOU!

It worked perfectly!

Janice

rkdiddy 03-01-2008 09:38 PM

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?

enrique 03-03-2008 07:17 PM

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.

smaavie 03-04-2008 01:42 AM

Re: Need to add second category menu added to left menu
 
Hello all,

I have followed the above instructions to successfully generate 2 'categories' menus.

Both these menus have the title 'Categories'.

How can I change this so that the first menu is called "Browse By Product Type", and the second is called "Browse By Collection"?

Thanks in advance for all your help.

Janice Canada 03-04-2008 04:25 AM

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

Go to languages-labels in your admin section and search for the name of your category. It should show you both templates. My new menu was called categories_type.tpl. I changed the label on that to be Showcase.

Regards,
Janice

smaavie 03-04-2008 10:31 AM

Re: Need to add second category menu added to left menu
 
Many thanks for posting the solution - each of my categories menus now has the correct unique title.

Cheers!

enrique 03-04-2008 06:51 PM

Re: Need to add second category menu added to left menu
 
Can somebody please help with post #10?
Thank you

enrique 03-06-2008 04:22 PM

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 kindly explain in detail how you did this? I'm trying to add the same thing.

Thank you

enrique 03-11-2008 08:49 AM

Re: Need to add second category menu added to left menu
 
Anyone???

enrique 03-18-2008 06:51 AM

Re: Need to add second category menu added to left menu
 
Hi,
I wanted to add second category menu added to left menu but this thead is not too specific for a newy like me. If some one please explain it to me, I appreciate any help.
Thank you.

alw_23 04-28-2009 12:02 PM

Re: Need to add second category menu added to left menu
 
Thanks so much. Just another confirmation to let you know it works in 4.1

Kajsa 08-27-2009 04:45 AM

Re: Need to add second category menu added to left menu
 
Hi,

i managed to make a category but...
I changed the POS of the categories to under 100, but it still show all categories. And the categories above 100 is showing the categories it should.

in categories.tpl i added:

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

and in my new tpl i added:

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

Can anyone help?

/Kajsa

Lock15 11-24-2009 08:05 AM

Re: Need to add second category menu added to left menu
 
Is this only for the Pro version? When I tried to change the POS. for our categories so that I could add the second menu, our categories only allow up to 3 characters which would stop at 999. Is there somewhere that I can increase the POS. to 4 characters?


All times are GMT -8. The time now is 09:58 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.