Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Customization
 Give a little back.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Kamin
Starting Member

USA
30 Posts

Posted - August 28 2005 :  19:21:41  Show Profile  Visit Kamin's Homepage  Reply with Quote
This forum has been great for me and has given me a lot of help with the various aspects of customizing VPASP. So here is a little something. It's not the prettiest piece of code but it works well.


<%
Dim messagetype,catsql, mtype
ShopOpenDatabase mtype
catsql ="Select * from content where hide=0"

catsql=catsql & " order by messagetype,contentid desc"

Set resultset=mtype.execute(catsql)
While Not resultset.EOF
messagetype=resultset("messagetype")
if messagetype="" then
response.write ""
else
response.Write "<a HREF='shopcontent.asp?type=" & resultset("messagetype") & addwebsesslink & "'>" & resultset("messagetype") & "</a>" & "<BR>"

end if
resultset.MoveNext
WEND
%>


What this does is create a vertical style list of the content pages listed in the content table for VPASP 5.50 instead of the dropdown list provided.

If anyone else has snipets of code they want to contribute to this thread, please do so.

Thanks to everyone.
Kamin

rvaga
VP-CART Super User

USA
254 Posts

Posted - August 29 2005 :  01:38:59  Show Profile  Reply with Quote
Thanks Kamin!

I can't contribute code, but I came across something in the docs called shopkitconfig.asp that seemed interesting. I don't think I've ever seen it mentioned on this forum.

As it turned out, it was exactly what I needed for a static page, to allow customers to configure the product with various options. The options are set up via "features" in the administration panel. Once these are set up, I got it to work, the resulting page was quite plain. But, I used the source code (and javascript) and plugged it all into my static page. If anyone's interested, I'll type in the page URL below, you can look at the source code to see how it came together.

http://www.sheetmusic1.com/piano.artist.benches.html

Note that the page is not in the VPASP directory, so it will (hopefully) be prime for search engines.

Go to Top of Page

Kamin
Starting Member

USA
30 Posts

Posted - August 29 2005 :  11:58:14  Show Profile  Visit Kamin's Homepage  Reply with Quote
Here is a little something I posted in the Problems and Bugs forum.

I found a small problem with the cross selling image URL in 5.5

When xcrosssellingimage is enabled it displays the image but the URL doesn't attach the ?id=(whatever catalogid) instead it just displays shopexd.asp. To fix this open shopfileio.asp and at around line 1316 edit,

   imageurl="<a href='" & url & "'><img src='" & imagefile & "' border='0'></a>" 


And change it to

   imageurl="<a href=" & "shopexd.asp?id=" & rs("catalogid") & ">" & "<img src='" & imagefile & "' border='0'></a>" 


There ya go, simple fix.

Enjoy... I will post more snippets soon.

Kamin

Go to Top of Page

Sharon
VP-CART Super User

357 Posts

Posted - August 31 2005 :  03:15:28  Show Profile  Visit Sharon's Homepage  Reply with Quote
Kamin, thanks for the code to create a vertical style list of the content pages. For me it is far better than the drop-down. I am using 5.5 & according to the Developer's Guide you can add a new record in the content table with the same type & VP-ASP will always display the last one. Using your code however, it displays both versions. Do you know of a way round this without deleting one of the records?

Go to Top of Page

Kamin
Starting Member

USA
30 Posts

Posted - September 02 2005 :  15:16:13  Show Profile  Visit Kamin's Homepage  Reply with Quote
Hi Sharon,

Sorry for the late reply. I had not considered the possability of duplicate entries. Here is the revised code to correct it.

Old Code

catsql ="Select * from content where hide=0"
catsql=catsql & " order by messagetype,contentid desc"


New Code

catsql ="Select distinct messagetype from content where hide=0"
catsql=catsql & " order by messagetype"

This should grab the last entry as you described and none of the other duplicate entries.

Kamin


Go to Top of Page

Kamin
Starting Member

USA
30 Posts

Posted - September 09 2005 :  12:43:52  Show Profile  Visit Kamin's Homepage  Reply with Quote
Here is something else. For all that are using the UPS shipping module from VPASP here is a way to have free shiping to the USA but standard lookup for all other countries. NOTE: this only works with the shipping form and xshippingsetfields=Yes

in upsrealtime.asp starting at line 63

Old Code

sAction=request("action")
if saction="" then
sAction=request("action.x")
end if
Session("CurrentURL")="upsrealtime.asp"
Session("FollowonURL")="shopcreateorder.asp" ' force login to come back to us
Session("smprice")="" ' no price
Session("ShipMethod")="" ' no type
if Saction<>"" then
SetupShippingValues ' Got answer from customer
' continue to shopcreateorder is in above subroutine
end if
ShopPageHeader
GetShippingPrices 'Logic to get Shipping Prices
DisplayForm ' ask customer what he wants to do
ShopPageTrailer


New Code

sAction=request("action")
if saction="" then
sAction=request("action.x")
end if
Session("CurrentURL")="upsrealtime.asp"
Session("FollowonURL")="shopcreateorder.asp" ' force login to come back to us
Session("smprice")="" ' no price
Session("ShipMethod")="" ' no type
if Saction<>"" then
SetupShippingValues ' Got answer from customer
' continue to shopcreateorder is in above subroutine
end if
usascountry=getsess("Shipcountry")
if usascountry="US" then
response.redirect "shopcreateorder.asp"
else

ShopPageHeader
GetShippingPrices 'Logic to get Shipping Prices
DisplayForm ' ask customer what he wants to do
ShopPageTrailer
end if


There ya go, free shipping to the USA. Not sure if my coding is 100% correct but it works well for me. Im sure something similar can be done in the Fedex and USPS modules as well.

Kamin

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