Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

custom image in shopping cart


nidhitiwari

Recommended Posts

Posted

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

Posted

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 ...

Posted

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...