Hi,
im trying to figure out a way to get 2 product values available in the shoppingcart. I need to extract the weight for each product and also a value stored in the pother2 field in the products table.
when looking at addtocart.asp i see that a call is made to shop$db.asp for line 409: Sub CartGetProduct(id, rc). this routine calls another at 432: ProductGetValues rsitem, dbc and so on and on...im getting lost here. I have found in the beginning of shop$db.asp the folowing code:
'******************************************************
' Shopping cart attributes
'******************************************************
const cMaxCartAttributes=23
Const cProductid = 1
Const cProductCode = 2
Const cProductname = 3
Const cQuantity = 4
Const cUnitPrice = 5
Const cDualPrice = 6
Const cOriginalPrice=7
Const cCategory=8
Const cDiscount=9
Const cMinimumQuantity=10
const cSupplierid=11
Const cDelivery=12
const CStockLevel=13
const Cotherinfo=14
const cGroupDiscount=15
const cProductFeatures=16
const cMaximumQuantity=17
const cProductimage=18
const cProductweight=19
const cProductassociated=20
const cProductMiniName=21
const cPother2=22
later in shopcartformat.asp where the actual display of the cart contents is made to screen the following code was inserted by me as a test:in the middle of the code.
response.write ("weight " & arrCart(cProductweight,i))
response.write ("pother2 " & arrCart(cPother2,i))
(im not going to show this in production, but rather just see it for debugging...)
as you can see the cProductweight corresponds to the cart attributes above. and the weigt GETS DISPLAYED. fantasic! exactly what i want. But unfortunately the pother2 field does not get to display. I have added that line myself to the cart attributes and changed cMaxCartAttributes to 23 from prev. 22(thought it could be that easey?) not so.
CAN SOMEONE TELL ME WHERE AND HOW TO GET THE POTHER2 into my shoppingcart? I would be most greatful!
//Lars
'****************************************************************
' go through cart array and format values
'****************************************************************
'
Sub CartFormatProducts
Dim scartItem, arrCart, displayprice,catalogid, otherinfo
Dim i, CartFields, image
scartItem = GetSess("CartCount")
arrCart = GetSessA("CartArray")
if getconfig("xLCID")<>"" then
Session.LCID=getconfig("xLCID") ' set user supplied LCID
end if
cartisubtotal = 0
For i = 1 to scartItem
cartresponsewrite CartRow
If cartremove<> "" then
AddRemoveBox i
If getconfig("xdeliveryAddress")="Yes" then
AddEdit i, arrCart(cDelivery,i)
end if
end if
response.write ("weight " & arrCart(cProductweight,i))
response.write ("pother2 " & arrCart(cPother2,i))
cartfields=arrCart(cProductname,i)
catalogid=arrCart(cProductid,i)
CartCreateHyperlink cartfields, catalogid
image=arrCart(cProductimage,i)
GetDeliveryName cartfields, arrCart(cDelivery,i)
if getconfig("xcartimage")="Yes" and image<>"" then
CartAddimage "50%","left", image, cartfields
else
AddField "50%","left", CartFontDesc & CartFields & CartFontEnd
end if
otherinfo=arrCart(cotherinfo,i)
Minamount=arrCart(cMinimumQuantity,i)
Maxamount=arrCart(cMaximumQuantity,i)
If maxamount="" then maxamount=0
If lcase(otherinfo)="static" then maxamount=1
AddQuantity i, arrCart(cQuantity,i)
if pricehide <> true then
displayprice= CartFontUnitPrice & shopformatcurrency(arrCart(cUnitPrice,i),xxdecimalpoint) & CartFontEnd
If getconfig("xDisplayOriginalPrice")="Yes" then
If arrCart(cUnitPrice,i)<> arrCart(coriginalPrice,i) then
DisplayPrice =DisplayPrice & CartOriginalprice & shopformatcurrency(arrCart(coriginalPrice,i),xxdecimalpoint) & cartoriginalpriceend
end if
end if
AddField "10%","right", DisplayPrice
AddField "10%","right", CartFontPriceTotal & shopformatcurrency(arrCart(cUnitPrice,i) * arrCart(cQuantity,i),xxdecimalpoint) & CartFontEnd
if getconfig("xDualPrice")="Yes" then
AddField "10%","right", CartFontDualPrice & ShopFormatDualCurrency(arrCart(cDualPrice,i),2) & CartFontEnd
AddField "10%","right", cartFontDualTotal & ShopFormatDualCurrency(arrCart(cDualPrice,i) * arrCart(cQuantity,i),xxdecimalpoint) & cartfontEnd
dualsubtotal=dualsubtotal +(arrCart(cDualPrice,i) * arrCart(cQuantity,i))
end if
end if
cartisubtotal = cartisubtotal + (arrCart(cUnitPrice,i) * arrCart(cQuantity,i))
cartresponsewrite "</tr>"
next