Hi Christian,
I am not sure it it can work when there is a file “wcde-custom-string-swap-cart-total.php”
I solved it like this:
1) I have a file with the name function.php in my child-theme. Therefore, there is a directory: “yourdomain.xyz/wordpress/wp-content/themes/child-theme/”. In this directory you put the function.php file. This make sure the php-code in it will be called. In this funtion.php there must be mimimum the following
<?php
?>
2) In this file function.php you add between the <?php
and the ?>
the code from David
gist.github.com/deckerweb/9134266
add_action( 'get_header', 'wcde_custom_string_swap_cart_subtotal', 99 );
/**
* String swap for "Cart Subtotal:"/ "Cart Subtotal" string in WooCommerce.
*
* NOTE: This snippet relies on active "WooCommerce German (de_DE)" plugin,
* version 3.1.0 or higher!
*
* @author David Decker - DECKERWEB
* @link https://deckerweb.de/twitter
* @link https://gist.github.com/deckerweb/9134266
*
* @uses wcde_is_german() To determine if in German-locale based environment.
* @uses ddw_wcde_custom_strings_via_l10n_global() WCDE helper function for doing the string swap.
*/
function wcde_custom_string_swap_cart_subtotal() {
/** Bail early if no WCDE, and no German-based enviroment */
if ( ! function_exists( 'ddw_wcde_custom_strings_via_l10n_global' )
&& ! wcde_is_german()
) {
return;
} // end if
/**
* Helper filter, allows for custom disabling of string swaps.
*
* Usage: add_filter( 'wcde_filter_do_string_swaps', '__return_false' );
*/
$wcde_do_string_swaps = (bool) apply_filters( 'wcde_filter_do_string_swaps', '__return_true' );
/**
* Bail early if our helper filter returns false.
*/
if ( ! $wcde_do_string_swaps ) {
return;
} // end if
/** Set up our array of planned string swap keys/ strings */
$wcde_labels = array(
/** Variant 1: "Cart Subtotal:" */
'cart_subtotal_string_one' => array(
'option_key' => 'cart_subtotal_string_one',
'strings' => array( 'Cart Subtotal:' ),
'translation' => 'Zwischensumme:',
),
/** Variant 2: "Cart Subtotal" */
'cart_subtotal_string_two' => array(
'option_key' => 'cart_subtotal_string_two',
'strings' => array( 'Cart Subtotal' ),
'translation' => 'Zwischensumme',
),
); // end of array
/** Apply our string swapper for each string or our array */
foreach ( $wcde_labels as $wcde_label => $label_id ) {
/** Actually load the various new label strings for display */
ddw_wcde_custom_strings_via_l10n_global(
$label_id[ 'option_key' ],
(array) $label_id[ 'strings' ],
$label_id[ 'translation' ],
'woocommerce'
);
} // end foreach
} // end function
But keep in mind I could solve my problem with this only for the basket-page not for the checkout page.
Please report if it works for you and on which pages.
And any help from anybody is more than welcome to find out, why it doesn’twork in the checkout-page!
Ewald