WordPress.org

Ready to get started?Download WordPress

Forums

WP eCommerce
[resolved] Need a link on a picture which will add a product to the basket! (5 posts)

  1. MattAbode
    Member
    Posted 3 months ago #

    Hope someone can help.
    I need a link that will add a product to my basket.
    Basically a link on a picture once pressed will add a product to the basket?
    Not sure if this is possible but any help will be much appreciated! :)

    Thanks

    https://wordpress.org/plugins/wp-e-commerce/

  2. Edward
    Member
    Plugin Author

    Posted 3 months ago #

    You could use something like the following.

    First go to the page you want to add the product to and click the "Add a product editor button" It looks like a credit card. (see following screenshot)
    Add Product Short Code Editor Button

    Select the "Product" Tab in the dialog that appears. Select a product from the Drop Menu in this dialog (see following screenshot)
    Product tab product drop menu

    Scroll down in this dialog and select the "Add an add to cart button" option. (see following screenshot)
    Add to cart option

    This results in a shortcode that produces something like the following

    <div class="wpsc-add-to-cart-button">
    <form class="wpsc-add-to-cart-button-form" id="product_476" action="" method="post">
    <div class="wpsc_variation_forms">
    </div>
    <input type="hidden" name="wpsc_ajax_action" value="add_to_cart">
    <input type="hidden" name="product_id" value="476">
    <input type="submit" id="product_476_submit_button" class="wpsc_buy_button" name="Buy" value="Add To Cart">
    <input type="hidden" name="bb2_screener_" value="1398949885 69.116.7.166"></form>
    </div>

    Now you can use some basic CSS to alter the appearance of this button.

    In the code above you see a line for the button
    <input type="submit" id="product_476_submit_button" class="wpsc_buy_button" name="Buy" value="Add To Cart">

    You see this has ID product_476_submit_button your button will have a different number so do not just copy paste this.

    Create a CSS style something like the following

    #product_476_submit_button{
    border: none; /* remove the border */
    background-color: transparent;
    height: 140px; /* need to set a height and width */
    width: 170px;
    /* add your image as a background */
    background-image: url(http://getshopped.org/wp-content/themes/getshopped/images/showcase1.png);
    text-indent: -2000px; /* remove the button text */
    }

    Hope this helps

  3. MattAbode
    Member
    Posted 3 months ago #

    Thanks for the reply! Much appreciated.
    I understand what you are saying. Though I've tried and all I get is a window with a 0 in it where you click 'add and add to car button"

    Here is the page http://abodesofas.com/showroom/chesterfield-sofas/manhattan-leather-chesterfield-sofa/ basically I want a button underneath the prices at the bottom which will add the individual variation to the car. At this moment in time the variation is selected by clicking the drop down menu.

    Hope you can shed some light on this.

    Thanks.

  4. MattAbode
    Member
    Posted 3 months ago #

    Basically, the button is already there under the plugin. The plugin is a pricing table, i just need to add a link on the button which will add each indivdual variation to the cart if it's clicked.

    Hope you understand what I mean, it's kinda difficult to get it across what I want :)

  5. Edward
    Member
    Plugin Author

    Posted 3 months ago #

    What you are attempting is not possible out of the box. You might be able to have a developer build something custom. Here is a list of prominent WordPress / WPEC developers that may be able to assist you with custom development and design.
    http://getshopped.org/consultant/

    Good Luck!

Reply

You must log in to post.

About this Plugin

About this Topic