Tagged: x
-
AuthorPosts
-
March 16, 2017 at 5:10 am #1409373
Hi X,
I have two questions:
1. How do I remove the second ‘read more’ button in the category pages (https://www.tentusscher.nl/webshop/) You see one when hovering and one beneath. The one beneath needs to be removed.
2. How do I change the text of only the read more button when hovering the product?Thanks!
March 16, 2017 at 8:59 am #1409585Hi,
1. Add this in Custom > Edit Global CSS in the customizer
.archive li.product > .button.product_type_simple.ajax_add_to_cart { display:none; }
2. Add this in your child theme’s functions.php
add_filter( 'woocommerce_product_add_to_cart_text', 'woo_archive_custom_cart_button_text' ); // 2.1 + function woo_archive_custom_cart_button_text() { return __( 'My Button Text', 'woocommerce' ); }
Hope that helps.
March 16, 2017 at 9:04 am #1409595Hi Paul,
Number 1 works fine.
Number 2 also changes the normal ‘ad to cart’ text..Any idea?
Thanks
March 16, 2017 at 9:11 am #1409610Also a suggestion,
Is it possible to change all the hover buttons with the same function. The function should be the same as the one which are out of stock (just a link to the product).
So with above code we have changed the text for all buttons, which is fine. But can we also link them all to the single product page (instead of add to cart)?
Thanks!
March 16, 2017 at 4:33 pm #1410185Hi there,
Please check this doc, https://docs.woocommerce.com/document/change-add-to-cart-button-text/
Please try the last code with every text for every button type.
I checked it and it’s already linking to the product, and I think it’s Woocommerce setting that you could change.
Thanks!
March 23, 2017 at 4:36 am #1417394Hi Rad,
I am almost there. I have added this code to get a ‘view product’ button everywhere that opens the single product.
// Change the add to cart button INTO View Product button // ================================================================================================================= add_filter( 'woocommerce_loop_add_to_cart_link', 'add_product_link' ); function add_product_link( $link ) { global $product; echo '<a href="'.$product->get_permalink( $product->id ).'" class="button">' . __('View Product', 'woocommerce') . '</a>'; }
Everything fine, except the css we used before to hide the second ‘view product’ in the category archives is back again.
.archive li.product > .button.product_type_simple.ajax_add_to_cart { display:none; }
I have tried the important tag but this does not help. Any suggestion?
https://www.tentusscher.nl/product-categorie/webshop/
Thanks so far:)
Cheers!
March 23, 2017 at 4:48 am #1417405Hi Rad,
I have written this css and it works:
.woocommerce ul.products .button { display:none; }
Not entirely sure if this is the best way though:)
March 23, 2017 at 6:12 am #1417475Hi there,
There are no hard & fast rules. You can use a solution that fits your need.
Thanks!
-
AuthorPosts