devshb
Senior Member
United Kingdom
1904 Posts |
Posted - May 29 2005 : 04:14:37
|
For that, I think you'd need to do something like this:
1) Create a copy of the cross-selling function/template-field (in shopfileio.asp) so that it returns the "go to" page rather than the list. 2) Change your product detail template to use that new function 3) Create a new product detail template (a copy of tmp_product.htm, call it tmp_productcross.htm) which uses the normal function, and which has less info on it (ie the "cross-selling info page")
For 1, in shopfileio.asp locate:
Case "ADD_CROSSSELLING" Handle_CROSSSELLING value,parsearray, parseRS rc=0
and add extra lines under that for:
Case "ADD_CROSSSELLING_GOTO_PAGE" Handle_CROSSSELLING_GOTO_PAGE value,parsearray, parseRS rc=0
Then in shopfileio.asp, add a new function (anywhere'll do) like this:
Sub Handle_CROSSSELLING_GOTO_PAGE(ivalue,parsearray,parseRS) dim lngcstock dim strCrossProductIDs,strsql, rs, strmessage, strcdescurl,strurl dim fieldtype,rc Dim tcount Dim thtml Dim turl FindInDatabase "CROSSSELLING", strcrossProductids, fieldtype, rc, parsearray If rc>0 then exit sub if strCrossProductids="" then exit sub strsql="select * from products where catalogid in (" & strcrossproductids & ")" strsql=strsql & " and hide=0" if getconfig("xstocklow")<>"" then lngcstock= clng(getconfig("xstocklow")) strsql = strsql & " and cstock> " & lngcstock end if set rs=dbc.execute(strsql) tcount=0 While Not rs.EOF tcount=tcount+1 RS.MoveNext Wend RS.Close set RS=Nothing if (tcount>0) then turl="shopexd.asp?id="&rs("catalogid")&"&template=tmp_productcross.htm" ' If using vpasp 5.5, use this line, otherwise don't : turl=addwebsess(turl) thtml="<a href="&chr(34)&turl&chr(34)&">View Cross Selling Products</a>" Response.Write "<br>"&thtml end if end sub
For 2, in tmp_product.htm, change [ADD_CROSSSELLING] to [ADD_CROSSSELLING_GOTO_PAGE]
Talking about cross-selling stuff makes me think I should make a shameless plug for something else that you might find relevant -
The "Customers who bought this, also bought these..." template-field:
http://bigyellowzone.com/shopexd.asp?id=97
Simon Barnaby Developer [email protected] www.BigYellowZone.com Web Design, Online Marketing and VPASP addons
Edited by - devshb on May 29 2005 04:16:50
Edited by - devshb on May 29 2005 04:21:13 |
|
|