nidhitiwari Posted September 21, 2010 Posted September 21, 2010 I am sending value of custom image in hidden feild of add to cart button through coading.the output is: <input type="hidden" value="91" name="products_id" id="cart_hidden_feild" custom_image="1285056761.jpg"/> but i am not able to retrieve "custom_image" value on shopping_cart.php so that i can change with existing product image value.can anyone help me ????? Sonal
♥Monika in Germany Posted September 21, 2010 Posted September 21, 2010 Well, this is a lot more complicated to achieve ... you will need to alter the shopping cart class and add the image info to the session, and later to the database ... there are redirects taking place right after an item is being added to the cart so this would prevent any direct pulling of form values on the shopping cart page. Regardless, so even if changed, when a next item is being added to the cart you'd loose the image info if it's not done the way I outlined above. :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...
chadcloman Posted September 21, 2010 Posted September 21, 2010 In addition to what Monica wrote, you can't just add a random attribute to the <input> tag and expect to be able to access its value when processing the form submission. Only the "name" and "value" fields are passed to the PHP code via $_POST. I suggest you read up on form processing (both in PHP and HTML). Also, you've misspelled "field" in "cart_hidden_feild", which could cause problems later down the road. Check out Chad's News.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.