In WooCommerce, in my Storefront child theme, I edited the code in proceed-to-checkout-button.php
to change the wording from "Proceed to checkout" to "Checkout":
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<a href="<?php echo esc_url( wc_get_checkout_url() ); ?>" class="checkout-button button wc-forward">
<?php esc_html_e( 'Checkout', 'woocommerce' ); ?>
</a>
But when the user changes product quantity in the cart page, then the button text goes back to default "Proceed to checkout".
Is there a filter or where to edit this updated text?
EDIT – Problem Solved
The issue was related to a specific cart option in WooCommerce Better Usability pro plugin where the option "Display text while updating cart automatically" requires to be disabled (unselected).
2
Answers
This file proceed-to-checkout-button.php is calling from the function woocommerce_button_proceed_to_checkout() hooked to action ‘woocommerce_proceed_to_checkout’ – you can find it in woocommerce/includes/wc-template-hooks.php
So, You can override the function woocommerce_button_proceed_to_checkout() – just add this to your functions.php
I’m guessing that maybe the ajax button’s update comes from the parent theme.
Instead of overriding
proceed-to-checkout-button.php
file, should use the following instead:Code goes in functions.php file of your active child theme (or active theme). Tested and works on last WooCommerce version under Storefront theme.