WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Shop/Catalog Page: Need Product Name and Add to Cart (8 posts)

  1. hueyapan
    Member
    Posted 1 year ago #

    I have been working on this for hours. I'd like to have the product name, or description, and an "add to cart" button underneath the product on the Shop page or any other gallery display.

    Here's my site:

    http://lipzen.com/

    Thanks in advance for any help or ideas.

    http://wordpress.org/extend/plugins/woocommerce/

  2. bheadrick
    Member
    Posted 1 year ago #

    without having access to that exact theme, it's difficult to know exactly what will work well, but I would go with

    add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );

  3. hueyapan
    Member
    Posted 1 year ago #

    Thank you so much for your response. It's the Argentum theme from Woothemes. Where would I add that line of code?

  4. bheadrick
    Member
    Posted 1 year ago #

    Yeah, I could tell what theme it was, but my point was that I don't have access to see the code to know whether that will work well.

    That line of code would go in your functions.php on your theme, and only adds the "add to cart" button.

  5. hueyapan
    Member
    Posted 1 year ago #

    I really appreciate it - I will try to do a dummy install on another site and see if it works. Thanks again!

    I guess I still need to figure out how to put the product name. This is the look I'm going for: http://www.winksoap.com/

  6. bheadrick
    Member
    Posted 1 year ago #

    to add the title and then the add to cart

    function add_wc_title(){
    return '<h3>' . get_the_title() . '</h3>';
    }
    add_action( 'woocommerce_after_shop_loop_item', 'add_wc_title', 10 );
    add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );

  7. hueyapan
    Member
    Posted 1 year ago #

    This worked great for getting the "add to cart" to show up. The title didn't show up, but I am determined to get to the bottom of this - I will tinker with it.

    I really appreciate it!

  8. bheadrick
    Member
    Posted 1 year ago #

    maybe cos it's already firing inside the image. You might need to remove the hook and readd it like this:

    remove_action( 'woocommerce_after_shop_loop_item', 'add_wc_title');
    add_action( 'woocommerce_after_shop_loop_item', 'add_wc_title', 10 );

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic