Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Customization
 CODE: Another Great Addition to VPASP--QUICK SHOP
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

hakkatil
VP-CART New User

109 Posts

Posted - June 14 2002 :  12:19:29  Show Profile  Reply with Quote
Hi to VPASP Community
Ever wonder to put quickshop on your main page so that your existing customers can easily purchase your products. This works for us very much because our existing customers do like to click on our quick shop and order our products without hassle to navigate our products.

IF you have more than 40 products, this might be a cumbersome to your page loading and customers. It is good up to 40 products since all products are displayed in combobox. Of course you can use this if you have more than 40 products. There is no limitation. But suggested number is around 40.

Note: This is tested using VPASP 4.0 and internet explorer 5.0. I am not sure if this works with Nestcape. If it does not work just delete javascript and put a go button.(<input type="submit" value="go" name="quick">)

Create a page called quickshop.asp and paste below code inside of it.
replace this line with your database destination folder name:
c:\inetpub\wwwroot\test\fpdb\shop4.mdb


**************code starts from here************************
<script language="javascript">
function gone1(){
var list = window.document.jumpy1.quickbuy1.value;
if (!( list == "-") )
{
parent.location.href = list;
return false;
}

}
//-->

</script>
<%
dsn=";Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\wwwroot\test\fpdb\shop4.mdb"
%> <form name="jumpy1">
<SELECT NAME="quickbuy1" SIZE=1 style="font-size:8pt" onChange="gone1()">
<% Set conn = Server.CreateObject("ADODB.Connection") %>
<% conn.Open dsn ' connect to the database %>
<% Set rs = conn.Execute("SELECT * FROM products ORDER by catalogid") %>
<% Do While Not rs.EOF ' define the ListBox OPTIONs %>
<OPTION VALUE="shopaddtocart.asp?productid=<%= rs("catalogid") %>&quantity=1"> <%= rs("cname") %> </option>
<% rs.MoveNext %>
<% Loop %>
<% rs.Close %>
<% conn.Close %>
</SELECT></form>
**************code ends from here************************

that's it my fellow friends. Just copy and paste it.
Enjoy

If you have any questions, just drop a line on this forum.



Edited by - hakkatil on June 14 2002 12:29:41
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00