Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1031409

    Hi,
    I used the enfold demo shop to create my shop.
    I wanted to add a buy button and read more button to the products in the product slider.
    I found this previous thread that enabled me to add the buy button: https://kriesi.at/support/topic/add-add-to-cart-button-in-product-grid-product-slider/
    But I would also like to add the ‘Read more’ button.

    Can you help me do this?

    • This topic was modified 6 years ago by Camilla88.
    #1031411

    Also I would like the buttons horizontally aligned. Right now one product has a shorter name, and so the buy button is too far up compared to the others. It would be amazing with some help for this too.

    #1032293

    Hi Camilla88,

    Looks like the website is in maintenance mode and we’ll need credentials to see the page. Can you please share those with us?

    Best regards,
    Victoria

    #1034177
    This reply has been marked as private.
    #1034646

    Hi,

    Thanks for that, though the login details are not working. Please check and verify.

    Best regards,
    Rikard

    #1035106
    This reply has been marked as private.
    #1037311

    Hi,
    Sorry for the late reply, I took a look at your site but I didn’t see the “editor” option to add functions in your functions.php, so here are two functions that may work fore you, Try adding one or the other to the end of your functions.php file in Appearance > Editor:

    add_action('woocommerce_after_shop_loop_item', 'replace_add_to_cart' );
    function replace_add_to_cart() {
        global $product;
        echo '<br><a class="button" href="' . esc_attr( $product->get_permalink() ) . '">' . __( "Read more" ) . '</a>';

    or this one:

    add_filter( 'woocommerce_loop_add_to_cart_link', 'replace_loop_add_to_cart_button', 10, 2 );
    function replace_loop_add_to_cart_button( $button, $product  ) {
        return '<a class="button" href="' . $product->get_permalink() . '">' . __( "Read more" ) . '</a>';
    }

    Please let us know if one of these works for you.

    Best regards,
    Mike

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.