Jordan
Jordan

Reputation: 237

woocommerce, add to cart button show just an image not text

I want to display the "Proceed to checkout" button just an image and no text. So, in the CSS I used background-image and height and width.

I tried to change the following code from this

<input type="submit" class="checkout-button button alt wc-forward" name="proceed" value="<?php _e( 'Proceed to Checkout', 'woocommerce' ); ?>" />

to this

<input type="submit" class="checkout-button button alt wc-forward" name="proceed" value="<?php do_action( 'Proceed to Checkout', 'woocommerce' ); ?>" />

The text goes away, but the button doesn't go to the checkout page, just refreshes the cart page.

Any help?

Upvotes: 0

Views: 2589

Answers (1)

Aurous
Aurous

Reputation: 132

<html>
    <head>
        <style type="text/css">
            input.proceed
            {
            background: url('image here') no-repeat;
            cursor:pointer;
            border: none;
            }
        </style>
    </head>
    <body>
        <input type="submit" class="proceed" name="proceed" value="           " onclick="<?php _e( 'Proceed to Checkout', 'woocommerce' ); ?>" />
    </body>
</html>

This should solve your problem, it worked for me when i was testing it.

Upvotes: 1

Related Questions