Author |
Topic  |
|
baukeplugge
Starting Member
Netherlands
8 Posts |
Posted - November 06 2014 : 16:06:58
|
Hi All,
I have done some customizations on the product template tmp_product.htm. I have added some radio button selections. now I want to show these extra selections in the shopping cart.
is this possible ? if so how should I do this ?
thanks in advantage Bauke |
|
carfin
VP-CART Expert
  
United Kingdom
948 Posts |
Posted - November 07 2014 : 07:50:01
|
Hi Bauke,
the best way to add your selections to the cart is to have the radio button choices as features of the product. This can be set up easily in the admin panel and there is no custom code required to add to the cart
Regards, Carrol www.deanston-electrical.co.uk |
 |
|
baukeplugge
Starting Member
Netherlands
8 Posts |
Posted - November 07 2014 : 08:26:13
|
hi thanks for you reply!
I have used the other fields 1 till 5 for saving extra product info. so I really want to have that information in the cart if possible. thanks again ! Bauke |
 |
|
serjtankian
VP-CART Super User
 
Armenia
378 Posts |
|
manilow
VP-CART New User

France
134 Posts |
Posted - November 13 2014 : 03:14:00
|
Hi Bauke,
To display the extra fields in your cart, go to your shopping cart configuration to set:
xcartfields = cname,cdescription,ccode,pother3,pother4,pother5
(or any combination)
Kind regards,
Erik www.aquathermia.com |
 |
|
baukeplugge
Starting Member
Netherlands
8 Posts |
Posted - November 13 2014 : 09:30:31
|
Hi Carrol,
thank you very much for your reply! only this will put the options availble in that product but not the selection done in the product before adding to the cart |
 |
|
manilow
VP-CART New User

France
134 Posts |
Posted - November 13 2014 : 10:07:24
|
If you want options to be selectable, then use the Product Options module : shopa_editdisplayprodfeatures.asp
Kind regards,
Erik www.aquathermia.com |
 |
|
baukeplugge
Starting Member
Netherlands
8 Posts |
Posted - November 13 2014 : 17:41:15
|
I have already created my own selection options from other database tables. that''s working as a charm. but now I need to get those selections into my cart.
it would be good to be able to. |
 |
|
baukeplugge
Starting Member
Netherlands
8 Posts |
Posted - November 17 2014 : 07:32:05
|
Do I need to write this to a session cookie ? is there someting written about this ? |
 |
|
carfin
VP-CART Expert
  
United Kingdom
948 Posts |
Posted - November 17 2014 : 09:11:12
|
You would have to create custom code in the files shopaddtocart.asp and shopcartformat.asp so that the text details of your option will display on each product on the cart page.
A screen shot of your template would be helpful as I''m not 100% sure of what you are trying to achieve. Product templates only display data from the products table.
Regards,
Carrol www.deanston-electrical.co.uk |
Edited by - carfin on November 17 2014 09:14:34 |
 |
|
baukeplugge
Starting Member
Netherlands
8 Posts |
Posted - November 17 2014 : 10:18:52
|
I have this in my tmp_product.htm added:
[ADD_SIZES]
then I have added this in shopfileio.asp
case "ADD_SIZES" Add_Sizes "User",parsearray rc=0
sub Add_Sizes (ivalue, parsearray) dim sizes, fieldname,fieldtype, rc, sizearray, x fieldname="pother2" FindInDatabase fieldname, sizes, fieldtype ,rc,parsearray WriteForm "Maten: " sizearray=split(sizes,",") for each x in sizearray WriteForm "<input name=""test"" type=""radio"" value=""" & x & """/>" & x next end sub
in pother2 I have added data from an external table with sizes for this product. for each size there will be a radio selection button.
now I want to get this into the cart so I know what size is selected
|
 |
|
baukeplugge
Starting Member
Netherlands
8 Posts |
Posted - November 24 2014 : 09:05:38
|
anybody who could help ?? |
 |
|
manilow
VP-CART New User

France
134 Posts |
Posted - November 24 2014 : 09:51:50
|
Hi Bauke,
Ok, there must be a way I guess.
One would be to modify the GetNameInCart subroutine in shopproductsubs.asp:
Insert the following lines in red:
for i = 0 to fieldcount -1 if cartfields(i) = "cdescription" then fieldvalue = memCDescription fieldvalue = TranslateLanguage(dbc, "products", "cdescription", "CatalogId", tempCatalogId, fieldvalue) elseif cartfields(i) = "pother2" then fieldvalue = request.Form("test_option")
else fieldvalue = rsitem(cartfields(i)) if lcase(cartfields(i)) = "cname" then
"test_option" is the name of your radio button input in the product template.
Set xcartfields = cname,cdescription,ccode,pother2 (include at least cname and pother2)
When adding a product to the shopping cart, normally it will get all informations from the database (cname, cprice, etc). With the modification above, it will get the selected feature value from the product form instead.
This code may need some optimization since in case a customer adds two identical products into the cart with different feature options, only the first selected will remain.
I hope this will help you further.
Kind regards (met vriendelijke groet)
Erik www.aquathermia.com |
 |
|
baukeplugge
Starting Member
Netherlands
8 Posts |
Posted - January 16 2015 : 17:08:29
|
Hi Erik,
thanks for your help.
did not had the change till now to test this part. and it did what I wanted !!
thanks very much.
Bauke
|
 |
|
|
Topic  |
|