Passing New Value To Cart
Posted: Thu Mar 17, 2011 4:59 am
Hi I am trying to pass value from product page to cart after pressing [add to cart].
I have tried following, in product.tpl
And then in cart.tpl
But above example gave me "undefined" in cart.tpl
Basically I am trying to add custom "text" field to product and be able to display it in shopping card, and probably add it to database in confirm.tpl where order is being created. I can deal with entering those into database, but how do I pass value from [add to cart] up to cart.tpl and canfirm.tpl?
Anyone help please!!!
I have tried following, in product.tpl
Code: Select all
<input type="text" name="custom_val" value="text">
Code: Select all
$custom_val = $_POST['custom_val']; echo custom_val;
Basically I am trying to add custom "text" field to product and be able to display it in shopping card, and probably add it to database in confirm.tpl where order is being created. I can deal with entering those into database, but how do I pass value from [add to cart] up to cart.tpl and canfirm.tpl?
Anyone help please!!!
