Cart widget translation - by Mike1986 - on WordPress WooCommerce support

This topic has 12 replies, 3 voices, and was last updated 8 years, 3 months ago ago by Robert Hall

  • Avatar: Mike1986
    Mike1986
    Participant
    September 19, 2016 at 14:41

    Hi!

    I would like to translate the “shopping cart” text in the cart widget in the menu. How can I do that?

    Everything else I was able to translate with PoEdit but shopping cart text in the cart widget doesn’t change.

    Thanks in advance!

    11 Answers
    Avatar: Robert Hall
    Robert Hall
    Support staff
    September 19, 2016 at 15:26

    Hello,

    Please provide us with wp-admin and FTP credentials in Private Content.

    Also you can find this text in the \idstore\wp-content\themes\idstore\code\woo.php file on line 148

    Regards,
    Robert Hall

    Avatar: Mike1986
    Mike1986
    Participant
    September 19, 2016 at 15:52

    Thanks! I was able to change it myself 🙂 But after I update the theme do I have to do the change again?

    Should the cart widget say something other than “shopping cart -“? Should there be a total sum of the cart for example?

    Please, contact administrator
    for this information.
    Avatar: Robert Hall
    Robert Hall
    Support staff
    September 19, 2016 at 16:15

    In this case you need add the whole function into the function.php file of the Child Theme and change the ‘Shopping Cart – ‘ text like you need

    	function et_cart_total() {
            global $woocommerce;
    		?>
    			<div class="shop-text"><span class="total"><?php _e( 'Shopping Cart - ', ETHEME_DOMAIN ); echo $woocommerce->cart->get_cart_subtotal(); ?></span></div>
    		<?php
    	}

    Regards,
    Robert Hall

    Avatar: Mike1986
    Mike1986
    Participant
    September 19, 2016 at 16:42

    I created a child theme and when I tried to activate it I got the following error message:

    Parse error: syntax error, unexpected ‘}’ in /home/u39539/public_html/wp-content/themes/idstore-child/functions.php on line 11

    style.css in the child theme folder looks like this:
    /*

    Theme Name: IDStore – Responsive WordPress Theme
    Theme URI: https://www.8theme.com/
    Author: 8theme
    Author URI: http://themeforest.net/user/8theme
    Template: idstore
    Description: ThemeForest Premium Theme
    Version: 4.1.1
    Text Domain: idstore
    License: GNU General Public License version 3.0
    License URI: http://www.gnu.org/licenses/gpl-3.0.html

    */

    And functions.php in the child theme folder looks like this:

    add_action( ‘wp_enqueue_scripts’, ‘enqueue_parent_styles’ );

    function enqueue_parent_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri().’/style.css’ );
    }
    function et_cart_total() {
    global $woocommerce;
    ?>
    <div class=”shop-text”><span class=”total”><?php _e( ‘Shopping Cart – ‘, ETHEME_DOMAIN ); echo $woocommerce->cart->get_cart_subtotal(); ?></span></div>
    <?php
    }

    What did I do wrong?

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    September 19, 2016 at 16:48

    Hello,

    You forgot to add <?php in the beginning of the file.
    I’ve corrected it.
    Please check now.

    Best regards,
    Jack Richardson.

    Avatar: Mike1986
    Mike1986
    Participant
    September 19, 2016 at 16:58

    Thanks for fixing the child theme!

    http://imgur.com/a/dqyB6

    The cart widget doesn’t show the total sum of the cart like it should (I have added products to the cart). Also now in the menu there seems to be some weird white square :/ Any idea how to fix these too? 🙂

    Avatar: Robert Hall
    Robert Hall
    Support staff
    September 19, 2016 at 17:05

    I’ve added this code in style.css of the Child Theme. Please check it.

    #top-cart .amount {
        color: black;
    }
    .header-area {
        background: #fafafa !important;
    }

    Regards,
    Robert Hall

    Avatar: Mike1986
    Mike1986
    Participant
    September 19, 2016 at 17:16

    Thanks a lot!

    What if I want to change the shopping cart text and the amount of the cart to white? Like you have in the demo.

    Avatar: Robert Hall
    Robert Hall
    Support staff
    September 19, 2016 at 17:20

    I’ve changed the CSS code in the Child Theme. Please check it.

    Regards,
    Robert Hall

    Avatar: Mike1986
    Mike1986
    Participant
    September 19, 2016 at 17:45

    Thanks!!! 🙂

    Avatar: Robert Hall
    Robert Hall
    Support staff
    September 19, 2016 at 17:57

    You’re welcome!

    Regards,
    Robert Hall

  • Viewing 12 results - 1 through 12 (of 12 total)

The issue related to '‘Cart widget translation’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.