X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Drop down/flyout categories... where do I start? (https://forum.x-cart.com/showthread.php?t=4502)

1320AutoSports 08-09-2004 09:39 PM

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

donavichi 08-10-2004 01:01 AM

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

Cameron 08-10-2004 09:13 AM

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


donavichi 08-10-2004 11:36 PM

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,

1320AutoSports 08-12-2004 09:33 PM

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.

mlannen@tecconvt.net 08-17-2004 01:22 PM

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

1320AutoSports 08-17-2004 01:57 PM

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 :)

24md 09-15-2004 06:45 AM

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.

BHMedia 09-17-2004 03:23 PM

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

24md 09-18-2004 05:59 AM

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.


All times are GMT -8. The time now is 06:46 PM.

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