Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 General help me questions
 question about product to supplier
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

schitz011
Starting Member

39 Posts

Posted - July 24 2006 :  03:28:06  Show Profile  Reply with Quote
Is there anyway VPASP could be set up so that the 'ask a question about this product' link capability could be set so it would send that question to the supplier for that product?

If not, can someone who's got some real coding experience tell me who I could set up a dynamic link to the suppliers email address. Or would it be easier to have it as now where each product has a link back to the suppliers 'bio' page? (I have them set up as content pages..)

Just a thought..

Constantine
Starting Member

46 Posts

Posted - July 24 2006 :  22:51:48  Show Profile  Reply with Quote
Hi

Try this mod:

in a empty prod field store the supplier email, for example in the pother1

Now the harder parts, but not so hard
You will need to mod shopquestion.asp
Find the GetProductInfo routine and add at the end of the routine just before end sub

dim supplierEmail
supplierEmail = prs("pother1")

Now in the SendMail routine find

my_toaddress=getconfig("xemail")

Delete this and replace it with
if supplierEmail <> "" then
my_toaddress=supplierEmail
else
my_toaddress=getconfig("xemail")
end if

Give that a wirl and see how you go

COnst
Go to Top of Page

schitz011
Starting Member

39 Posts

Posted - August 07 2006 :  04:40:04  Show Profile  Reply with Quote
thanks.. i tried your suggestions but ended up with this error...

Microsoft VBScript runtime error '800a01f4'

Variable is undefined: 'supplierEmail'

/shopquestion.asp, line 149


here is the code itself.. Note i'm using the pother2 field instead..

****************
<%option explicit%>
<!--#include file="shop$db.asp"-->
<!--#include file="shopmail.asp"-->
<!--#include file="shopfileio.asp"-->
<%
'**************************************************************************
' Question about product
' VP-ASP 6.00 June 29, 2005
' shopQuestion.asp?id=xxx
' April 26, 2005 add translate
''*************************************************************************
Dim CR
CR=GetMailCR
Dim strMessage
Dim sAction
Dim my_to
Dim my_toaddress
Dim my_from
Dim my_fromaddress
Dim my_subject,mailtype
Dim my_system
Dim mailer
Dim my_attachment
Dim body
Dim strCustName
Dim strCustEmail
Dim strFriendsName
Dim strFriendsEmail
Dim id
Dim extDescription
dim dbc, prs
dim mailid, ProductMessage
Dim TellafriendSubject
sError=""
dim strcustphone, strhousenumber, strquantity, stroffer
dim cprice,cname,ccode
'=======================
' Entry Point
'=======================
if getconfig("xproductquestion")<>"Yes" then
shoperror getlang("LangCustNotAllowed")
end if
id=request("id")
ShopopendatabaseP dbc
If id="" then
serror=getlang("LangNoCatalogID")
else
If not isnumeric(id) then
Serror=getlang("LangNoCatalogID")
id=""
end if
end if
If serror="" then
GetProductInfo prs
end if
ShopPageHeader
If sError<>"" then
HandleError
else
sAction=Request("Action")
if sAction="" then
sAction=Request("Action.x")
end if
If sAction = "" Then
DisplayForm()
Else
ValidateData()
if sError = "" Then
SendMail
WriteInfoMessage
else
DisplayForm
end if
end if
end if
If id<>"" then
closerecordset prs
end if
ShopPageTrailer
shopclosedatabase dbc
'=======================
' Sub DisplayForm
'=======================
Sub DisplayForm()
If serror<>"" then
shopwriteerror serror
end if
response.write "<br>"
WriteProductdetails prs
Response.Write("<form name=form1 method=Post action=shopquestion.asp?id=")
Response.Write(id & ">")
Response.Write(TableDef)
CreateCustRow getlang("langYourName"), "Custname", strCustname,"No"
CreateCustRow getlang("langYourEmail"), "Custemail", strCustemail,"No"
CreateCustRow getlang("langcustPhone"), "phone", strcustphone,"No"
Response.Write(tabledefend)
Response.write "<p align=center>"
shopwriteheader Getlang("langquestion")
Response.write "<br><textarea rows=3 name=strmessage cols=50>" & strshipcomment & "</textarea></p>"
shopbutton Getconfig("xbuttoncontinue"), getlang("Langquestion"),"action"
Response.Write("</form>")
end Sub
'=======================
' Sub ValidateData
'=======================

Sub ValidateData()
Validatefield getlang("langYourName"), "Custname", strCustname,"No"
Validatefield getlang("langYourEmail"), "Custemail", strCustemail,"No"
Validatefield getlang("langcustPhone"), "phone", strcustphone,"No"
Validatefield "Your Question", "strmessage", strmessage,"No"
If Serror<>"" then
Serror= getlang("LangCommonRequired") & "<br>" & SError
exit sub
end if
If Not InStr(strcustemail, "@") > 1 Then
Serror=Serror & getlang("LangInvalidEmail") & "-" & getlang("Langyouremail") & "<br>"
end if
End sub

Sub ValidateField(caption, fieldname, fieldvalue,other)
fieldvalue=request(fieldname)
If fieldvalue="" Then
sError = sError & caption & "<br>"
End If
end sub

'=======================
' Sub SendMail
'=======================
Sub SendMail
dim url, ProductMessage, emailformat, acount
dim xmysite
Emailformat="Text"
Body=""
Mailfield Getlang("langproductname"),"xxx", cname,"No"
Mailfield getlang("langproductcode"), "xxx", ccode,"No"
body=body & vbcrlf
body=body & "Customer details" & vbcrlf
Mailfield getlang("langcommonName"), "Custname", strCustname,"No"
Mailfield getlang("langcustemail"), "Custemail", strCustemail,"No"
Mailfield getlang("langcustPhone"), "phone", strcustphone,"No"
Mailfield getlang("langquestion"), "xxx", strmessage,"No"
body=body & vbcrlf
'debugwrite body
mailtype=getconfig("xemailtype")
my_from=strCustName
my_fromaddress=strCustEmail
if supplierEmail <> "" then
my_toaddress=supplierEmail
else
my_toaddress=getconfig("xemail")
end if
my_to=getconfig("xemailname")
my_system=getconfig("xemailsystem")
my_subject=getlang("langquestion") & " " & getlang("langproductcode") & "=" & ccode
acount=0
ExecuteMail mailtype,My_from,my_fromaddress,my_to,my_toaddress,my_subject,body,emailformat,My_attachment,acount
end sub

Sub Mailfield (caption, other, fieldvalue,other1)
'Debugwrite "mail=" & fieldvalue
body=body & caption & ": " & fieldvalue & vbcrlf
end sub


Sub WriteInfoMessage

shopwriteheader getlang("LangTellafriendinfo")
end sub

Sub GetProductInfo (prs)
Dim sql
sql = "select * from products where catalogid = " & id
set prs = dbc.execute(sql)
If prs.eof then
serror=getlang("LangErrorNoProduct") & " catalogid=" & id
exit sub
end if
cprice=prs("cprice")
cprice=shopformatcurrency(cprice,Getconfig("xdecimalpoint"))
cname=prs("cname")
cname=translatelanguage(dbc, "products", "cname","catalogid", id, cname)
ccode=prs("ccode")
dim supplierEmail
supplierEmail = prs("pother2")
end sub

Sub WriteProductdetails (prs)
dim template, orc
template=Getconfig("xproductquestiontemplate")
ShopTemplateWrite template,prs, orc
end sub

Sub HandleError
shopwriteerror serror
end sub

%>
************************
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