Home Forums WoodMart support forum Replace “Buy now” button with “View More”

Replace “Buy now” button with “View More”

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #581706

    infiniteweb00
    Participant

    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

    #581757

    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.

    #581957

    infiniteweb00
    Participant

    Thank you for your reply, it works fine!

    #582061

    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.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Replace “Buy now” button with “View More”’ is closed to new replies.