• Resolved skhalaf09

    (@skhalaf09)


    Hello,
    I am trying to change the “proceed to checkout” text in the WooCommerce blocs – Cart page. The page editor does not seem to allow that. Any hints on how I can change this text? any hooks or filters that can help? This text must be located somewhere I guess.

    Sam

Viewing 4 replies - 16 through 19 (of 19 total)
  • Dude, here is a snippet I use…

    /*Proceed to Checkout*/
    
    remove_action( 'woocommerce_proceed_to_checkout', 'woocommerce_button_proceed_to_checkout', 20 ); 
    add_action('woocommerce_proceed_to_checkout', 'sm_woo_custom_checkout_button_text',20);
    
    function sm_woo_custom_checkout_button_text() {
        $checkout_url = WC()->cart->get_checkout_url();
      ?>
           <a href="<?php echo $checkout_url; ?>" class="checkout-button button alt wc-forward"><?php  _e( 'Go to Secure Checkout', 'woocommerce' ); ?></a> 
      <?php
    } 

    Obviously change the ‘Go to Secure Checkout’ to something of your liking…

    Thread Starter skhalaf09

    (@skhalaf09)

    Thanks @alcatrazhorizon

    So I assume the code above should now render the checkout button as “Go to Secure Checkout” right? I added the code to my snippets, it is active, but the button still renders as “proceed to checkout”.. again, I am using Woocommerce blocks (cart block), not the typical Woocommerce cart page/shortcode.

    Sam

    Hi @skhalaf09,

    I am not sure this will work as it appears to be the pHP code that is used for the standard checkout button/proceed to checkout that is traditional to Core WooCommerce. As @nerrad mentioned this cannot be changed with any filters really through PHP without considerable difficulty since it is rendered via JavaScript. For this I would consult with a developer on the site via the following areas:

    WooCommerce Slack Community: https://woocommerce.com/community-slack/
    Advanced WooCommerce group on Facebook: https://www.facebook.com/groups/advanced.woocommerce/

    I hope this helps! We are definitely aware of the issue (as noted by @nerrad) and will hopefully have something in the future allowing this to be done ?? If you have further questions or concerns about the Blocks let us know.

    Hi @skhalaf09,

    I will go ahead and close this thread for now, however if you are continuing to have this particular issue let us know in a reply and it will re-open this thread.

    If you are having issues other than this, please open a new thread and let us know.

    Have a super day!

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘WooCommerce Blocks – Cart button text’ is closed to new replies.