Print Page | Close Window

Problem with Expand/Collapse Sub Category

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=1288
Printed Date: 22-April-2025 at 2:24pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Problem with Expand/Collapse Sub Category
Posted By: bedbugcentral
Subject: Problem with Expand/Collapse Sub Category
Date Posted: 04-January-2008 at 2:09pm

I just implemented the code to expand and collapse the sub categories in the left nav. It's working the way I believe it was intended, but I have a request.

When your category contains sub categories, and you click on the top level category, it just expands the subcategories, and does not bring you to the Main Categories page.

Is there a way around this?




Replies:
Posted By: inetbizo
Date Posted: 05-May-2008 at 3:58pm
Earlyimpact can you help? Also I think your code does not properly place the two images inside the table cell. The both seem to be aligned text top, cell top.

-------------
Current Project http://canvasusa.com - http://www.canvasusa.com


Posted By: inetbizo
Date Posted: 05-May-2008 at 4:01pm
I dabbled with this function, but it really messed up. \_01adminstore\genCatNavigation.asp
Function genCatInfor(tmp_IDCAT,tmp_CatName)
Dim tmp_showIcon,k,pcv_first,pcv_prdcount,pcv_back,pcv_end,tsT,tmp_query,pcv_CatName,pcv_prds1,tmp1,tmp2
 tmp1=0
 tmp2=0
 tmp_showIcon=0
 pcv_first=0
 pcv_prdcount=0
 maxProNameL = 22
 pcv_CatName=ClearHTMLTags2(tmp_CatName,0)
 If maxProNameL<len(pcv_CatName) then
  pcv_CatName=trim(left(pcv_CatName,maxProNameL)) & "..."
 End If
 if (pcv_exportType="0" or pcv_exportType="2") then
  pcv_end=intCount
  tmp1=0
  For k=0 to intCount
   pcv_back=pcv_end-k
   if cint(pcv_cats1(2,k))=tmp_IDCAT then
    tmp1=1
    exit for
   end if
   if pcv_cats1(2,pcv_back)=tmp_IDCAT then
    tmp1=1
    exit for
   end if
  Next
 end if
 
 if (pcv_exportType="1" or pcv_exportType="2") then
  tmp_query="SELECT products.idProduct,products.description FROM products INNER JOIN categories_products ON (products.idProduct=categories_products.idProduct AND products.removed=0 AND products.active=-1 AND products.configOnly=0) WHERE categories_products.idcategory=" & tmp_IDCAT & " ORDER BY categories_products.POrder asc,products.description ASC;"
  set rsT=connTemp.execute(tmp_query)
  if not rsT.eof then
   tmp2=1
   pcv_prds1=rsT.getRows()
   set rsT=nothing
  else
   tmp2=0
  end if
  set rsT=nothing
 end if
 if ((tmp1=1) and (pcv_exportType="0" or pcv_exportType="2")) or ((tmp2=1) and (pcv_exportType="1" or pcv_exportType="2")) then
  tmp_showIcon=1
 end if
 pcv_strTmpCat=pcv_strTmpCat & "<tr><td valign=""middle"">"
 if tmp_showIcon=1 then
  pcv_strTmpCat=pcv_strTmpCat & "<img align=""absmiddle"" name=""IMGCAT" & tmp_IDCAT & """ border=""0"" src=""images/btn_expand.gif"" onclick=""javascript:UpDown(" & tmp_IDCAT & ");"">"
 else
  pcv_strTmpCat=pcv_strTmpCat & "&nbsp;"
 end if
 pcv_strTmpCat=pcv_strTmpCat & "</td><td width=""100%"" valign=""top"" class="""&pcv_cssclass&"""><a href=""" & tempURL & "viewCategories.asp?idCategory=" & tmp_IDCAT  & """>&nbsp;" & pcv_CatName & "</a>" & vbcrlf
 if tmp_showIcon=1 then
  pcv_strTmpCat=pcv_strTmpCat & "<table border=""0"" width=""100%"" cellpadding=""0"" cellspacing=""0"" id=""SUB" & tmp_IDCAT & """ style=""display:none"">" & vbcrlf
  if ((tmp1=1) and (pcv_exportType="0" or pcv_exportType="2")) then
   For k=0 to intCount
    if cint(pcv_cats1(2,k))=tmp_IDCAT then
     pcv_first=1
     call genCatInfor(pcv_cats1(0,k),pcv_cats1(1,k))
    else
     if pcv_first=1 then
      exit for
     end if
    end if
   Next
  end if
  if ((tmp2=1) and (pcv_exportType="1" or pcv_exportType="2")) then
   if ubound(pcv_prds1,2)>pcv_numprd-1 then
    pcv_prdcount=pcv_numprd-1
   else
    pcv_prdcount=ubound(pcv_prds1,2)
   end if
   For k=0 to pcv_prdcount
    ProName=ClearHTMLTags2(pcv_prds1(1,k),0)
    If maxProNameL<len(ProName) then
     ProName=trim(left(ProName,maxProNameL)) & "..."
    End If
    pcv_strTmpCat=pcv_strTmpCat & "<tr><td>&nbsp</td><td class="""&pcv_cssclass&"""><a href=""" & tempURL & "viewPrd.asp?idcategory=" & tmp_IDCAT & "&idproduct=" & pcv_prds1(0,k) & """>" & ProName & "</a></td></tr>" & vbcrlf
   Next
   if ubound(pcv_prds1,2)>pcv_numprd-1 then
    pcv_strTmpCat=pcv_strTmpCat & "<tr><td>&nbsp</td><td class="""&pcv_cssclass&"""><a href=""" & tempURL & "viewCategories.asp?idCategory=" & tmp_IDCAT  & """>More Products...</a></td></tr>" & vbcrlf
   end if
  end if
  pcv_strTmpCat=pcv_strTmpCat & "</table>" & vbcrlf
 end if
 pcv_strTmpCat=pcv_strTmpCat & "</td></tr>" & vbcrlf
End Function


-------------
Current Project http://canvasusa.com - http://www.canvasusa.com


Posted By: inetbizo
Date Posted: 05-May-2008 at 4:02pm
I just don't see where I controll the btn_collapse.gif

-------------
Current Project http://canvasusa.com - http://www.canvasusa.com



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net