Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

How to show 'Read More' link instead of the 'Add to Cart' link?

I am helping a new client to created there current Static HTML e-commerce site into a dynamic Wordpress E-commerce using Woo commerce.

In the shop pages displaying all products, it shows for each product: a thumbnail image the product name the price and a link to add the product to the cart

I would like to change the 'Add to Cart' link to a read more link instead. I have noticed that if you do not include a price this happens however i need to include prices for obvious reasons.

Can anyone help? or offer any advice?

Cheers Brett

3 Answers

Matt Campbell
Matt Campbell
9,767 Points

Why do you want it to say read more when the link follows to the cart? It'll make no sense.

Either way, you'll need to get into the woocommerce files, single-product.php I think, and change the add to cart to read more. I'm not 100% that's the file. Be prepared to spend 90% of your time finding the code you want to change in woocommerce. Everything is in its own template.

Hi Matthew,

I dont just want to change the text of the link. Thats a simple job!

What i want to do is change the 'Add to Cart' button to be a 'Read More' button so that the button takes you to the products details page.

Cheers Brett

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

I believe you would use the apply_filters( 'add_to_cart_text', __( 'Add to cart', 'woocommerce' ) ); filer.

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Brett Anthony were you able to work out the Add to Cart link?