Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Delete item in cart using an Delete Button Image


fleabag99

Recommended Posts

Instead of using the remove checkbox and clicking on the update cart button, I would like to have an image that says Delete Product that is clicked to remove the item from the cart. I am not sure how to do this. Thanks!

Link to comment
Share on other sites

Instead of using the remove checkbox and clicking on the update cart button, I would like to have an image that says Delete Product that is clicked to remove the item from the cart. I am not sure how to do this. Thanks!

You may run into problems trying to do this, as well as trying to provide the functionality of a quantity update per item... The reason is that in order to make a delete button per-item, you'd basically wrap it in a small form that submitted to the page, and have a hidden variable that was named the same as that checkbox is normally named... Then php would just execute that action like normal, deleting the product... The problem you may run into is that, in order to offer the ability to also update product quantities, you'd have to have a form for that... Since this is usually 1 global form for the whole shopping_cart page, which updates all product quantities at once, you would have 1 big mama form for the entire cart, with nested forms for each individual delete button, which isn't allowed... This could be circumvented by making the delete button on the far left of each cart row, wrapped in its own form, and then a separate form that handled an individual line's quantity update, wrapped around an update button that would only work for that particular row...

 

Richard.

Richard Lindsey

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...