4 replies [Last post]
apeee's picture
Offline
Joined: 12/11/2007
Juice: 128
Was this information Helpful?

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?

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Re: Creating Image Buttons

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>.
apeee's picture
Offline
Joined: 12/11/2007
Juice: 128
Re: Re: Creating Image Buttons

Sorry, but that didn't worked.

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

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Creating Image Buttons

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.

apeee's picture
Offline
Joined: 12/11/2007
Juice: 128
Re: Re: Creating Image Buttons

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