Just nu i M3-nätverket
Jump to content

Mängd Rabatt?!


Leon Radley

Recommended Posts

Har Modifierat ett shoppingcart skript så att det ska kolla i databasen efter ProdQuantity och om den överstiger Qty textfältet då ska den sätta det nya priset till det som stämmer överäns med det i databasen... man jag får ett error vad kan det vara för fel?

 

<%

'**Charon Cart**

'**Add to cart using a Form**

'

FormAction=Request.ServerVariables("SCRIPT_NAME")

if Request.Form <> "" then FormAction=FormAction & "?" & Request.Form

if Request.QueryString <> "" then FormAction=FormAction & "?" & Request.QueryString

if Request("Charon_Cart") <> "" then

Randomize Timer

isFound=false

for i=0 to ubound(CCcart,2)

if CCcart(CC_ProductID,i) = cstr(ProductsRS("ProdID")) and CCcart(CC_Size,i)=ProductsRS("ProdWeight") then

CCcart(CC_Quantity,i) = CCcart(CC_Quantity,i) + 1

isFound=true

exit for

end if

next

if not isFound then

for i=0 to ubound(CCcart,2)

if CCcart(CC_ProductID,i) = "" then

 

'----------------------

'Script for Quantity

 

Dim ProductsQTYRS__User

ProductsQTYRS__User = "Netto30"

If (Session("PriceGRP") <> "") Then

ProductsQTYRS__User = Session("PriceGRP")

End If

 

Dim ProductsQTYRS__ProdID

ProductsQTYRS__ProdID = "1010"

If CCcart(CC_PRODUCTID,i) <> "" Then

ProductsQTYRS__ProdID = CCcart(CC_PRODUCTID,i)

End If

 

set ProductsQTYRS = Server.CreateObject("ADODB.Recordset")

ProductsQTYRS.ActiveConnection = MM_CharonCart_STRING

ProductsQTYRS.Source = "SELECT * FROM ProductsQRY WHERE ProdPriceGRP = '" + Replace(ProductsRS__User, "'", "''") + "' AND ProdID = '" + Replace(ProductsRS__ProdID, "'", "''") + "' AND ProdQuantity > 0 ORDER BY ProdQuantity"

ProductsQTYRS.CursorType = 0

ProductsQTYRS.CursorLocation = 2

ProductsQTYRS.LockType = 3

ProductsQTYRS.Open()

ProductsQTYRS_numRows = 0

 

Do While NOT ProductsQTYRS.EOF

If FormQuantity >= ProductsQTYRS.Fields.Item("ProdQuantity").Value Then

QuantityPrice = ProductsQTYRS.Fields.Item("ProdPrice").Value

End If

Loop

 

ProductsQTYRS.Close()

Set ProductsQTYRS = Nothing

'End The Quantity Script

'-----------------------

CCcart(CC_ProductID,i)=ProductsRS("ProdID")

CCcart(CC_Quantity,i)= FormQuantity

CCcart(CC_Price,i)= QuantityPrice

CCcart(CC_Name,i)=ProductsRS("ProdDesc")

CCcart(CC_Size,i)=ProductsRS("ProdWeight")

CCcart(CC_UniqueKey,i)=int(rnd*9999999)+10000000

exit for

end if

next

end if

CartToCookie CCcart,"CharonCart"

CC_RedirectURL="ShoppingCart.asp"

Response.Redirect "ShoppingCart.asp"

end if

 

%>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...