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)
-   -   Sliding Menu that displays categories and sub-categories (https://forum.x-cart.com/showthread.php?t=1696)

Gibberish 10-29-2003 08:40 AM

If your still around Deals on Deals I have been ripping your code apart trying to get it to work on my xcart 3.4.8

I am stuck on one part though. I am getting an error that says:

Warning: Variable passed to each() is not an array or object in /usr/www/htdocs/saddlemen/test_site/xcart/customer/slidedown.php on line 32
slideMenu.init();

Line 32 is the bold one:

function preparelist($list)
{
$r = array();
$c = false;
$cnt = 1;
while (list ($k, $v) = each ($list) ){
$l = split('/',$v['category']);
// init tree
$p = & $r;
for( $i=0; $i<sizeof($l); $i++ ){
$idx = find_idx($p,$l[$i]);
$lastest = ( $i == sizeof($l)-1 );
if( $idx == -1 ) {
if( $lastest ){
if( isset($p[0]) && isset($p[0]['orderby']) && $p[0]['orderby'] > $v['order_by']){
array_unshift($p, array( 'label'=>$l[$i] ) );
$idx = 0;
}


Now I may have been just staring at this code to long, Im going to go get something to eat and come back but thought I would post in the chance you see this.

pchopper 02-25-2004 12:27 PM

Lost my categories
 
I copied everything and checked to make sure that white space was not added. I lost my categories and after restoring the back up of the two files I still don't have my categories.

Please help.

xcart 3.5.4

Alan 04-08-2004 02:22 AM

Hi Guys,

After hunting around for a reason why I have zero
slideMenu.makeMenu(XXXXXXX) entries when I view source, I debugged a long time to find out that with recent version of Smarty Class, {php}{/php} tags are not allowed references to smarty variables.

meaning the $allcategories and $list is basically empty

Code:

$list = preparelist($allcategories);
sort_cat(&$list);

fill_menu($list,0);


To get around this, you will have to use a smarty prefilter function, which brings on a performance hit onto your pages. IMO if you can bear to use this mod that DealsonDeals kindly and FREELY provided, then don't worry about the performance hit.

in categories.tpl, after {php}, insert this line:

Code:

extract($this->get_template_vars());

I'm doing my own version of submenu display, but I'm going to reference to DealsOnDeals' code to do this, I hope you don't mind DealsOnDeals!

shirley2005 07-06-2005 05:58 PM

I'm looking for a way to better display categories and subcategories.

How to get a menu like in http://www.kegworks.com ?

kevin02 07-06-2005 10:06 PM

Looks like a lot of hand written code. Any one else??

pdheady 03-12-2007 08:48 PM

Re: Sliding Menu that displays categories and sub-categories
 
cant get it working with 4.0.19 too bad i wanted to test it out

august 03-13-2007 08:51 AM

Re: Sliding Menu that displays categories and sub-categories
 
Quote:

Originally Posted by shirley2005
I'm looking for a way to better display categories and subcategories.

How to get a menu like in http://www.kegworks.com ?



http://www.bcsengineering.com/store/catalog/Group_Categories_for_Better_Viewing__FREE_Xcart_Mo d-p-62.html

http://www.xcartmods.co.uk/#m2

shopccp 05-11-2007 09:26 PM

Re: Sliding Menu that displays categories and sub-categories
 
Will the code work for horizontal categories?

ladybird 04-06-2009 04:51 AM

Re: Sliding Menu that displays categories and sub-categories
 
Hi Ya'll

just wondering if any one has made the above code work on 4.5 or 4.9?

i would basically just like the sub categories to appear out to the right when a client either hovers over or clicks on a category.

Any suggestions? Gratefully received.

Learner 06-16-2010 09:41 AM

Re: Sliding Menu that displays categories and sub-categories
 
will this work on 4.1.9 & 4.1.11 ??


All times are GMT -8. The time now is 04:40 AM.

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