left menu subcategories shown on products details page

ondrasus

Avatar: ondrasus

2007-04-29 06:42

Hi,

I have some categories and sub categories in the left menu. If you click on category, then you will see also the subcategories, but if you click on product and see product page the subcategories in the left menu disappear. Do you have any idea what to do with it?

Thanks a lot!


QC Loaded 1.4

» Quick.Cart v1.x

merci

No avatar

2007-04-30 10:48

ondrasus - you have to edit index.php
1) find this:

if( !isset( $sCategoriesMenu ) )
    
$sCategoriesMenu listCategories'categories_menu.tpl'1true, Array( $iCategory ) );


and replace it with:

if( isset( $aData['aCategories'] ) && $p == 'productsMore' )
      
$aSelectedCategories $aData['aCategories'];
    else
      
$aSelectedCategories = Array( $iCategory );
    
$sCategoriesMenu listCategories'categories_menu.tpl'1true$aSelectedCategories );


Works good??

ondrasus

Avatar: ondrasus

2007-05-03 23:56

yes, it works

thank you

ottoa

No avatar

2007-06-18 10:54

How do I make this work on QC2.2?

merci

No avatar

2007-06-18 15:09

ottoa - edit file index.php find this code:

if( !isset( $sMenu1 ) ){
    
$sMenu1 listCategories'menu_1.tpl'1true, Array( $iCategory ) );
    if( !isset( 
$sMenu1 ) )
      
$sMenu1 $tpl->tbHtml'menu_1.tpl''NOT_FOUND' );
  }

and replace it with:

if( !isset( $sMenu1 ) ){
    if(
$p == 'productsMore'){
      
$sMenu1 listCategories'menu_1.tpl'1true$aData['aCategories'] );
    }
    else
      
$sMenu1 listCategories'menu_1.tpl'1true, Array( $iCategory ) );
    if( !isset( 
$sMenu1 ) )
      
$sMenu1 $tpl->tbHtml'menu_1.tpl''NOT_FOUND' );
  }

ottoa

No avatar

2007-06-19 10:46

Thank You

aquasyl

No avatar

2008-09-15 15:03

Hey, i do that for quick cart v2.x and i have default.

Is it really good fot the 2.x version wtih this :

if( !isset( $sMenu1 ) ){
    
$sMenu1 listCategories'menu_1.tpl'1true, Array( $iCategory ) );
    if( !isset( 
$sMenu1 ) )
      
$sMenu1 $tpl->tbHtml'menu_1.tpl''NOT_FOUND' );
  } 
and 
replace it with:
if( !isset( 
$sMenu1 ) ){
    if(
$p == 'productsMore'){
      
$sMenu1 listCategories'menu_1.tpl'1true$aData['aCategories'] );
    }
    else
      
$sMenu1 listCategories'menu_1.tpl'1true, Array( $iCategory ) );
    if( !isset( 
$sMenu1 ) )
      
$sMenu1 $tpl->tbHtml'menu_1.tpl''NOT_FOUND' );
  } 

q900761

Avatar: q900761

2008-09-20 13:18

And how do I make this work on QC3.0?

beholder

Avatar: beholder

2008-09-22 01:21

I tried.. I failed. Several times. I'd be interested in this solution myself.

q900761

Avatar: q900761

2008-09-23 21:14

up

treewood (OpenSolution)

Avatar: treewood

2008-09-25 10:33

In QC v3.x i have solution only to display product first category. In menu you will see only selected 1 category, not more.

Edit actions_client/products.php and find this:

aData['sPages'] = $oProduct->throwProductsPagesTree$iProduct );

after add this code:

if( isset( $oProduct->aProductsPages[$iProduct] ) ){
  foreach( 
$oProduct->aProductsPages[$iProduct] as $iValue ){
    
$iContent $iValue;
    break;
  }
}

q900761

Avatar: q900761

2008-09-25 22:22

Thank yoy treewood it`s working!

Is it possible to change code little bit more - it would be perfect when menu stays open also after if I click on button "add to cart".

Makaron

Avatar: Makaron

2008-09-26 09:21

So in basket You want to have open left menu? In what place it should be open?

boboo

Avatar: boboo

2010-09-17 13:25

@treewood, beholder & to all whom it may concern...
how i solved this for QC3.X

There is one change in function attributes.
In the throwMenu function, you have to add the $iProduct parameter.
So the function looks now:
function throwMenu( $sFile, $iType, $iPageCurrent = null, $iDepthLimit = 1, $iProduct )
Don't forget to change the calls of the function in /themes/default+order.php
Then in the throwMenu function you have to add a bit of cookie.
Under the line:
$this->mData = null;
add this:
if( !isset( $iProduct ) )
setCookie('lastViewed', $iPageCurrent, 0 );
if( isset( $iProduct))
$iPageCurrent = $_COOKIE['lastViewed'];

I tried this first with exploding DB_PRODUCTS_PAGES but if there are more pages for 1 product (producers, categories,...), depends on the sequence(order) in DB, the menu stayed open on the pageCurrent, or jumped to producers menu, where the product was also saved.
So I thought, better save for short (0 time in cookie) the last viewed page (because from this last viewed page, you click on the product).
Now, by clicking on the product, the throwMenu gets internal the iPageCurrent parameter, so it can stay open.

http://skupienie.kimla.de/?kontakt,2

Back to top
about us | contact