S
S
ShifterOD2016-01-27 15:53:17
WordPress
ShifterOD, 2016-01-27 15:53:17

Woocommerce How to change the text of the added_to_cart button?

after clicking on the "add to cart" button, the "go to cart" button appears (if woocommerce is translated into Russian), the class of this button is ".added_to_cart .wc-forward" so I would like to change it normally ....

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nick Toot, 2019-02-20
@NickToot

For more than 3 years, no one has answered, somehow sad .. Faced the same task, searched for a long time, as it turned out this button is inserted from a js file, and a variable with translation is substituted there, I found an example on the Internet how to use filter you can override this translation:

/**
 * Изменение текста на кнопке "Перейти в корзину"
 */
add_filter( 'woocommerce_get_script_data', 'change_view_cart', 10, 2 );
function change_view_cart( $params, $handle ) {
  if ( $handle == 'wc-add-to-cart' ) {
    $params['i18n_view_cart'] = "Оформить заказ";
  }
  
  return $params;
}

V
Vladimir Kulikov, 2022-02-04
@it_proger29

Scroll down and look woo triggers wordpressinside.ru/woocommerce/shop-javascript-events
It will definitely come in handy for you, maybe it will help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question