VP-ASP :: Shopping Cart Software

Shopping Cart Software Solutions for anywhere in the World

US/Canada(Toll Free): +1 888 587 2278
Europe/UK: +44 (020) 7193 9408
Australia/New Zealand: +61 3 9016 4497

VP-Cart StoreFront Customer Forum

Home | Profile | Register | Active Topics | Members | Search | FAQ
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 How does the shoppingcart work?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

18 Posts

Posted - January 26 2006 :  03:55:24  Show Profile  Reply with Quote
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!


' 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))
  CartCreateHyperlink cartfields, catalogid
  GetDeliveryName cartfields, arrCart(cDelivery,i)
  if getconfig("xcartimage")="Yes" and image<>"" then 
       CartAddimage "50%","left", image, cartfields
      AddField "50%","left", CartFontDesc & CartFields & CartFontEnd
  end if
  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>"


4282 Posts

Posted - January 26 2006 :  07:36:14  Show Profile  Visit support's Homepage  Reply with Quote
This issue requires more information, such as where you are trying to display the value which is stored in the pother2 field.

It would probably be best to direct this type of question to our helpdesk at https://www.vpasp.com/virtprog/helpdesk where you will receive an immediate response from one of the support staff.

Thank you.

Go to Top of Page

Starting Member

18 Posts

Posted - January 26 2006 :  10:31:49  Show Profile  Reply with Quote
well im not interested in showing these values on the page at all. Im just displaying them now, to see if im getting any values at all. so far the weight is ok.

As far as I can tell the cart contents is stored in an array as a session variable?
and this array holds all fields from the products table for each product in the cart. thats what i think at this point. so the pother2 field should be accessable to me here...somehow.

I am trying to do this:

For each product in the cart
SubTotalWeight[i]= (weight[i] * quantity[i])
SubTotalpother2[i]= (pother2[i] * quantity[i])
GrandTotalWeight = GrandTotalWeight + SubtotalWeight[i]
GrandTotalpother2 = GrandTotalpother2 + Subtotalpother2[i]
then somewhere else on the page im going to use the grandtotal values for different things. Im only interested in the total weight and the total "pother2" summed up.

Go to Top of Page

Starting Member

18 Posts

Posted - January 27 2006 :  08:28:56  Show Profile  Reply with Quote
Thanks a lot support-guys!

It works...

Go to Top of Page

VP-ASP New User

113 Posts

Posted - January 28 2006 :  03:19:04  Show Profile  Reply with Quote
Hi Lazze,

What was the answer?
Can you post, I was also interested in your approach and for me to do something similar.


Go to Top of Page

Starting Member

18 Posts

Posted - January 29 2006 :  02:46:51  Show Profile  Reply with Quote
This was the answer:[1/27/2006 2:11:00 AM - support3]
Dear Lars,

You would need to modify the shopproductfeatures.asp file to store the pother2 values in cart array. The cotherinfo element of the cart array is unused and can be used to store the pother2 information for each product.

Radek Rekas
VP-ASP Support

as you can see in my attempt above, I added the cPother2 field in shop$db.asp - shopping cart attributes.

step 2 was to extract that data in the shoppingcart where it iterates through the cart contents.
like this:
in the for next loop-

MyVariable = arrCart(cPother2,i)

setp 3. the place where these fields are defined:shopproductsfeatures.asp (I could not find this myself :-)
I just added the row:
arrCart(cPother2,scartItem) = strpother2
at line 143, and where strpother2 is defined in shop$db.asp

so you can now get any values out in the shopping cart if you follow this approach. it worked great.

Tell me if you need more info...

Go to Top of Page

VP-ASP New User

113 Posts

Posted - January 29 2006 :  03:05:07  Show Profile  Reply with Quote
thanks Lars,

I'll have a look at it and get back to you if I need anymore details.

thanks again


Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000