ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Using ProductCart
  New Posts New Posts RSS Feed - Search Results V3.12
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Search Results V3.12

 Post Reply Post Reply Page  12>
Author
Message
cmason View Drop Down
Senior Member
Senior Member


Joined: 18-June-2008
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote cmason Quote  Post ReplyReply Direct Link To This Post Topic: Search Results V3.12
    Posted: 30-June-2008 at 5:57pm
It's very nice that scrolling category summary appears near the top of the page but is there anyway for it to take up less space? It would be nice to not have the top of that section show so much white space when there's not a lot of categories, for us it's rare it would be more than 3.

I suspect there's some of change that could be made within inc_srcPrdsCAT.asp?

Also, is there anyway to not display the scroll arrows if all the categories are listed on the page so that scrolling isn't necessary?
Back to Top
cmason View Drop Down
Senior Member
Senior Member


Joined: 18-June-2008
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote cmason Quote  Post ReplyReply Direct Link To This Post Posted: 30-June-2008 at 6:40pm
Never mind I think I answered my own question, saw the note about dynamicdrive.com and found this info for the script "You can change the dimensions of the scroller by changing all occurrences of the values "155" and "160" to something else" Changing that didn't work but under "if (iens6)", which works for FF too, there is "height:100px". Reducing that number seems to work.
Back to Top
worldofrugs View Drop Down
Senior Member
Senior Member
Avatar

Joined: 24-April-2008
Location: United States
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote worldofrugs Quote  Post ReplyReply Direct Link To This Post Posted: 25-July-2008 at 10:59am
Cmason,
Thanks for your post as it did help me out partly...
At least the huge box is a little smaller now.
Have you ever figure out how to hide those arrows when they're not needed?
In IE they disappear once I click on it (while they were not needed), but showing on initial view.
In FF they remain there...

If you do not have the answer, perhaps some one else played around with this?


Edited by worldofrugs - 25-July-2008 at 11:13am
Back to Top
cmason View Drop Down
Senior Member
Senior Member


Joined: 18-June-2008
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote cmason Quote  Post ReplyReply Direct Link To This Post Posted: 25-July-2008 at 11:32am
I ended up just removing the entire JS from inc_srcPrdsCAT.asp. I found it a kludge to use and figured other users would have the same reaction.

This is what that file looks like after I added a query to display the parent category, I also made a full posting about adding a parent somewhere else in the forum.

<%src_ForCats="1"%>
<!--#include file="inc_srcPrdQuery.asp"-->
<%
Set rsCAT=Server.CreateObject("ADODB.Recordset")
Set rsCAT=connTemp.execute(query)

if not rsCAT.eof then
form_idcategory=getUserInput(request("idcategory"),0)
form_customfield=getUserInput(request("customfield"),0)
form_SearchValues=getUserInput(request("SearchValues"),0)
form_priceFrom=getUserInput(request("priceFrom"),0)
form_priceUntil=getUserInput(request("priceUntil"),0)
form_withstock=getUserInput(request("withstock"),0)
form_sku=getUserInput(request("sku"),0)
form_IDBrand=getUserInput(request("IDBrand"),0)
form_keyWord=getUserInput(request("keyWord"),0)
form_exact=getUserInput(request("exact"),0)
form_resultCnt=getUserInput(request("resultCnt"),0)
form_order=getUserInput(request("order"),0)
form_pageStyle=getUserInput(request("pageStyle"),0)%>

<form name="ajaxSearch">
     <input type="hidden" name="idcategory" value="<%=form_idcategory%>">
     <input type="hidden" name="customfield" value="<%=form_customfield%>">
     <input type="hidden" name="SearchValues" value="<%=form_SearchValues%>">
     <input type="hidden" name="priceFrom" value="<%=form_priceFrom%>">
     <input type="hidden" name="priceUntil" value="<%=form_priceUntil%>">
     <input type="hidden" name="withstock" value="<%=form_withstock%>">
     <input type="hidden" name="sku" value="<%=form_sku%>">
     <input type="hidden" name="IDBrand" value="<%=form_IDBrand%>">
     <input type="hidden" name="keyWord" value="<%=form_keyWord%>">
     <input type="hidden" name="exact" value="<%=form_exact%>">
     <input type="hidden" name="resultCnt" value="<%=form_resultCnt%>">
     <input type="hidden" name="order" value="<%=form_order%>">
     <input type="hidden" name="iPageCurrent" value="1">
     <input type="hidden" name="pageStyle" value="<%=form_pageStyle%>">
</form>
<table>
     <tr>
          <td align="left" class="pcCatSearchResults">
          <!--CW - removed scrolling js due to height and usability issues added query to show parent of duplicate categories-->
               <ul>
               <%Do while not rsCAT.eof
               tmp_CatCount=rsCAT("ProductCount")
               tmp_CatID=rsCAT("idcategory")
               tmp_CatName=rsCAT("categoryDesc")
               
               cw_ParentID = rsCat("idParentCategory")          
               
               cwSQL="SELECT categoryDesc FROM categories WHERE idCategory = " & cw_ParentID
                         set rsParent=conntemp.execute(cwSQL)
               cw_ParentDesc = rsParent("categoryDesc")
               
               
               if tmp_CatCount > 1 then
                    tmp_CatCountMessage = dictLanguage.Item(Session("language")&"_ShowSearch_6")
                    else
                    tmp_CatCountMessage = dictLanguage.Item(Session("language")&"_ShowSearch_7")
               end if
               'CW added display of parent category
               if tmp_CatCount>0 then%>
                    <li><a href="javascript:document.ajaxSearch.idcategory.value='<%=tmp_CatID%>';document.ajaxSearch.submit();" <%if scStoreUseToolTip="1" then%>onmouseover="javascript:document.ajaxSearch.idcategory.value='<%=tmp_CatID%>'; sav_callxml='1'; runXML('cat_<%=tmp_CatID%>');" onmouseout="javascript: sav_callxml=''; hidetip();"<%end if%>><%=cw_ParentDesc%> > <span class="allCaps><%=tmp_CatName%></span></a> (<%=tmp_CatCount & tmp_CatCountMessage%>)</li>
               <%
               end if
               rsCat.MoveNext
               loop
               %>
               </ul>
          </td>
     </tr>
</table>
<%
end if
'CW added
set rsParent=nothing
set rsCAT=nothing%>

Back to Top
worldofrugs View Drop Down
Senior Member
Senior Member
Avatar

Joined: 24-April-2008
Location: United States
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote worldofrugs Quote  Post ReplyReply Direct Link To This Post Posted: 25-July-2008 at 11:50am
Thanks cmason,
Actually I did something similar... I took the complete category section out, as I found it very messy looking and do not see (yet) any benefit on having it...
What's your website? I like to see how yours turned out....


Back to Top
cmason View Drop Down
Senior Member
Senior Member


Joined: 18-June-2008
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote cmason Quote  Post ReplyReply Direct Link To This Post Posted: 25-July-2008 at 11:59am
I really like displaying the categories, I'd even added a custom page to do that when we used V2.76. http://www.constructionlifters.com It's still a work in progress but I'm off on vacation and we decided to go live with what we had.

The code that I posted about adding a parent category appears to be here http://www.earlyimpact.com/forum/forum_posts.asp?TID=1690&KW=parent+category&PID=6060#6060
Back to Top
worldofrugs View Drop Down
Senior Member
Senior Member
Avatar

Joined: 24-April-2008
Location: United States
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote worldofrugs Quote  Post ReplyReply Direct Link To This Post Posted: 25-July-2008 at 1:06pm
ok you conviced me cmason, going to implement this...Clap

At first I had an error, but forgot to edit inc_srcPrdQuery.asp so I got an error...
Going to modify it now and let you know if your code also worked for me!
Thanks for the help / info so far cmason!
Back to Top
worldofrugs View Drop Down
Senior Member
Senior Member
Avatar

Joined: 24-April-2008
Location: United States
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote worldofrugs Quote  Post ReplyReply Direct Link To This Post Posted: 25-July-2008 at 1:29pm
cmasin, if you have some time....
According to your documentation, I have to set the order in inc_srcPrdQuery.asp...
You mention to change a line  to
query=query& "ORDER BY categories.idParentCategory,categories.categoryDesc; "

The thing is, in PC 3.11 it shows query=query & ") ORDER BY " & strORD1

Looking at strOrd i see:
if strORD<>"" then
    Select Case StrORD
        Case "1": strORD1="A.idproduct ASC"
        Case "2": strORD1="A.sku ASC"
        Case "3": strORD1="A.sku DESC"
        Case "4": strORD1="A.description ASC"
        Case "5": strORD1="A.description DESC"
    End Select
Else
    strORD="1"
    strORD1="A.idproduct ASC"
End If

How do I implement the categories.idParentCategory into this?
Any ideas?



Back to Top
cmason View Drop Down
Senior Member
Senior Member


Joined: 18-June-2008
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote cmason Quote  Post ReplyReply Direct Link To This Post Posted: 25-July-2008 at 2:15pm
In inc_srcPrdQuery.asp I left that Order By alone.

If you look further down the page there's a Group By and Order By, which is where I made my changes

     pIdCategory=getUserInput(request("idCategory"),4)
     if NOT validNum(pIdCategory) then
          pIdCategory=0
     end if
     query=query& "GROUP BY categories.idcategory, categories.categoryDesc,categories.idParentCategory "
     query=query& "ORDER BY categories.idParentCategory,categories.categoryDesc; "
End If



Back to Top
worldofrugs View Drop Down
Senior Member
Senior Member
Avatar

Joined: 24-April-2008
Location: United States
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote worldofrugs Quote  Post ReplyReply Direct Link To This Post Posted: 25-July-2008 at 2:25pm
cmason,
Again thank you for your help so far...
However, I simply do not see it in my code....
I see a Group by section, but looking totally different... (I'm so confused!  hahaha Confused )

This is my original inc_srcPRDQuery -->

<%
Session.LCID=1033

iPageSize=getUserInput(request("resultCnt"),10)
if iPageSize="" then
    iPageSize=getUserInput(request("iPageSize"),0)
end if
if (iPageSize="") then
    iPageSize=6
end if
if (not IsNumeric(iPageSize)) then
    iPageSize=6
end if
if request("iPageCurrent")="" then
    iPageCurrent=1
else
    iPageCurrent=server.HTMLEncode(request("iPageCurrent"))
end if

pSKU=getUserInput(request("SKU"),150)
pKeywords=getUserInput(request("keyWord"),100)
pCValues=getUserInput(request("SearchValues"),100)
tKeywords=pKeywords
tIncludeSKU=getUserInput(request("includeSKU"),10)
pPriceFrom=getUserInput(request("priceFrom"),20)
if NOT isNumeric(pPriceFrom) then
    pPriceFrom=0
end if
if Instr(pPriceFrom,",")>Instr(pPriceFrom,".") then
    pPriceFrom=replace(pPriceFrom,",",".")
end if
pPriceUntil=getUserInput(request("priceUntil"),20)
if NOT isNumeric(pPriceUntil) then
    pPriceUntil=9999999
end if
if Instr(pPriceUntil,",")>Instr(pPriceUntil,".") then
    pPriceUntil=replace(pPriceUntil,",",".")
end if
if src_ForCats="1" then
    pIdCategory=0
    else
    pIdCategory=getUserInput(request("idCategory"),4)
    if NOT validNum(pIdCategory) or trim(pIdCategory)="" then
        pIdCategory=0
    end if
end if
pIdSupplier=getUserInput(request("idSupplier"),4)
if NOT validNum(pIdSupplier) or trim(pIdSupplier)="" then
    pIdSupplier=0
end if
pWithStock=getUserInput(request("withStock"),2)
pcustomfield=getUserInput(request("customfield"),150)
    if pcustomfield = "" then
        pcustomfield = 0
        pCValues=""
    end if
   
    if Not IsNumeric(pcustomfield) then
        pcustomfield = 0
        pCValues=""
    end if
   
if pcustomfield=0 then
    pCValues=""
end if
   
IDBrand=getUserInput(request("IDBrand"),20)
if NOT validNum(IDBrand) or trim(IDBrand)="" then
    IDBrand=0
end if
strORD=getUserInput(request("order"),4)
if NOT validNum(strORD) or trim(strORD)="" then
    strORD=3
end if

pInactive="0"

if strORD<>"" then
    Select Case StrORD
        Case "1": strORD1="A.idproduct ASC"
        Case "2": strORD1="A.sku ASC"
        Case "3": strORD1="A.sku DESC"
        Case "4": strORD1="A.description ASC"
        Case "5": strORD1="A.description DESC"
    End Select
Else
    strORD="1"
    strORD1="A.idproduct ASC"
End If
   
PrdTypeStr=""

PrdTypeStr=""

'src_IncNormal=getUserInput(request("src_IncNormal"),0)
src_IncNormal=1
'src_IncBTO=getUserInput(request("src_IncBTO"),0)
src_IncBTO=1
src_IncItem=getUserInput(request("src_IncItem"),0)
src_Special=getUserInput(request("src_Special"),0)
src_Featured=getUserInput(request("src_Featured"),0)

if src_IncNormal="" then
    src_IncNormal="0"
end if

if src_IncBTO="" then
    src_IncBTO="0"
end if

if src_IncItem="" then
    src_IncItem="0"
end if

if src_Special="" then
    src_Special="0"
end if

if src_Featured="" then
    src_Featured="0"
end if

if (src_IncBTO="0") and (src_IncItem="0") then
    src_IncNormal="1"
end if

if (src_IncBTO="1") and (src_IncItem="0") and (src_IncNormal="0") then
    PrdTypeStr=" AND serviceSpec<>0 "
end if

if (src_IncBTO="0") and (src_IncItem="1") and (src_IncNormal="0") then
    PrdTypeStr=" AND configOnly<>0 "
end if

if (src_IncBTO="1") and (src_IncItem="1") and (src_IncNormal="0") then
    PrdTypeStr=" AND ((serviceSpec<>0) OR (configOnly<>0)) "
end if

if (src_IncBTO="0") and (src_IncItem="1") and (src_IncNormal="1") then
    PrdTypeStr=" AND serviceSpec=0 "
end if

if (src_IncBTO="1") and (src_IncItem="0") and (src_IncNormal="1") then
    PrdTypeStr=" AND configOnly=0 "
end if

if (src_IncBTO="0") and (src_IncItem="0") and (src_IncNormal="1") then
    PrdTypeStr=" AND ((serviceSpec=0) AND (configOnly=0)) "
end if

   
' create sql statement
strSQL=""
tmpSQL=""
tmpSQL2=""

tmpSQL1=",categories_products,categories "

tmp_StrQuery=""
if session("customerCategory")="" or session("customerCategory")=0 then
    If session("customerType")=1 then
        tmp_StrQuery="(A.serviceSpec<>0 AND A.pcProd_BTODefaultWPrice>="&pPriceFrom&" And A.pcProd_BTODefaultWPrice<=" &pPriceUntil&")"
    else
        tmp_StrQuery="(A.serviceSpec<>0 AND A.pcProd_BTODefaultPrice>="&pPriceFrom&" And A.pcProd_BTODefaultPrice<=" &pPriceUntil&")"
    end if
else
    tmp_StrQuery="(A.serviceSpec<>0 AND A.idproduct IN (SELECT idproduct FROM pcBTODefaultPriceCats WHERE pcBTODefaultPriceCats.idCustomerCategory=" & session("customerCategory") & " AND pcBTODefaultPriceCats.pcBDPC_Price>="&pPriceFrom&" AND pcBTODefaultPriceCats.pcBDPC_Price<=" &pPriceUntil&"))"
end if

pcv_strMaxResults=SRCH_MAX
If pcv_strMaxResults>"0" Then
    pcv_strLimitPhrase="TOP " & pcv_strMaxResults
Else
    pcv_strLimitPhrase=""
End If


'APP-S
tmpCatquery=""
tmpCatquery1=""
'APP-E

if src_ForCats="1" then   
   
    '// Category Search
    strSQL= "SELECT "& pcv_strLimitPhrase &" COUNT(categories.idcategory) AS ProductCount, categories.idcategory, categories.categoryDesc "
    strSQL=strSQL& "FROM "
    strSQL=strSQL& "(categories_products INNER JOIN categories ON categories_products.idcategory=categories.idcategory) "
    strSQL=strSQL& "LEFT OUTER JOIN products as A "
    strSQL=strSQL& "ON A.idProduct=categories_products.idProduct "
   
    session("srcprd_from")=""
    session("srcprd_where")=""
    if session("customerType")<>"1" then
        session("srcprd_where")=" AND categories.pccats_RetailHide=0 "
    end if       
   
    'APP-S
    session("srcprd_where")=session("srcprd_where") & " AND categories_products.idproduct=A.idproduct AND categories.idcategory=categories_products.idcategory  AND categories.iBTOhide=0) ORDER BY categories.categoryDesc"
    tmpCatquery1=" AND categories_products.idproduct=A.idproduct AND categories.idcategory=categories_products.idcategory  AND categories.iBTOhide=0"
    'APP-E   
   
    'APP-S
    strSQL=strSQL & "WHERE "
    strSQL=strSQL & "( " '// App Only
    strSQL=strSQL & "((" & tmp_StrQuery & " OR (A.serviceSpec=0 AND A.price>="&pPriceFrom&" And A.price<=" &pPriceUntil&")) AND A.removed=0"
    'APP-E
   
else

    '// Product Search
    'APP-S   
    strSQL= "SELECT "& pcv_strLimitPhrase &" A.idProduct, A.description, A.active, A.sku, A.serviceSpec, A.configonly "
    strSQL=strSQL& "FROM products A "
    strSQL=strSQL& " WHERE idProduct IN ( SELECT "& pcv_strLimitPhrase &" idProduct FROM categories_products, categories WHERE idProduct = A.idProduct"
    strSQL=strSQL& " AND (A.price>="&pPriceFrom&" And A.price<=" &pPriceUntil&" AND A.removed=0"
    'APP-E
   
end if



if len(pSKU)>0 then
    strSQL=strSQL & " AND A.sku like '%"&pSKU&"%'"
end if

if pIdCategory<>"0" then
    strSQL=strSQL & " AND A.idProduct=categories_products.idProduct AND categories_products.idCategory=" &pIdCategory
    'APP-S
    tmpCatquery=tmpCatquery & " AND A.idProduct=categories_products.idProduct AND categories_products.idCategory=" &pIdCategory
    'APP-E
else
    strSQL=strSQL & " AND categories_products.idProduct=A.idProduct"
    'APP-S
    tmpCatquery=tmpCatquery & " AND categories_products.idProduct=A.idProduct"
    'APP-E
end if

strSQL=strSQL & " AND categories.idCategory=categories_products.idCategory AND categories.iBTOhide=0"
'APP-S
tmpCatquery=tmpCatquery & " AND categories.idCategory=categories_products.idCategory AND categories.iBTOhide=0"
'APP-E
if session("CustomerType")<>"1" then
    strSQL=strSQL & " AND categories.pccats_RetailHide=0"
    'APP-S
    tmpCatquery=tmpCatquery & " AND categories.pccats_RetailHide=0"
    'APP-E
end if

if (pIdSupplier<>"0") and (pIdSupplier<>"10") then
    strSQL=strSQL & " AND A.idSupplier=" &pIdSupplier
end if

if pWithStock="-1" then
    strSQL=strSQL & " AND (stock>0 OR noStock<>0)"
end if

if (IDBrand&""<>"") and (IDBrand&""<>"0") then
    strSQL=strSQL & " AND IDBrand=" & IDBrand
end if

if pInactive="-1" then
else
   strSQL=strSQL & " AND A.active=-1"
end if

if src_Special="1" then
   strSQL=strSQL & " AND A.hotdeal<>0"
end if

if src_Special="2" then
   strSQL=strSQL & " AND A.hotdeal=0"
end if

if src_Featured="1" then
   strSQL=strSQL & " AND A.showInHome<>0"
end if

if src_Featured="2" then
   strSQL=strSQL & " AND A.showInHome=0"
end if

TestWord=""
if request("exact")<>"1" then
    if Instr(pKeywords," AND ")>0 then
        keywordArray=split(pKeywords," AND ")
        TestWord=" AND "
    else
        if Instr(pKeywords," and ")>0 then
            keywordArray=split(pKeywords," and ")
            TestWord=" AND "
        else
            if Instr(pKeywords,",")>0 then
                keywordArray=split(pKeywords,",")
                TestWord=" OR "
            else
                if (Instr(pKeywords," OR ")>0) then
                    keywordArray=split(pKeywords," OR ")
                    TestWord=" OR "
                else
                    if (Instr(pKeywords," or ")>0) then
                        keywordArray=split(pKeywords," or ")
                        TestWord=" OR "
                    else
                        if (Instr(pKeywords," ")>0) then
                            keywordArray=split(pKeywords," ")
                            TestWord=" AND "
                        else
                            keywordArray=split(pKeywords,"***")   
                            TestWord=" OR "
                        end if
                    end if
                end if
            end if
        end if
    end if
else
    pKeywords=trim(pKeywords)
    if pKeywords<>"" then
        if scDB="SQL" then
            pKeywords="'" & pKeywords & "'***'%[^a-zA-z0-9]" & pKeywords & "[^a-zA-z0-9]%'***'" & pKeywords & "[^a-zA-z0-9]%'***'%[^a-zA-z0-9]" & pKeywords & "'"
        else
            pKeywords="'" & pKeywords & "'***'%[!a-zA-z0-9]" & pKeywords & "[!a-zA-z0-9]%'***'" & pKeywords & "[!a-zA-z0-9]%'***'%[!a-zA-z0-9]" & pKeywords & "'"
        end if
    end if
    keywordArray=split(pKeywords,"***")   
    TestWord=" OR "
end if

if pcustomfield<>"0" AND pCValues<>"" then
        strCnt=0
        strSQL=strSQL & " AND (("
        strSQL=strSQL & "(custom1="&pcustomfield&" AND content1 LIKE '%"&trim(pCValues)&"%') OR (custom2="&pcustomfield&" AND content2 LIKE '%"&trim(pCValues)&"%') OR (custom3="&pcustomfield&" AND content3 LIKE '%"&trim(pCValues)&"%')"
        strSQL=strSQL & ")"
        if pKeywords="" then
        strSQL=strSQL & ")"
        end if
end if

IF request("exact")<>"1" THEN

if pcustomfield<>"0" AND pKeywords<>"" then
    if pCValues="" then
        strCnt=0
        strSQL=strSQL & " AND (("
        for L=0 to UBound(keywordArray)
            strCnt=strCnt+1
            strSQL=strSQL & "((custom1="&pcustomfield&" AND content1 LIKE '%"&trim(keywordArray(L))&"%') OR (custom2="&pcustomfield&" AND content2 LIKE '%"&trim(keywordArray(L))&"%') OR (custom3="&pcustomfield&" AND content3 LIKE '%"&trim(keywordArray(L))&"%'))"
            if strCnt<>(UBound(keywordArray)+1) then
                strSQL=strSQL&TestWord
            end if
        next
        strSQL=strSQL & ")"
    end if
else
    if pKeywords<>"" AND pCValues="" then
        strCnt=0
        strSQL=strSQL & " AND (("
        for L=0 to UBound(keywordArray)
            strCnt=strCnt+1
            strSQL=strSQL & "((content1 LIKE '%"&trim(keywordArray(L))&"%') OR (content2 LIKE '%"&trim(keywordArray(L))&"%') OR (content3 LIKE '%"&trim(keywordArray(L))&"%'))"
            if strCnt<>(UBound(keywordArray)+1) then
                strSQL=strSQL&TestWord
            end if
        next
    strSQL=strSQL&")"   
    end if
    if pcustomfield<>"0" AND pKeywords="" AND pCValues="" then
        strCnt=0
        strSQL=strSQL & " AND ("
        strSQL=strSQL & "(custom1="&pcustomfield&") OR (custom2="&pcustomfield&") OR (custom3="&pcustomfield&")"
        strSQL=strSQL & ")"
    end if
end if

if pKeywords<>"" then
    if pcustomfield<>"0" AND pCValues<>"" then
        strSQl=strSql & " AND ("
    else
        strSQl=strSql & " OR ("
    end if
   
    tmpSQL="(A.details LIKE "
    tmpSQL2="(A.description LIKE "
    tmpSQL3="(A.sDesc LIKE "
    if tIncludeSKU="true" then
        tmpSQL4="(SKU LIKE "
    end if
    Pos=0
    For L=LBound(keywordArray) to UBound(keywordArray)
        if trim(keywordArray(L))<>"" then
        Pos=Pos+1
        if Pos>1 Then
            tmpSQL=tmpSQL  & TestWord & " A.details LIKE "
            tmpSQL2=tmpSQL2 & TestWord & " A.description LIKE "
            tmpSQL3=tmpSQL3 & TestWord & " A.sDesc LIKE "
            if tIncludeSKU="true" then
                tmpSQL4=tmpSQL4 & TestWord & " SKU LIKE "
            end if
        end if
            tmpSQL=tmpSQL  & "'%" & trim(keywordArray(L)) & "%'"
            tmpSQL2=tmpSQL2 & "'%" & trim(keywordArray(L)) & "%'"
            tmpSQL3=tmpSQL3 & "'%" & trim(keywordArray(L)) & "%'"
            if tIncludeSKU="true" then
                tmpSQL4=tmpSQL4 & "'%" & trim(keywordArray(L)) & "%'"
            end if
        end if
    Next
    tmpSQL=tmpSQL & ")"
    tmpSQL2=tmpSQL2 & ")"
    tmpSQL3=tmpSQL3 & ")"
    if tIncludeSKU="true" then
        tmpSQL4=tmpSQL4 & ")"
    end if
   
    strSQL=strSQL & tmpSQL
    strSQL=strSQL & " OR " & tmpSQL2
    if tIncludeSKU="true" then
        strSQL=strSQL & " OR " & tmpSQL3
        strSQL=strSQL & " OR " & tmpSQL4 & "))"
    else   
        strSQL=strSQL & " OR " & tmpSQL3 & "))"
    end if
    query=strSQL & PrdTypeStr & session("srcprd_where")   
    if src_ForCats<>"1" then
        query=query & ") "
        'APP-S
        query=query & ") ORDER BY " & strORD1
        'APP-E
    end if
else
    query=strSQL & PrdTypeStr & session("srcprd_where")
    if src_ForCats<>"1" then
        query=query & ") "
        'APP-S
        query=query & ") ORDER BY " & strORD1
        'APP-E
    end if
end if

ELSE 'Exact=1

if pcustomfield<>"0" AND pKeywords<>"" then
    if pCValues="" then
        strCnt=0
        strSQL=strSQL & " AND (("
        for L=0 to UBound(keywordArray)
            strCnt=strCnt+1
            strSQL=strSQL & "((custom1="&pcustomfield&" AND content1 LIKE "&trim(keywordArray(L))&") OR (custom2="&pcustomfield&" AND content2 LIKE "&trim(keywordArray(L))&") OR (custom3="&pcustomfield&" AND content3 LIKE "&trim(keywordArray(L))&"))"
            if strCnt<>(UBound(keywordArray)+1) then
                strSQL=strSQL&TestWord
            end if
        next
        strSQL=strSQL & ")"
    end if
else
    if pKeywords<>"" AND pCValues="" then
        strCnt=0
        strSQL=strSQL & " AND (("
        for L=0 to UBound(keywordArray)
            strCnt=strCnt+1
            strSQL=strSQL & "((content1 LIKE "&trim(keywordArray(L))&") OR (content2 LIKE "&trim(keywordArray(L))&") OR (content3 LIKE "&trim(keywordArray(L))&"))"
            if strCnt<>(UBound(keywordArray)+1) then
                strSQL=strSQL&TestWord
            end if
        next
    strSQL=strSQL&")"   
    end if
    if pcustomfield<>"0" AND pKeywords="" AND pCValues="" then
        strCnt=0
        strSQL=strSQL & " AND ("
        strSQL=strSQL & "(custom1="&pcustomfield&") OR (custom2="&pcustomfield&") OR (custom3="&pcustomfield&")"
        strSQL=strSQL & ")"
    end if
end if

if pKeywords<>"" then
    if pcustomfield<>"0" AND pCValues<>"" then
        strSQl=strSql & " AND ("
    else
        strSQl=strSql & " OR ("
    end if
   
    tmpSQL="(A.details LIKE "
    tmpSQL2="(A.description LIKE "
    tmpSQL3="(A.sDesc LIKE "
    if tIncludeSKU="true" then
        tmpSQL4="(SKU LIKE "
    end if
    Pos=0
    For L=LBound(keywordArray) to UBound(keywordArray)
        if trim(keywordArray(L))<>"" then
        Pos=Pos+1
        if Pos>1 Then
            tmpSQL=tmpSQL  & TestWord & " A.details LIKE "
            tmpSQL2=tmpSQL2 & TestWord & " A.description LIKE "
            tmpSQL3=tmpSQL3 & TestWord & " A.sDesc LIKE "
            if tIncludeSKU="true" then
                tmpSQL4=tmpSQL4 & TestWord & " SKU LIKE "
            end if
        end if
            tmpSQL=tmpSQL & trim(keywordArray(L))
            tmpSQL2=tmpSQL2 & trim(keywordArray(L))
            tmpSQL3=tmpSQL3 & trim(keywordArray(L))
            if tIncludeSKU="true" then
                tmpSQL4=tmpSQL4 & trim(keywordArray(L))
            end if
        end if
    Next
    tmpSQL=tmpSQL & ")"
    tmpSQL2=tmpSQL2 & ")"
    tmpSQL3=tmpSQL3 & ")"
    if tIncludeSKU="true" then
        tmpSQL4=tmpSQL4 & ")"
    end if
   
    strSQL=strSQL & tmpSQL
    strSQL=strSQL & " OR " & tmpSQL2
    if tIncludeSKU="true" then
        strSQL=strSQL & " OR " & tmpSQL3
        strSQL=strSQL & " OR " & tmpSQL4 & "))"
    else   
        strSQL=strSQL & " OR " & tmpSQL3 & "))"
    end if
    query=strSQL & PrdTypeStr & session("srcprd_where")
    if src_ForCats<>"1" then
        query=query & ") "
        'APP-S
        query=query & ") ORDER BY " & strORD1
        'APP-E
    end if
else
    query=strSQL & PrdTypeStr & session("srcprd_where")
    if src_ForCats<>"1" then
        query=query & ") "
        'APP-S
        query=query & ") ORDER BY " & strORD1
        'APP-E
    end if
end if

END IF 'Exact

if src_ForCats="1" then
    session("srcprd_from")=""
    session("srcprd_where")=""
    pIdCategory=getUserInput(request("idCategory"),4)
    if NOT validNum(pIdCategory) then
        pIdCategory=0
    end if
end if

'APP-S
If src_ForCats="1" then

    tmpSQL1="A.idProduct=categories_products.idProduct WHERE ("
    tmp1=split(query,tmpSQL1)
    tmp2=split(tmp1(1),") ORDER BY")
    tmp3=replace(tmp2(0)," AND A.active=-1"," AND A.active=0 AND A.pcProd_SPInActive=0 AND A.pcProd_ParentPrd>0")
    tmp3a=split(tmp3," OR (A.serviceSpec=0")
    tmp3="((A.serviceSpec=0" & tmp3a(1)
    tmp3=replace(tmp3,tmpCatquery,"")
    tmp3=replace(tmp3,"A.","B.")
    tmp3b=split(tmp3,"AND categories.pccats_RetailHide=0")
    tmp3=tmp3b(0)   
    tmp4 = "SELECT B.pcProd_ParentPrd FROM products B WHERE pcProd_ParentPrd = A.idProduct AND " & tmp3
    tmp5=" ) OR ( A.idProduct IN ( "& tmp4 &" )"
    tmp5=tmp5 & ") "
    tmp5=tmp5 & "GROUP BY categories.idcategory, categories.categoryDesc "
    query=replace(query, " ORDER", tmp5 & " ORDER")
   
Else
   
    tmpSQL1="idProduct = A.idProduct AND"   
    tmp1=split(query,tmpSQL1)
    tmp2=split(tmp1(1),") ORDER BY")
    tmp3=replace(tmp2(0)," AND A.active=-1"," AND A.active=0 AND A.pcProd_SPInActive=0 AND A.pcProd_ParentPrd>0")
    tmp3=replace(tmp3,tmpCatquery,"")
    tmp4 = "SELECT B.pcProd_ParentPrd FROM products B WHERE pcProd_ParentPrd = A.idProduct AND " & replace(tmp3,"A.","B.")
    tmp5=" OR idProduct IN ( "& tmp4 &" )"
    query=replace(query, " ORDER", tmp5 & " ORDER")
   
End if
'APP-E

%>
Back to Top
 Post Reply Post Reply Page  12>
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.