6 replies [Last post]
Anand yrh's picture
Offline
Joined: 03/06/2009
Juice: 271
Was this information Helpful?

How to change Default Add to cart button to Image in Ubercart 2.0-beta5?

Anand yrh's picture
Offline
Joined: 03/06/2009
Juice: 271
I did it! Check this

I did it!

Check this out
http://www.ubercart.org/contrib/9512

imstillatwork's picture
Offline
Bug Finder
Joined: 12/27/2008
Juice: 207
Re: I did it! Check this

I would just use CSS in the themes main style sheet. Since it is a button and not an a tag, it takes a little more css, but still much easier this way.

/* ADD TO CART BUTTON */
.node-add-to-cart{
background:transparent url(images/button-add-to-cart.png) no-repeat; /* button image */
height:44px; /* button height */
width:120px; /* button width */
border:none; /* get rid of button border */
/* all below just hides the button text */
font-size: 0px;
display:block;
line-height: 0px;
text-indent: -999px;
}

Anand yrh's picture
Offline
Joined: 03/06/2009
Juice: 271
Re: Re: I did it! Check this

Hi, Thanks for your replay!

My problem got fixed!

xacobe's picture
Offline
Joined: 06/16/2009
Juice: 46
Re: Re: I did it! Check this

The code works, but it doesnt behavior like a button when you mouse over, the mouse doesnt change.
I will try the module.

EDIT: With module "uc_imgsubmit" mouse over works fine, but isnt multilingual, it is?

re-EDIT: ok, I found somewhere on the forum (there is a lot about it) to put "input { cursor:pointer; }" to solve the problem with the mouse over. Finally I use the CSS code on my multilingual store.

godzuke's picture
Offline
Joined: 07/19/2011
Juice: 3
Cursor Issues

Just add the cursors to your code (as below), and your problem will be sorted:

/* ADD TO CART BUTTON */
.node-add-to-cart{
background:transparent url(http://xyz.com/abc.png) no-repeat; /* button image */
height:60px; /* button height */
width:146px; /* button width */
border:none; /* get rid of button border */
cursor:pointer;
cursor:hand;
/* all below just hides the button text */
font-size: 0px;
display:block;
line-height: 0px;
text-indent: -999px;
}

tomnoble's picture
Offline
Joined: 06/13/2010
Juice: 62
Hi, I know this thread is

Hi,

I know this thread is over a year old, but I am having the same problem with the "jaded" theme. The buttons in the catalog grid view or the review order form aren't displaying.

Can anyone advise me on how to fix this?

Kind Regards

Tom