Archived topic
Customise Woocommerce Product Archive Button.
11 replies · Started by _blank on June 15, 2020
Hi There,
On the WooCommerce product archive pages is there a way to change the Button text “Select Options” “Read more” & “Add to Basket” for all archives.
We would like them all to say to “View”
Many Thanks
Scott
Hi there,
try the woocommerce_product_add_to_cart_text filter eg
add_filter( 'woocommerce_product_add_to_cart_text', 'db_woo_shop_add_to_cart_text' );
function db_woo_shop_add_to_cart_text() {
return __( 'View', 'generatepress' );
}
Hi David,
Would that be a PHP snippet?
Thanks
Scott
Oops sorry - yes thats correct
Cool thanks, it's working.
Is it possible to control the bottom border length to match the text length. I'm currently using:
/* Woocommerce Product Archive Button */
.elementor-wc-products ul.products li.product .button {
border-color: #D15919;
background-color: #ffffff;
font-size: 16px;
color: #4a4a4a;
font-weight: 100;
border-style: solid;
border-width: 0px 0px 1px 0px;
margin-top: 0px;
}
Thanks
Scott
I wonder if we could just reduce the padding on the button:
.woocommerce a.button {
padding: 10px 5px;
}
Hi Leo,
That did the trick. Thanks
Scott
No problem :)
Hi Leo,
Sorry to re open this.
The CSS
.woocommerce a.button {
padding: 10px 5px;
}
Had an effect on other woo buttoms which don't have the underline style.
I've removed the CSS for now, here's the style with underline.
https://jennifermanners.mackienorthclients.co.uk/product-category/all-rugs/
Please see screengrab here for standard buttons.
https://jennifermanners.mackienorthclients.co.uk/wp-content/uploads/2020/06/Screenshot-2020-06-17-at-16.41.46.png
Thanks
Scott
Can you try this instead?
.archive.woocommerce a.button {
padding: 10px 5px;
}
Hi Leo,
That worked and the other buttons are unaffected.
Many Thanks
Scott
No problem :)