• I am looking for ways to add ‘Stripe’ ‘buy now’ button to my ‘Single Product’ page, but unfortunately, I am not a programmer. I will be grateful if anyone can help me out.

    Thank you.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • you can do this specifically with the product id. add this below code to your functions.php file after <?php tag:

    add_filter( 'woocommerce_product_add_to_cart_text', 'custom_loop_add_to_cart_button', 20, 2 ); 
    function custom_loop_add_to_cart_button( $button_text, $product ) {
        // HERE define your specific product IDs in this array
        $specific_ids = array(37, 40, 53);
    
        if( in_array($product->get_id(), $specific_ids) ) {
            $button_text = __("add to cart", "woocommerce");
        } else {
            $button_text = __('Buy Now', 'woocommerce');
        }
        return $button_text;
    }

    here $specific_ids numbers you have to change for your targeted product id.

    hope you will resolve that issue.
    thanks.

Viewing 1 replies (of 1 total)
  • The topic ‘How can I add ‘buy now’ button to this page?’ is closed to new replies.