I am using the code below to replace add to cart button with a linked button to the product in Shop, related products and archives pages only
add_action( 'woocommerce_after_shop_loop_item', 'shop_view_product_button', 10);
function shop_view_product_button() {
global $product;
$link = $product->get_permalink();
echo '<a href="' . $link . '" class="button addtocartbutton">View Product</a>';
}
But I need to change the add to cart button text on the single product page to "Apply".
Any help?