Creating Image Buttons

Posts: 47
Joined: 12/11/2007

I searched ubercart configuration but didn't find anything to change the button of add to cart. How can I change the "add to cart" button to an image? Can this also be done with "update cart" button, "checkout" button and others?

Posts: 931
Joined: 11/05/2007
Bug FinderFAQ ModeratorGetting busy with the Ubercode.

You can do this with CSS:

.form-submit {
  background-image:  url(images/koolpik.png);
}

Firebug is pretty much indispensable for doing this sort of thing.

--

<tr>.

Posts: 47
Joined: 12/11/2007

Sorry, but that didn't worked.

Can't I just add: input type=image src="img/addtocart.jpg"

Posts: 2272
Joined: 08/07/2007
AdministratoreLiTe!

Drupal doesn't handle image inputs very well, so this would require significant changes to the form building function. I did find a post on drupal.org that might point you in the right direction, though: http://drupal.org/node/62647.

However, image support was added to the FormAPI in Drupal 6, so you can just use a form_alter when we have a version for it.

Posts: 47
Joined: 12/11/2007

Thanks. Image Button was getting more complex so I just edited the css part. This made the changes to all the buttons. Thanks.

input.form-submit