Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter webkater

    (@webkater)

    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

    Hallo!

    Ich habe die Checkout Seite mir selbst angepasst. Mein Tipp, unbedingt Child-Theme anlegen, dann dort einen Unterordner /woocommerce/checkout/ machen. Dort hinein die PHP Datei aus WordPress review-order.php kopieren. Darin kann man dann selbst die n?tigen ?nderungen vornehmen.

    Ich habe den deutschen Text dort fest rein codiert und auch was sehr wichtig ist, den Endbetrag direkt neben den Kaufbutton noch Mal platziert.

    Screenshot

    Ewald

    Hello Dave! Hello Mathi!

    Please can you explain in detail how to mangage this problem to get the German shop with “Widerrufserkl?rung”.

    I was trying to do some adaption in the .po file of Dave with the plugin “CodeStyling Localization” but I couldn’t find out how to manage it. I am quite sure, that I started wrong.

    For fully custom string there, you could use my plugin plus this snippet (the first 2 actually):
    https://gist.github.com/deckerweb/5098515

    Sorry for asking stupid. But I have no idea what to do with the “wcde-helfer-funktionen.php”.

    I would be very interested to learn from you.

    webkater

    Hi Mathi!

    I work with the “hardcore-workarround” by overwriting the review-order.php for a long time in several shops. No problems with this. You have only to keep in mind, that a update of woocommerce and/or theme may put your changed file into nirwana and you have to redo it.

    I live with it, because up to now I couldn’t find any “clean” solution.

    I added:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    <p class=”form-row terms”>

    <input type=”checkbox” class=”input-checkbox” name=”terms” <?php checked( isset( $_POST[‘terms’] ), true ); ?> id=”terms” />

    <label for=”terms” class=”checkbox”>Ich akzeptiere Ihre ” target=”_blank”><?php _e( ‘terms & conditions’, ‘woocommerce’ ); ?>          </label>

    </br>Den Hinweis zu meinem Widerrufsrecht habe ich verstanden.

    </p>

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    As for my understanding from legal issuse the total price is to far away from the [KAUFEN] button, I repeatd the total amount after this section.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    <p class=”clear”></p>
    <b><?php _e( ‘Order Total’, ‘woocommerce’ ); ?></b>
    <?php wc_cart_totals_order_total_html(); ?>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Hopefully our god of German woocommerce Dave will manage and solve this it in the future clean! ??

    Thread Starter webkater

    (@webkater)

    Hello Dave!

    Thank you very much for the quick reaction and help! It works again! Great job!

    Best regards!

    webkater!

    Thread Starter webkater

    (@webkater)

    Hello!

    Forgot to put the version in my thread:

    My woocommerce version is 2.0.20 and the version of the plugin is 3.1.2

    webkater

    Hello! – Same for me!

    ??

    After installing the new version, there is no way to check again the option for all emails. As written from philliproth when you are going to save the email notification option for any email, so new order, payment received etc. after clicking on “SAVE” it always unchecks the option.

    I reinstalled a backup version on a testing domain and could verify after updating this plugin, this happens. When deactivating the plugin, all is fine!

    webkater

    PS: My woocommerce version is 2.0.20 and the version of the plugin is 3.1.2

Viewing 7 replies - 1 through 7 (of 7 total)