![]() |
New section with popular categories
Hi Folks,
I need some help and I know how good most of you are at hacking to bits xcart. We are looking to add a new section just above the categories on the left sidebar. I have figured out that you can just include a tpl file and it will display it. What i'm trying to do is add a section with our 5 most popular categories, these will be static and not dynamically generated. Our site is www.robertsonpackaging.com I tried editing the manufactures module but it doesnt show the same as a category would, ie its just shows a list of products. I also tried just using html but not sure how to sort the css to look the same as the categories below which use fly out menus. We need to have some existing categories listed above the existing categories list and then removed from the categories below. How would I go about this? I have some limited php/html knowledge so can hack some bits together to get what i'm looking for but just can't seem to get my head round this smarty stuff just yet. Any help with this would be greatly appreciated. Thanks in advance D-A |
Re: New section with popular categories
Are you trying to include your "popular categories" within the "All Categories" box or separately? Do you want "flyout menus" or just a list?
Anyway, the easiest way is to make a "clone" of common_files/customer/categories.tpl naming it popular_categories.tpl. Something like this... Code:
{capture name=menu} Change the part that says "<li{interline name=categories}><a href="LINK TO CATEGORY" title="CATEGORY NAME">CATEGORY NAME</a></li>" to your link and title, and repeat for each category. Then, in customer/left_bar.tpl for whatever skin you are using, look for {include file="customer/categories.tpl"} and just above it add {include file="customer/popular_categories.tpl"} EDIT: I made a mistake and forgot to exclude "flyout menus" in my original post (fixed now) |
Re: New section with popular categories
Quote:
Quote:
Quote:
Ahh ok thanks mate, so basically I use: Code:
<li{interline name=categories}><a href="LINK TO CATEGORY" title="CATEGORY NAME">CATEGORY NAME</a></li> I'll give this a wee bash now on my dev site and see if I can get it to work. Thank you so much for your help and speedy reply, I really appreciate it. |
Re: New section with popular categories
JWAIT,
Thank you so much for your help I managed to get it to work using the following code Code:
{capture name=menu} I don't know how difficult it would be to use this with the flyout module as it looks different from the other categories but it works for now which is great. Do you know if there is a way of hiding categories in the main category list so they don't show up in the section below? like an exclude option or something like that? I really appreciate your help with this mate, you make it look so easy :) Thanks D-A |
Re: New section with popular categories
You might try something like this in common_files/customer/categories.tpl...
Code:
{foreach from=$categories_menu_list item=c name=categories} There are 3rd party mods that will hide categories. Check this thread for a possible solution.... http://forum.x-cart.com/showthread.php?t=44414 You might check this thread for a different solution... http://forum.x-cart.com/showthread.php?t=52493&page=2 |
Re: New section with popular categories
Quote:
Thanks mate getting closer to what I need with your help :) I have just turned off flyout categories as it seems too complicated to try and get this working with those. I had a look at the code and it looks very complicated. This is the code I have used but it doesn't seem to work. It actually doesn't seem to do anything. I dont know if I have missed something. I have it on my live site at the moment. www.robertsonpackaging.com Here is the code I used Code:
:w |
Re: New section with popular categories
Try changing "neq" to "ne" (I', not sure about that part being correct, its from someone else).
|
Re: New section with popular categories
JWait I just wanted to thank you for your help.
I have managed to get it all working now. I have even managed to remove the categories from the all categories list using an if statement that checks the the category position and if it's set to 666 it doesn't display it. Your help is greatly appreciated. D-A |
Re: New section with popular categories
Quote:
I'm an ejit, it doesn't actually work at all :) I just thought it did but hadn't noticed it had just moved the categories to the bottom of the categories list. I guess I'll need to play about with that bit of code and see if I can get it to work. |
Re: New section with popular categories
Quote:
I managed to get it working. I just replaced the code Code:
{if $categories[cat_num].categoryid neq XXX} With this Code:
{if $c.order_by neq "XXX"} That wasn't so bad as I thought. |
Re: New section with popular categories
There are a few threads that discuss separate categories lists. Some are kind of old but you should be able to understand the concept...
http://forum.x-cart.com/showthread.php?t=37234 http://forum.x-cart.com/showthread.php?t=52284 http://forum.x-cart.com/showthread.php?t=45126 |
All times are GMT -8. The time now is 10:14 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.