logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > ASP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 10-19-2008, 05:33 AM   #1
xingxang
 
Join Date: Oct 2008
Posts: 4
Default Chili!Soft and Charon Cart

I just migrated a website from a Windows server to a Linux server. The server is running Chilisoft for ASP compatibility. I'm having a hell of a time trying to find the source of a runtime error I'm getting: "Error Type: Sun ONE ASP VBScript runtime (0x800A000D); Type mismatch; /store/inc_CharonCart.asp, line 67." My question is: Is it possible to run CharonCart on a ChiliSoft ASP server? And if so, what's needed?
Here's the code:
Code:
<%
CONST CC_ProductID = 0
CONST CC_Quantity = 1
CONST CC_Name = 2
CONST CC_Price = 3
CONST CC_UniqueKey = 4
CONST CC_Weight = 5
CONST CC_Color = 6
CONST CC_Size = 7
CONST CC_Skew = 8
if Request.Cookies("CharonCart") = "" then
dim CCcart(9,50)
else
CCcart=CookieToCart("CharonCart")
end if

CCcart_SubTotal=0
CCcart_numItems=0
CCcart_Shipping=0
CCcart_Discount=0
CCcart_SalesTax=0
isFound=false
for i=0 to ubound(CCcart,2)
if CCcart(CC_ProductID,i) <> "" then
isFound=true
CCcart_SubTotal=CCcart_SubTotal + (CCcart(CC_Quantity,i)*CCcart(CC_Price,i))
CCcart_numItems=CCcart_numItems + 1
end if
next
function CCcart_LineTotal
CCcart_LineTotal=CCcart(CC_Quantity,i)*CCcart(CC_Price,i)
end function
function CCcart_GrandTotal
CCcart_GrandTotal=CCcart_SubTotal + CCcart_Shipping + CCcart_SalesTax - CCcart_Discount
end function

function CartToCookie(thearray,cookiename)
on error resume next
mystring=""
for j=0 to ubound(CCcart,2)
if CCcart(CC_ProductID,j) <> "" then
for i=0 to 9
mystring=mystring & CCcart(i,j) & "^"
next
mystring=left(mystring,len(mystring)-1)
mystring=mystring & "|"
end if
next
mystring=left(mystring,len(mystring)-1)
Response.Cookies(cookiename)=mystring
end function

function CookieToCart(cookiename)
dim myarray(9,50)
mystring=Request.Cookies(cookiename)
productarray=split(mystring,"|")
for j=0 to ubound(productarray)
itemarray=split(productarray(j),"^")
for i=0 to 9
if itemarray(i) <> "" then
myarray(i,j)=itemarray(i)
else
myarray(i,j)=null
end if
next
next
CookieToCart=myarray
end function

%>
Update: I have found that if I close out the browser and delete temporary internet files and cookies and reopen it, everything works fine and I can access the cart only ONCE. After that, I cannot view the cart, add to cart, or even view the details of the item.

$20 bucks to the first one to help me get to the bottom of this...
xingxang is offline   Reply With Quote
Old 10-31-2008, 09:28 AM   #2
ranjan
 
Join Date: Dec 2004
Posts: 405
Default

Try defining the type to your variables like:

Dim CCart() as Object
Dim MyArray() As Array
Dim i As Integer

as opposed to just:

Dim CCart()
Dim MyArray()
Dim i
ranjan is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:13 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com