Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Customization
 Getting Description In Cross Sellers
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Steve2507
VP-CART Expert

590 Posts

Posted - September 20 2010 :  17:34:45  Show Profile  Reply with Quote
Hi guys,

This has been having me go round in circles all weekend.

I'm trying to get a portion of the cdescription field added to the cross selling section of our expanded views. However it is proving hell and I think that it needs fresh eyes looking at it.

I'm not worried about getting the first so many words shown yet because at the moment I can't get any of it to show. So at the moment I'm just trying to get the whole description to show.

Here's the code:
Sub FormatAssociatedrow (rs,prodcount,linecount)
dim hideprice
hideprice = false
if getconfig("xdisplayprices") <> "Yes" then
	hideprice = true
end if
if getconfig("xpriceloggedinonly") = "Yes" then
	if Getsess ("login") = "" then
		hideprice = true
	end if
end if
dim catalogid, imagefile, cname, cprice, url, cdescription, extendeddesc
dim buttonimage, buttontext, buttonname
buttonimage=Getconfig("xbuttonmoreinfo")
buttontext=getlang("langProductExtendeddescription")
buttonname="View"
if isNull(buttonimage) Or buttonimage="" then
	buttonimage=""
end if
catalogid=rs("catalogid")
imagefile=rs("pother2") & "-" & rs("cimageurl")
URL=rs("cdescurl")
If isnull(url) then
    URL=getconfig("xCrossLinkURL")
end if
if ucase(URL)="SHOPEXD.ASP" then
       url="x/" & rs("catalogid") & "/" & rs("level4") & "/" & rs("pdlknm")& ".html"
else
       url="x/" & rs("catalogid") & "/" & rs("level4") & "/" & rs("pdlknm")& ".html"
end if
url = addwebsess(url)

cname=rs("cname")
cdescription = rs("cdescription")
dim assocdbc
shopopendatabase assocdbc
cname=translatelanguage(assocdbc, "products", "cname","catalogid", catalogid, cname)
cdescription = translatelanguage(assocdbc, "products", "cdescription","catalogid", catalogid, cdescription)
shopclosedatabase assocdbc
dim xprice
xprice=rs("cprice")

Response.write "<div class=""alsoBoughtItems"">"
Response.write "<div class=""alsoBoughtItemsImage"">"
Response.write "<a href=""" & url & """ title=""" & cname & """>"
Response.write "<img src=""http://tt.temptationsdirect.net/temptations/thumb/" & imagefile & """ border=""0"" alt=""" & cname & """ title=""" & cname & """ width=""100"" height=""150""></a></div>"
Response.write "<div class=""alsoBoughtItemsContent"">"
Response.write "<strong><a href=""" & url & """ title=""" & cname & """>" & cname & "</a></strong>"
Response.write "<br>Only £" & xprice
Response.write "<br> & cdescription 
Response.write "</div>"
Response.write "</div>"
end sub


In theory it is very simple, I call the cdescription contents and then show them at the end of the sub, but they don't appear.

Can anyone spot any stupid error I've made?

Thanks


Steve
Sex toys from a UK sex shop including vibrators and dildos.

carfin
VP-CART Expert

United Kingdom
948 Posts

Posted - September 21 2010 :  04:01:18  Show Profile  Reply with Quote
Hi Steve,

I think you're missing quotes from the following two lines:

Response.write "<br> & ""Only £"" & xprice"
Response.write "<br> & cdescription"

Hope it's that simple.

Regards,

Carrol
www.deanston-electrical.co.uk
Go to Top of Page

Steve2507
VP-CART Expert

590 Posts

Posted - September 21 2010 :  05:36:24  Show Profile  Reply with Quote
Hi Carrol,

Thanks, but unfortunately it wasn't that simple, but I have worked it out.

It's down to the old favourite - the MSSQL bug.

Moving the cdescription = rs("cdescription") to be above all other rs captures worked.

Here's more details: http://www.bigyellowzone.com/support/issue_view.asp?ID=327

The most annoying thing is I spent hours on this with sucha simple solution.



Steve
Sex toys from a UK sex shop including vibrators and dildos.
Go to Top of Page

carfin
VP-CART Expert

United Kingdom
948 Posts

Posted - September 21 2010 :  05:44:14  Show Profile  Reply with Quote
Glad you got it working.
I added in the cdescription field to our cross selling a while ago, but we're still with the old faithful Access db so MSSQL is never an issue.

Regards,

Carrol
www.deanston-electrical.co.uk
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00