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

Need help customizing category listing

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #41  
Old 10-20-2003, 12:32 PM
 
cbarning cbarning is offline
 

Advanced Member
  
Join Date: Aug 2003
Posts: 38
 

Default CAN ANYBODY DO THIS

Does anybody know how to do this for the most current version of X-Cart?
Reply With Quote
  #42  
Old 11-15-2003, 07:15 PM
 
SpeedWorx! Tech SpeedWorx! Tech is offline
 

Newbie
  
Join Date: Feb 2003
Posts: 4
 

Default

Also need this.... TTT
Reply With Quote
  #43  
Old 11-16-2003, 09:52 AM
  BoomBoomBap's Avatar 
BoomBoomBap BoomBoomBap is offline
 

Senior Member
  
Join Date: Nov 2002
Location: San Francisco
Posts: 184
 

Default

Consider me interested in a 3.4.x version of this as well...
__________________
Site 1 > XCART LIVE 3.4.12

Site 2 > XCART LIVE 4.0.17
Reply With Quote
  #44  
Old 11-17-2003, 09:15 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Using: http://www.dynamicdrive.com/dynamicindex1/switchmenu.htm
(slighty modified of course )

x-cart version: 3.4.9

edit skin1/customer/categories.tpl:
Code:
{literal} <style type="text/css"> .menutitle{ font-weight:bold; background-color:#EEEEEE; color:#000000; border:1px solid #000000; width:160px; cursor:pointer; margin-bottom: 0px; padding:3px; margin-left: 5px; border-bottom:0px; } .bottom{ margin-left: 5px; border-top:1px solid #000000; height:1px; width:168px; padding:0px; margin-bottom: 0px; } .sub{ margin-bottom: 0px; margin-left: 5px; border:1px solid #000000; background-color:#FFFFFF; color:#000000; width:160px; padding:3px; border-bottom:0px; } .menutitle:hover { background-color: #FFFFFF; color:#009F67; display: block; width: 150px; padding: 4px 0px; margin: 1px; TEXT-DECORATION: none; } </style> <script type="text/javascript"> if (document.getElementById){ document.write('<style type="text/css">\n') document.write('.sub{display: none;}\n') document.write('</style>\n') } function SwitchMenu(obj){ if(document.getElementById){ var el = document.getElementById(obj); var ar = document.getElementById("masterdiv").getElementsByTagName("span"); if(el.style.display != "block"){ for (var i=0; i<ar.length; i++){ if (ar[i].className=="sub") ar[i].style.display = "none"; } el.style.display = "block"; }else{ el.style.display = "none"; } } } </script> {/literal} {* Keep all menus within masterdiv *} <div id="masterdiv"> {* loop over root category, nested loop of entire category data to match all root cats *} {section name=cat_num loop=$categories} <div class="menutitle" onclick="SwitchMenu('{$categories[cat_num].categoryid}')">{$categories[cat_num].category_name}</div> <span class="sub" id="{$categories[cat_num].categoryid}"> {section name=subcat_num loop=$categories_data} {if $categories_data[subcat_num].root_category_name == $categories[cat_num].category && $categories_data[subcat_num].category_name != $categories[cat_num].category_name} <li type="square">{$categories_data[subcat_num].category_name} {/if} {/section} </span> {/section} {* bottom line *} <div class="bottom"></div> </div>

edit include/categories.php:

Comment out the line (just add a # in front of it):
Code:
$categories_data = func_query("select $sql_tbl[categories].*, SUBSTRING_INDEX($sql_tbl[categories].category, '\/', -1) as category_name from $sql_tbl[categories] ".($current_area=="C"?"where $sql_tbl[categories].avail='Y' $membership_condition ":"")." group by $sql_tbl[categories].categoryid order by ".($current_area=="C" ? "order_by" : "category"));

and add the following underneath it:
Code:
$categories_data = func_query("select $sql_tbl[categories].*, SUBSTRING_INDEX($sql_tbl[categories].category, '\/', -1) as category_name, SUBSTRING_INDEX($sql_tbl[categories].category, '\/', 1) as root_category_name from $sql_tbl[categories] ".($current_area=="C"?"where $sql_tbl[categories].avail='Y' $membership_condition ":"")." group by $sql_tbl[categories].categoryid order by ".($current_area=="C" ? "order_by" : "category"));

Then go down to the bottom of the file where the "Assign Smarty variables" comment is, underneath it add:

Code:
$smarty->assign("categories_data",$categories_data);

Should do the trick, Just keep in mind if you your using a root cat to list products in its not going to be shown or clickable in this menu, all your roots cats MUST have sub cats for it to work properly.

The style sheet and javascript code could be moved elsewhere to the proper places like skin1/skin.css and skin1/customer/home.tpl But I'm leaving it in categories.tpl for ease of implementing.

Also for usuability this should really be keeping up with the root cat id, and somehow triggering it once a link is clicked. So when your under a certain sub category the root category is already expanded upon page refresh. So suggestions welcome.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #45  
Old 11-18-2003, 11:15 AM
 
cbarning cbarning is offline
 

Advanced Member
  
Join Date: Aug 2003
Posts: 38
 

Default

Will this work with version 3.4.6?
__________________
4.0.0 in dev, 3.4.14 deluxegrills.com, 3.4.6 kegworks.com Modded by X-Cart: Freight Zones, Linkshare, Shipping Fixes, Individual Product Shipping Methods, Banners, Custom Export for FileMaker Pro, PHP: 4.3.7, MySQL server: 4.0.20, Apache1.3.1 OS: Linux
Reply With Quote
  #46  
Old 11-18-2003, 11:23 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

The 3.4.x branch should be good, not sure about 3.3.x or the new 3.5.x
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #47  
Old 12-19-2003, 04:20 PM
 
jordan0 jordan0 is offline
 

Advanced Member
  
Join Date: Oct 2003
Location: San Francisco, CA
Posts: 77
 

Default Gift Certificates weirdness after Boomer's mod...

I installed Boomer's category menu mod (which works great and looks great, thanks again boomer!) a couple weeks ago. I just noticed, though, that when I go the gift certificate page (giftcert.php) the category menu writes the list of category names twice. For example if I have the categories:
Model Kits
Beads
Art Supplies

It will write:

Model Kits
Beads
Art Supplies
Model Kits
Beads
Art Supplies

The menu still works, but this is a strange annoyance. Feel free to have a look at this: https://www.kit-kraft.com/customer/giftcert.php

Anyone else have the same problem?
Thanks
- Jordan
__________________
Jordan Sitkin
http://www.kitkraft.biz
X-Cart 4.0.18 [unix]
Reply With Quote
  #48  
Old 01-05-2004, 07:21 PM
 
jordan0 jordan0 is offline
 

Advanced Member
  
Join Date: Oct 2003
Location: San Francisco, CA
Posts: 77
 

Default A new problem...

I love the way Boomer's DHTML menu solution looks and functions Б─⌠ letting the customer check out the subcats without having to load a new page is cool.
However, I have been trying to find a way to modify it so that it doesn't dump all of my nested subcategories under the main category. For example, If i've got
Code:
Model Kits/Cars/Ford /Honda /Toyota /etc...
And you click "Model Kits" in the category menu, I want it to just show "Cars". Right now, every category that has the root_category_name of "Model Kits" is lumped into the same list of subcategories.
How do I make it so that only the first level of subcats is displayed? Is this information stored in the $subcategories array already?

Here is the relevant code from my categories.tpl:
Code:
{section name=cat_num loop=$categories} <div class="menutitle" onclick="SwitchMenu('{$categories[cat_num].categoryid}')">{$categories[cat_num].category_name}</div> <span class="sub" id="{$categories[cat_num].categoryid}"> {section name=subcat_num loop=$categories_data} {if $categories_data[subcat_num].root_category_name == $categories[cat_num].category && $categories_data[subcat_num].category_name != $categories[cat_num].category_name} <li type="square">{$categories_data[subcat_num].category_name} {/if} {/section} </span> {/section}

thanks for your help so far!
-Jordan
__________________
Jordan Sitkin
http://www.kitkraft.biz
X-Cart 4.0.18 [unix]
Reply With Quote
  #49  
Old 02-21-2005, 08:00 PM
  eaglemobiles's Avatar 
eaglemobiles eaglemobiles is offline
 

Senior Member
  
Join Date: Jan 2005
Posts: 167
 

Default

After a very long search on forum i found the mod i was looking for but i am not sure can I use this mod for 4.0.11? will be grateful for reply.

Thanks
__________________
X-Cart Gold 4.3.2
X-Cart Gold 4.4.1
Unix

High Quality CCTV DVRs & Cameras
http://www.eaglemobiles.co.uk/CCTV
Reply With Quote
  #50  
Old 11-14-2005, 05:33 PM
  shipmerchant's Avatar 
shipmerchant shipmerchant is offline
 

eXpert
  
Join Date: Mar 2005
Posts: 361
 

Default

I have been trying to get this to work on the new carts with no luck. Does any one here have this working on 4.016?

THanks in advance!
__________________
Mil Mascaras
Live Xcart Site #1-V- 4.1.8
Live Xcart site # 2-V 4.4.3
CDSEO Mod - Firetank MM30 - 7DANA- The bestTemplates!
Linux - EWD Host Servers awesome service!
AlteredCart One Page Checkout
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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:23 AM.

   

 
X-Cart forums © 2001-2020