WordPress   

Replace Add to cart button with read more link in Woocommerce product pages

Before adding read more link we need to remove the Add to cart button from the Woocommerce product loop. For this we can use following code snippet.

//Remove add to cart button from the product loop
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');

We have successfully removed Add to cart button from the product archives. Now we need to add read more link to each product. For this we will use following code snippet.

//Add read more button in product loop
function add_read_more_button_product_loop() {
    echo '<a class="button" href="'.get_permalink().'">'.__('Read more','woocommerce').'</a>';
}
add_action( 'woocommerce_after_shop_loop_item', 'add_read_more_button_product_loop', 20 );
Need Professional Support for Your Website Problems?

Whether you're facing website issues or struggling with code implementation, our team is here to assist. Hire us to get your website back on track.

Hire Us