Replace “Buy now” button with “View More”
-
Hello,
I have an eshop in Catalog mode and i have de activated the Buy Now buttons.
How can i still have the button and replace it with “View More” text and by clicking to open the product?
Thank you
Hello,
Try to add the following PHP code snippet to the child theme in the functions.php file.
add_action('woocommerce_after_shop_loop_item', 'add_a_custom_button', 5 );
function add_a_custom_button() {
global $product;
if( $product->is_type('variable') || $product->is_type('grouped') ) return;
echo '<div style="margin-bottom:10px;">
<a class="button custom-button" href="' . esc_attr( $product->get_permalink() ) . '">' . __('View More') . '</a>
</div>';
}
Best Regards.
Thank you for your reply, it works fine!
Sounds Great! that your issue has been solved.
I’m so happy to hear you are pleased with the Theme and Support. XTEMOS strives to deliver the best customer experience, and it makes our day to hear we have accomplished that.
We count ourselves lucky to have you as a customer. You can always reach us at any time. We are always here to help you.
Thanks for contacting us.
Have a great day.
Topic Closed.
Best Regards.
The topic ‘Replace “Buy now” button with “View More”’ is closed to new replies.