WordPress.org

Ready to get started?Download WordPress

Forums

WP eCommerce
[resolved] [Plugin: WP e-Commerce] Can I use a custom add to cart button? (7 posts)

  1. jaylowx
    Member
    Posted 1 year ago #

    Hi.

    I'm using the twentyeleven theme (with a child theme) and running the WP E-Commerce plugin.

    What I'd like to do is use a custom image for the "add to cart" buttons that are next to each product.

    Is this possible?

    Thanks in advance.

    http://wordpress.org/extend/plugins/wp-e-commerce/

    [ Please do not bump, that's not permitted here. ]

  2. Steve Truman
    Member
    Posted 1 year ago #

    Hi Jaylowx,

    Yes you can by changing the button class in you child themes ccs. You have to know some code to do it yourself - or ask your developer - its a very simple and quick task,

  3. sixfootjames
    Member
    Posted 1 year ago #

    Hi Jay,

    Your css will most likely look something like this:

    #content input.wpsc_buy_button
    {
        background: url('images/buynow.png') no-repeat top left transparent;
    }

    Where #content input.wpsc_buy_button is the CSS selector you might be using and buynow.png is your new buy now button imag. You would changing this, most likely in the wpsc-default.css file.

    Hope that helps.

  4. jaylowx
    Member
    Posted 1 year ago #

    That's brilliant - it worked, thank you.

    How would I make it so there's no text in the button & the button is purely an image and not restricted to a certain size (so when I overwrite the button image with a different sized button image it would be the new size)?

    Hope that makes sense...

  5. sixfootjames
    Member
    Posted 1 year ago #

    Hi Jay,

    In your wpsc-list_view.php page or wpsc-grid_view.php you will find a line like this: (just search for the class name wpsc_buy_button)

    <input class="wpsc_buy_button" type="button" value="<?php echo wpsc_product_external_link_text( wpsc_the_product_id(), __( 'Buy Now', 'wpsc' ) ); ?>" onclick="return gotoexternallink('<?php echo $action; ?>', '<?php echo wpsc_product_external_link_target( wpsc_the_product_id() ); ?>')">

    Just change it to something like this:

    <input class="wpsc_buy_button" type="button" value="<?php echo wpsc_product_external_link_text( wpsc_the_product_id(), __( '', 'wpsc' ) ); ?>" onclick="return gotoexternallink('<?php echo $action; ?>', '<?php echo wpsc_product_external_link_target( wpsc_the_product_id() ); ?>')">

    Note: the Buy Now has been removed.

    That should do the trick.

  6. jaylowx
    Member
    Posted 1 year ago #

    Thanks but that didn't seem to do anything?

    I just want a button that's an image that when clicked adds my product to the basket. I want to be able to change the image whenever I want by changing the url to the image. I want to use something like this: http://www.aquariumfish.net/_paypal/images/paypal_add_to_cart.gif

    This is the page I'm trying to do it on: http://utgold.co.uk/?page_id=10

    Sorry if I'm being stupid, I'm new to wordpress and not familiar with how to code at all.

  7. bobspalding
    Member
    Posted 1 year ago #

    I can't seem to get it to work @sixfootjames, I followed your instructions, am I doing something wrong?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic