Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP E-commerce

Status
Not open for further replies.

johnsimpson

Programmer
Mar 28, 2006
60
GB
Hi guys,

I've been asked to take a look at this website as the guy who originally built this site has left the company and it doesnt work!!

One of the problems is that the e-commerce side of the site isnt sending the correct details through. for example if you order a wetsuit it doesnt send the sizes through to the client.

I have suggested that we scrap the site and build a nice new one, which is in discussion, but they still want some issues solving in the meantime. :-(

I'm pretty new to e-commerce so could someone point me in the right direction as to where this code will be? (The code that send my client an email with the order details)

The section in mention is the accessories pages:


The search doesnt work either - not even a little bit!! So if anyone has any ideas on that as well it would be greatly appreciated

thanks
John
 
You really haven't given us a problem to help fix other than the site doesn't work. We cannot help very much with your ASP scripts with the link to the site sense we can't see any code.

Maybe start with one problem and go from there. The search maybe but we need the ever so important details...code, process and all that fun stuff :)


General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
The first problem is this:

The e-commerce side of the site isnt sending the correct details through. for example if you order a wetsuit it doesnt send the sizes through to the client.

thanks
John
 
The code can be anywhere. It depends on how the web server is setup. Check your with your network people if you don't know where the web server is. You'll be able to tell where the source is by the properties of the site on the web server. You might want to back track everything sense you won't be able to fix something without knowing the structure of the complete process of the site and locations of everything.


Also...This should help you get started faq333-2924


General FAQ faq333-2924
5 steps to asking a question faq333-3811
 

'Get User Info

sqltxt="select a.*,b.HouseNo,b.AddressLine1,b.AddressLine2,b.TownCity,b.County,b.Country,"
sqltxt=sqltxt & "b.Postcode from tblUsers a,tblAddresses b where a.UserID=b.UserID "
sqltxt=sqltxt & "and b.Billing=1 and a.UserID=" & userid
Set objRS = Server.CreateObject("ADODB.recordset")
objRS.Open sqltxt,constr
if not objRS.EOF then
UserName=objRS("FirstName") & " " & objRS("Surname")
UserCompany=objRS("CompanyName")
UserAddress=trim(objRS("HouseNo") & " " & objRS("AddressLine1") & ", " & objRS("AddressLine2"))
UserTown=objRS("TownCity")
UserCounty=objRS("County")
UserCountry=objRS("Country")
UserPostcode=objRS("Postcode")
UserTelephone=objRS("ContactNo")
UserFax=objRS("Fax")
UserEmail=objRS("LoginEMail")
end if
objRS.Close

'Get Order Details
sqltxt="select a.BasketID,a.Quantity,b.* from tblBasket a, tblAccessories b where a.AccessoryID=b.AccessoryID "
sqltxt=sqltxt & " and UserID=" & userid
sqltxt=sqltxt & " and BasketDate=" & nullifblank(dispdate(Date()),"d")
Set objRS = Server.CreateObject("ADODB.recordset")
objRS.Open sqltxt,constr
orderdetails=""
do while not objRS.EOF
orderdetails=orderdetails & "Qty: " & objRS("Quantity") & " Item No. "
orderdetails=orderdetails & objRS("ItemNo") & "<br>"
objRS.Movenext
loop
objRS.Close
%>

Can i just add this in the code above?

orderdetails=orderdetails & "Size" & objRS("Option1") & "<br>"
orderdetails=orderdetails & "Colour" & objRS("Option2") & "<br>"
orderdetails=orderdetails & "Price" & objRS("Price") & "<br>"

 
It looks like that should work. It really sounds as though the previous person just didnt have all of the fields added to the email.

 
ok thanks i will try that tonight and see if it works.

Would this be code that is for the search facility?


Code:
<%
  if request.form("cmbCategory")<>"" then
    category=request.form("cmbCategory")
  else
    category=request.form("txtCategory")
  end if
  if request.form("cmbSubCategory")<>"" then
    subcategory=request.form("cmbSubCategory")
  else
    subcategory=request.form("txtSubCategory")
  end if
  productsearch=request.form("txtProductSearch")
  
  for each item in request.Form
    if left(item,11)="txtQuantity" then
	  if request.form(item)<>"" then
	    if myval(request.form(item))<>myval("0") then
	      accid=mid(item,12,999)
		  option1=request.form("cmbOption1" & accid)
		  option2=request.form("cmbOption2" & accid)
	      sqltxt="insert into tblBasket(UserID,AccessoryID,Quantity,Option1,Option2) values ("
	      sqltxt=sqltxt & session("userid") & ","
	      sqltxt=sqltxt & accid & ","
	      sqltxt=sqltxt & request.form(item) & ","
	      sqltxt=sqltxt & nullifblank(option1,"t") & ","
	      sqltxt=sqltxt & nullifblank(option2,"t") & ")"
	      DoCommand sqltxt
		end if
	  end if	
	end if
  next		
%>

then the form code is as follows:

<form name="productquickfinder" method="post" action="index.asp">
                    <h3>Categories: 
                      <%showhiddenfield "ProductSearch",ProductSearch,1
					
				    sqltxt="select * from tblCategories order by Category"
                    Set objRS = Server.CreateObject("ADODB.recordset")
                    objRS.Open sqltxt,constr
					response.write "</br>"
					response.write "<table>"
					do while not objRS.eof
					  response.write "<tr>"
					    if request.form("cmbCategory")<>"" then
						  gotcha=false
					      if myval(request.form("cmbCategory"))=myval(objRS("CategoryID")) then
						    response.write "<td><img src='../images/templated_images/nw_mdot.gif' width='5' height='8'>"
							gotcha=true
						  else
					        response.write "<td><img src='../images/navigation/spacer.gif' width='5' height='8'>"
					      end if
						else
 				          response.write "<td><img src='../images/navigation/spacer.gif' width='5' height='8'>"
						end if
						response.write "</td>"
					    response.write "<td>"
					      response.write "<a href='#' onClick=" & chr(34) & "Javascript:hdn.innerHTML='<input type=hidden name=cmbCategory value=" & objRS("CategoryID") & ">';document.productquickfinder.submit()" & chr(34) & ">"
					        response.write objRS("Category")
					      response.write "</a>"
					    response.write "</td>"
					  response.write "</tr>"
					  if gotcha then
           response.write "<tr><td></td><td>"
				    sqltxt="select * from tblSubCategories "
					if category<>"Any" and category<>"" then
					  sqltxt=sqltxt & " where CategoryID=" & category
					else
					  sqltxt=sqltxt & " where CategoryID=0 "  
					end if
					sqltxt=sqltxt & " order by SubCategory"
                    Set objRSLU = Server.CreateObject("ADODB.recordset")
                    objRSLU.Open sqltxt,constr
					response.write "<table>"
					do while not objRSLU.eof
					  response.write "<tr>"
					    if request.form("cmbSubCategory")<>"" then
					      if myval(request.form("cmbSubCategory"))=myval(objRSLU("SubCategoryID")) then
						    response.write "<td><img src='../images/templated_images/nw_mdot.gif' width='5' height='8'>"
						  else
					        response.write "<td><img src='../images/navigation/spacer.gif' width='5' height='8'>"
					      end if
                        else
					      response.write "<td><img src='../images/navigation/spacer.gif' width='5' height='8'>"
						end if  
						response.write "<td>"
					      response.write "<a href='#' onClick=" & chr(34) & "Javascript:hdn.innerHTML='<input type=hidden name=cmbCategory value=" & objRSLU("CategoryID") & ">';hdn2.innerHTML='<input type=hidden name=cmbSubCategory value=" & objRSLU("SubCategoryID") & ">';document.productquickfinder.submit()" & chr(34) & ">"
					        response.write objRSLU("SubCategory")
						  response.write "</a>"	
					    response.write "</td>"
					  response.write "</tr>"
					  objRSLU.Movenext
					loop
					objRSLU.Close
					response.write "</table>"
               response.write "</td></tr>"					  
					  end if
                      objRS.Movenext
					loop
					response.write "</table>"
					objRS.Close  					
					%>
                      <br>
                    </h3>
                    <div id='hdn'></div><div id='hdn2'></div>
                  </form>

Can anyone suggest any possible problems with this code?

Your help is much appreciated.

thanks
John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top