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

Drop down/flyout categories... where do I start?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #51  
Old 08-09-2004, 09:39 PM
 
1320AutoSports 1320AutoSports is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 89
 

Default

I just had another thought (I feel like Cosmo from the Fairly Oddparents, so sad, I wish I could say I was old enough to have kids, so I could blame it on them that I know caracters from cartoons on nick.).

Ok, so here are some more of my thoughts (beware):

I don't think the categories.php has to be changed at all, but ONLY the dropdown.tpl, home.tpl (to include the dropdown, DUH) and the categories.tpl. This is why..

In funks original code (again here):
Code:
// funkydunk modification // amended query to get the main cat and subcat for each record $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 maincat, SUBSTRING_INDEX($sql_tbl[categories].category, '\/', 2) as subcat 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"));

It seems to me all that is being done is verifying the category is avaliable, and the biggest thing is, this is where the values of maincat and subcat are defined, but in 4.0.x we have parentid, which also should mean we don't have to set the index's right? Or am I wrong?

If we need to define the SUBSTRINGS we can define them much simpler by going SUBSTRING_INDEX($sql_tbl[categories].categoryid ? or something like that, again my ignorance to programming is where I can not be helpful.

So here are some of my thoughts:. (note I am only putting up the modifying part of the dropdown.tpl)
Code:
{section name=cat_num loop=$categories} {assign var="temp" value="0"} {section name=cat loop=$allcategories} {if $allcategories[cat].maincat eq $categories[cat_num].category} {if $allcategories[cat].subcatonly} {$temp} {if $temp gt 0} linkset[{$smarty.section.cat_num.index}] +='<div class="menuitems">{$allcategories[cat].category}</div>' {else} linkset[{$smarty.section.cat_num.index}] ='<div class="menuitems">{$allcategories[cat].category}</div>' {/if} {math equation="temp+1" temp=$temp assign=temp} {/if} {/if} {/section} {/section}

Would we just modify this section:
Code:
{if $allcategories[cat].maincat eq $categories[cat_num].category} {if $allcategories[cat].subcatonly}

to say something like:
Code:
{if $allcategories[cat].categoryid eq $categories[cat_num].category} {if $allcategories[cat_num].parentid}

or something along those lines.

We would also have to change the categories.tpl to match these changes..

Am I making any sense? Or am I on the wrong path to completion for 4.0.x? Thanks for pointing me in some kind of direction, because I feel like I am getting myself even more confused. Thanks
Reply With Quote
  #52  
Old 08-10-2004, 01:01 AM
 
donavichi donavichi is offline
 

X-Adept
  
Join Date: Apr 2004
Location: United Kingdom
Posts: 697
 

Default

Another quality mod from funkydunk!
-------------------------------------------

I've just implemented this and am really pleased with it, thanks, man!

I too have a question, however.....

How do you make the flyout menu flyout again, to display a sub-category's subcategories?

Answers on a postcard!

Many Thanks
__________________
Best regards,

Donavichi.
- - -

Website Copywriting || Web Design || FAQs || Home & Garden Blog
Reply With Quote
  #53  
Old 08-10-2004, 09:13 AM
 
Cameron Cameron is offline
 

eXpert
  
Join Date: Jan 2003
Location: Washington State, USA
Posts: 224
 

Default

Finally a question that I can help with. The mod only provides for popping out one sub category -- to do more would significantly increase a page's load time and database stress. Funky said words to that effect waaaayyyy early in this thread somewhere.

Quote:
Originally Posted by donavichi
Another quality mod from funkydunk!
-------------------------------------------

I've just implemented this and am really pleased with it, thanks, man!

I too have a question, however.....

How do you make the flyout menu flyout again, to display a sub-category's subcategories?

Answers on a postcard!

Many Thanks
__________________
Current project: 4.4.2
Reply With Quote
  #54  
Old 08-10-2004, 11:36 PM
 
donavichi donavichi is offline
 

X-Adept
  
Join Date: Apr 2004
Location: United Kingdom
Posts: 697
 

Default

OK Cool, thanks.

I didn't pick up on that because I was speed reading but I'm glad you cleared it up for me, good work.


Regards,
__________________
Best regards,

Donavichi.
- - -

Website Copywriting || Web Design || FAQs || Home & Garden Blog
Reply With Quote
  #55  
Old 08-12-2004, 09:33 PM
 
1320AutoSports 1320AutoSports is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 89
 

Default

Anyone feel like helping me out? Just AIM me..

I think I have most of it figured out..

With how the 4.0.1 is, I am still going to have to do a substring index or try to explode the categoryid_path sql entry and do a if eq statement for those..

If someone wants to help me.. please let me know.
Reply With Quote
  #56  
Old 08-17-2004, 01:22 PM
 
mlannen@tecconvt.net mlannen@tecconvt.net is offline
 

Member
  
Join Date: Jun 2004
Posts: 14
 

Default NetScape & Mozilla Firefox Support?

I was curious if anyone has tried this Mod and tried viewing it in Netscape or Mozilla Firefox?

I tried Netscape 7.2 and Mozilla Firefox 0.8 and neither work properly with the popup menus. It kind of just overlaps the main category item. Hard to explain.

It works just fine in my IE 6.0. But a small amount of my clients use Netscape / Mac / Mozilla. I knoe they should prolly just use IE but....

ANy suggesstions??? Funkydunk?

THanks so much in advance!

`Mike
Using X-Cart 3.4.14 - Linux
Reply With Quote
  #57  
Old 08-17-2004, 01:57 PM
 
1320AutoSports 1320AutoSports is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 89
 

Default Re: NetScape & Mozilla Firefox Support?

Quote:
Originally Posted by mlannen@tecconvt.net
I was curious if anyone has tried this Mod and tried viewing it in Netscape or Mozilla Firefox?

I tried Netscape 7.2 and Mozilla Firefox 0.8 and neither work properly with the popup menus. It kind of just overlaps the main category item. Hard to explain.

It works just fine in my IE 6.0. But a small amount of my clients use Netscape / Mac / Mozilla. I knoe they should prolly just use IE but....

ANy suggesstions??? Funkydunk?

THanks so much in advance!

`Mike
Using X-Cart 3.4.14 - Linux

I have a mod similar to this working on 4.0.1 and have tested with Firefox .9 and Konquror 3.2.3-2.kde Red Hat and it works just fine for both

If you could check www.mtgcardhouse.com/store for me with Nutscrape 6.x or 7.x that would be awesome
Reply With Quote
  #58  
Old 09-15-2004, 06:45 AM
 
24md 24md is offline
 

Advanced Member
  
Join Date: Jul 2003
Location: United Kingdom
Posts: 44
 

Default

Wow, this is a fantastic mod, I am ever grateful for this. I got it to work a treat in 3.5.7.

Just what I wanted.
__________________
www.anime-on-line.com
4.5.2 (live)
php 5.3.17
mysql 5.5.27
Reply With Quote
  #59  
Old 09-17-2004, 03:23 PM
 
BHMedia BHMedia is offline
 

Advanced Member
  
Join Date: Sep 2003
Posts: 71
 

Default

Hey - How did you get it to work with 3.5.7? I have 3.5.7 and I can't get it to work on this one site - I get a java script error...
Reply With Quote
  #60  
Old 09-18-2004, 05:59 AM
 
24md 24md is offline
 

Advanced Member
  
Join Date: Jul 2003
Location: United Kingdom
Posts: 44
 

Default

Hey

I used funkydunk's code and instructions on the first page of this post. Just followed exactly what he said and it worked.

Then added the CSS code from page two to my skin.css file.

I will post my code if you want, but it is the same as his.
__________________
www.anime-on-line.com
4.5.2 (live)
php 5.3.17
mysql 5.5.27
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 02:05 AM.

   

 
X-Cart forums © 2001-2020