שלח תשובה

זירת השאלות

569
צפיות
2
תשובות

בעיה קטנה בהוספת המוצרים לסל הקניות

,‏ 25 בינואר, 2009

שלום
באתר שאני בונה בASP יש בעיה קטנה ב3 השורות ששומרות בזיכרון את המוצרים כאשר המשתמש מוסיף את המוצר הראשון שלו אותם שלוש שורות מופיעים כשגיאה
וכאשר אני מסמן אותם כהערה זה פועל כשורה ואחרי שהוא מוסיף את המוצר הראשון שלו אני מבטל את הערה רציתי לשאול אם  תוכלו לעזור לי לתקן את הבעיהשלושת השורות הן

sCartItemNums = session("cartitemnumarray")
nCartItemQtys = session("cartitemqtyarray")
nNumCartItems = ubound(sCartItemNums)  

הקוד המלא

<%
Dim uName, myStr, conn, rs, conStr, rsStr, uDate, titleStr,narrowed
uName = session("uName")
Name = session("Name")
Set conn = Server.CreateObject("ADODB.Connection")
conStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source ="
conStr = conStr & Server.MapPath("outpost.mdb")
conn.Open conStr
Set rs = Server.CreateObject("ADODB.Recordset")
'rsStr = "SELECT uBgColor, uFontColor, uFontSize, uDate, uMale "
rsStr = rsStr & "FROM  People "
rsStr = rsStr & "WHERE uName='" & uName &"'"
set rs = nothing
conn.Close
set conn = nothing
%>
<%
sCartItemNums = session("cartitemnumarray")
nCartItemQtys = session("cartitemqtyarray")
nNumCartItems = ubound(sCartItemNums)
   sMode = request.querystring("mode")
    select case request.form("cmdSubmit")
    case "Proceed to Checkout"
      sMode = "checkout"
    case "Recalculate Order"  
      sMode = "recalc"
    case "Continue Shopping"
      sMode = "continue"
  end select
  if sMode = "add" then
    nThisItemIndex = 0
    sItemNo = ucase(request.querystring("itemno"))
    if nNumCartItems > 0 then
      for i = 1 to nNumCartItems
        if ucase(scartitemnums(i)) = sItemNo then
          nThisItemIndex = i
          exit for
        end if
      next
    end if
    if nThisItemIndex = 0 then
      nThisItemIndex = nNumCartItems + 1
      redim Preserve sCartItemNums(nThisItemIndex)
      redim Preserve nCartItemQtys(nThisItemIndex)
      sCartItemNums(nThisItemIndex) = sItemNo
      nCartItemQtys(nThisItemIndex) = 1
    else
      nCartItemQtys(nThisItemIndex) = nCartItemQtys(nThisItemIndex) + 1
end if
    session("cartitemnumarray") = sCartItemNums
    session("cartitemqtyarray") = nCartItemQtys
    nNumCartItems = ubound(sCartItemNums)
  end if
  if sMode = "recalc" or sMode = "checkout" or sMode = "continue" then
    for i = 1 to nNumCartItems
      nThisQty = int(request.form("txtItemQty" & i))
    &n

תגיות:

2 תשובות

  1. raychin הגיב:

    אחרי שאני מבטל את ההערה שאר המוצאים
    אחרי שאני מבטל את ההערה  שאר המוצאים נוספים כשורה


    א.ר.ר

שלח תשובה