![]() |
Adding a second 'categories' section
Is it possible to add a second "categories" box below the first?
I have the categories and subcategories setup however I would also like to make a seperate listing below that for "product lines". This way both the categories listing and a second listing would be stationary as the customers looked through the products. |
Re: Adding a second 'categories' section
I would like to know the same. When I upgraded my cart, it seems the code was lost and now the code from 4.0 doesn't work with 4.1.
Please help. |
Re: Adding a second 'categories' section
Yes i would like to know basically the same as the above posters do. Per the left navigation, instead of just one long list of links under a category, how would you add a caption to each one.
For instance Mens Items xxxx xxxx xxxx Womens items xxxx xxxx xxxx etc,... how can this be done? |
Re: Adding a second 'categories' section
Try this mod:
X-Cart 3 Level Advanced Dynamic Category Menu v4.x It gives the appearance for what you are wanting and with positioning you can get it exactly the way you want. http://www.xcartmods.co.uk/category/x-cart-navigation/ |
Re: Adding a second 'categories' section
I believe that this could be done with an if statement so that products say numbered from 1 - 500 appear in the first box and products from 501 - 1000 appear in the second box.
You would have to copy the original categories tpl file to a second file name with the if statement in place in both files. You would also have to modify the customers home page to include the new box. I am not exactly sure how to write the if statement, by I will work on it. Hopefully someone will help out here. |
Re: Adding a second 'categories' section
Quote:
Thank you Duramax for looking into this. |
Re: Adding a second 'categories' section
That would be something like this:
{foreach from=$categories item=c} {if $c.order_by gt 200 and $c.order_by lt 300} <div class="CategoriesList"><a href="home.php?cat={$c.categoryid}" class="VertMenuItems">{$c.category}</a></div> {/if} {/foreach} That will show categories with a POS between 200 and 300. |
Re: Adding a second 'categories' section
Thank you balinor, You are always a help here.
There was a post on here on how to add a second box. Do you by chance know where it is, I am searching and can not find. |
Re: Adding a second 'categories' section
Only when I'm not bugging people to update their signature or post in the right place ;)
|
Re: Adding a second 'categories' section
Thanks Ryan.
|
Re: Adding a second 'categories' section
Quote:
http://forum.x-cart.com/showthread.php?t=19871&highlight=custom+menu http://forum.x-cart.com/showthread.php?t=24054&highlight=add+menu I have these saved in my favorite :) |
Re: Adding a second 'categories' section
The code has a bug when doing a search, all categories go under menu 1 leaving menu 2 blank!
I've been trying to figure this out for a while, can somebody help? |
Re: Adding a second 'categories' section
I've experienced the problem of a second menu not displaying on search result pages whilst trying to get a second category menu to appear in my 4.3 installation. I managed to solve the problem, so thought I'd share what I did in case others might find it useful. Please note, though, that I have only tried this on 4.3 and do not know if it will be backwards compatible. In addition, I'm not a programmer, so before you try my solution make sure you've got a working back up of all your files - better safe than sorry. :-)
First of all, I copied customer/categories.tpl and created a new file called customer/categories_type.tpl. In each file I changed the {foreach} loop to be either (code I've added is highlighted): Code:
{foreach from=$categories_menu_list item=c name=categories} Code:
{foreach from=$categories_menu_list item=c name=categories} Code:
{include file="customer/categories_type.tpl"} to my customer/home.tpl in the right place for where I wanted the second menu to display. Lastly, I created a new variable in my language file so that I could give the new menu a different name. With the category position order sorted out, this displays my two category menus exactly where I want them, and with the right categories in each one. Except on the search results page, that is. For some reason, the search results page (and the advanced search page) ignores the foregoing code and displays all of the categories in the original menu - even the ones that should be in the second menu. The second menu is empty, although the heading is still displayed. From experimenting, it appears that the search results will ignore the {if} statement added to the categories.tpl and categories_type.tpl files if you use $c.order_by to define it. The only way I can get it to work is to use $c.categoryid instead. This is the number that is assigned to the category upon creation, and which you can only see if you look at your SQL database in something like PHPMyAdmin. Looking at my database, the first category has $c.categoryid 10 and then all the others are numbered sequentially from there - with gaps for some that have been deleted. The $c.categoryid is completely unrelated to the position order that you assign to categories in your X Cart admin. So, armed with the necessary $c.categoryid information, I've changed my {foreach} loops to be: Code:
{foreach from=$categories_menu_list item=c name=categories} Code:
{foreach from=$categories_menu_list item=c name=categories} Done this way, the correct categories show up in the correct menus and are visible on every page - including search results pages. It's more of a fiddle to do it this way, as there is no reference to the $c.categoryid in the X Cart admin, and when you add new categories their $c.categoryid will always be the next sequential number - which makes it less easy to assign them to the correct menu, without changing your {if} statements. But it does display as needed and doesn't seem to mess anything else up. |
Re: Adding a second 'categories' section
Quote:
Thank you for posting this. I was having the same issue and your input helped me resolve my issue. I just wanted to add that you can get the category id without the hassle of going into the database. The id's for categories, products, manufacturers, etc. are actually used as parameters in the url's that you click to edit them. Simply login to your admin and hover over any category link and you can get your id's. :) |
All times are GMT -8. The time now is 09:01 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.