Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Nov 2011
    Location
    Harrogate, UK
    Posts
    16
    Plugin Contributions
    0

    cart error now in your cart in another language (tpl_header.php)

    Hi there, can anyone help me with this:
    I've installed my zen cart in 2 languages and I want the message 'now in your cart' to be in italian for the italian version of the site.
    I've followed this thread
    http://www.zen-cart.com/forum/showthread.php?t=129945
    and now the text is gone from the template.
    This text is in the file tpl_header.php and there is no the Italian version of this one. Can anyone tell me how to move this text in the header.php (english and italian) and create the variable in tpl_header.php?
    I don't know if that makes sense....
    Also, this template is from templatemonster and it seems impossible to change header and footer. I've contacted them via chat and they say that it is 'hard-coded' can anyone tell me if you have any idea of how to go about this. I'd be very grateful!

  2. #2
    Join Date
    Nov 2011
    Location
    Harrogate, UK
    Posts
    16
    Plugin Contributions
    0

    Default Re: now in your cart in another language (tpl_header.php)

    Hi Niccol, I'm writing to you because I was following a thread which is now closed where you were offering some help awhile ago: http://www.zen-cart.com/forum/showthread.php?t=129945
    I am having the same problem as that french guy, I just can't figure out what he did to solve it, because he is very vague in the explanation.
    I've tried to get in touch with him, but he seems inactive since last February.
    I am using a purchased template and the text "now in your cart" doesn't translate when I go to the italian version. I found that text with the developer tool kit and it is in the tpl_header.php file.
    in this file there is no HEADER_TITLE_CART_CONTENTS but only the text "now in your cart" .
    It seems that it does not use a variable.
    can you try to help me pleeeeease?
    Cinzia

    niccol
    Re: now in your cart text

    Where it says 'now in your cart' replace it with '<?php echo HEADER_TITLE_CART_CONTENTS; ?>

    Then in includes/languages/english/header.php set that variable to whatever you want it to say in English. And the same for any other language.

    Hi niccol,
    thanks for your reply! I've tried what you suggested, but strangely enough in my header.php there is already a variable called HEADER_TITLE_CART_CONTENTS
    when I change it to what I want it to say nothing happens.

    This is my header.php

    PHP Code:
    <?php 
    /** 
     * @package languageDefines 
     * @copyright Copyright 2003-2006 Zen Cart Development Team 
     * @copyright Portions Copyright 2003 osCommerce 
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 
     * @version $Id: header.php 2940 2006-02-02 04:29:05Z drbyte $ 
     */ 

    // header text in includes/header.php 
      
    define('HEADER_TITLE_CREATE_ACCOUNT''Create Account'); 
      
    define('HEADER_TITLE_MY_ACCOUNT''My Account'); 
      
    define('HEADER_TITLE_CART_CONTENTS''Shopping Cart'); 
      
    define('HEADER_TITLE_CHECKOUT''Checkout'); 
      
    define('HEADER_TITLE_TOP''Top'); 
      
    define('HEADER_TITLE_CATALOG''Home'); 
      
    define('HEADER_TITLE_LOGOFF''Log Out'); 
      
    define('HEADER_TITLE_LOGIN''Log In'); 

    // added defines for header alt and text 
      
    define('HEADER_ALT_TEXT'''); 
      
    define('HEADER_SALES_TEXT'''); 
      
    define('HEADER_LOGO_WIDTH''192px'); 
      
    define('HEADER_LOGO_HEIGHT''64px'); 
      
    define('HEADER_LOGO_IMAGE''logo.gif'); 

    // header Search Button/Box Search Button 
      
    define('HEADER_SEARCH_BUTTON','Search'); 
      
    define('HEADER_SEARCH_DEFAULT_TEXT''Enter search keywords here'); 

    ?>
    This is my tpl_header

    PHP Code:
    <!-- ========== SHOPPING CART ========== --> 
                                <?php  
                                    
    if ($_SESSION['cart']->count_contents() == 1) { 
                                        
    $cart_text '<span class="cart1">Ora nel tuo carrello ci sono </span><a href="' zen_href_link(FILENAME_SHOPPING_CART'''NONSSL') . '">' $_SESSION['cart']->count_contents() . ' articoli</a>'
                                    } else { 
                                        
    $cart_text '<span class="cart1">Ora nel tuo carrello ci sono </span><a href="' zen_href_link(FILENAME_SHOPPING_CART'''NONSSL') . '">' $_SESSION['cart']->count_contents() . ' articoli</a>'
                                    } 
                                
    ?> 
                                <?php echo $cart_text ?>  
                            <!-- =================================== -->
    This is my site
    http://www.emporiosposa.com
    Any idea?
    Thanks for your help

  3. #3
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: now in your cart in another language (tpl_header.php)

    The 'now in you cart' is not part of the basic zen set-up here.

    You'll need to create a new variable for this text.

    So first in header.php you need to change 'Ora nel tuo carrello ci sono' to something like <?php echo HEADER_NOW_IN_CART; ?>

    Then you need to define that. Actually it is best to do it in its own file but you can just add it below the other defines in the existing files, for all three languages.

    Code:
    // header text in includes/header.php  
      define('HEADER_TITLE_CREATE_ACCOUNT', 'Create Account');  
      define('HEADER_TITLE_MY_ACCOUNT', 'My Account');  
      define('HEADER_TITLE_CART_CONTENTS', 'Shopping Cart');  
      define('HEADER_TITLE_CHECKOUT', 'Checkout');  
      define('HEADER_TITLE_TOP', 'Top');  
      define('HEADER_TITLE_CATALOG', 'Home');  
      define('HEADER_TITLE_LOGOFF', 'Log Out');  
      define('HEADER_TITLE_LOGIN', 'Log In'); 
      define('HEADER_NOW_IN_CART', 'Now in your cart');

  4. #4
    Join Date
    Nov 2011
    Location
    Harrogate, UK
    Posts
    16
    Plugin Contributions
    0

    Default Re: now in your cart in another language (tpl_header.php)

    Hi niccol,
    I've followed your instructions to the letter but now the text does not appear at all http://www.emporiosposa.com/

    This is my complete tpl_header
    PHP Code:
    <?php
    /**
     * Common Template - tpl_header.php
     *
     * this file can be copied to /templates/your_template_dir/pagename<br />
     * example: to override the privacy page<br />
     * make a directory /templates/my_template/privacy<br />
     * copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_header.php<br />
     * to override the global settings and turn off the footer un-comment the following line:<br />
     * <br />
     * $flag_disable_header = true;<br />
     *
     * @package templateSystem
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: tpl_header.php 4813 2006-10-23 02:13:53Z drbyte $
     */
    ?>
    <?php

        
      
    // Display all header alerts via messageStack:
      
    if ($messageStack->size('header') > 0) {
        echo 
    $messageStack->output('header');
      }
      if (isset(
    $_GET['error_message']) && zen_not_null($_GET['error_message'])) {
      echo 
    htmlspecialchars(urldecode($_GET['error_message']));
      }
      if (isset(
    $_GET['info_message']) && zen_not_null($_GET['info_message'])) {
       echo 
    htmlspecialchars($_GET['info_message']);
    } else {

    }
    ?>


    <?php
    if (!isset($flag_disable_header) || !$flag_disable_header) {
    ?>

    <div id="header">
        <div class="extra-wrapp alt">
            <div class="wrapp">
                <div class="main-width">
                    <div class="wrapper">
                        <div class="currencies">
                            <!-- ========== CURRENCIES ========= -->
                                <?php echo zen_draw_form('currencies'zen_href_link(basename(ereg_replace('.php',''$PHP_SELF)), ''$request_typefalse), 'get'); ?>
                                    <div>
                                        <span class="label"><?php echo BOX_HEADING_CURRENCIES;?>: &nbsp;</span>
                                        <?php
                                            
    if (isset($currencies) && is_object($currencies)) {
                                        
                                              
    reset($currencies->currencies);
                                              
    $currencies_array = array();
                                              while (list(
    $key$value) = each($currencies->currencies)) {
                                                
    $currencies_array[] = array('id' => $key'text' => $value['title']);
                                              }
                                        
                                              
    $hidden_get_variables '';
                                              
    reset($_GET);
                                              while (list(
    $key$value) = each($_GET)) {
                                                if ( (
    $key != 'currency') && ($key != zen_session_name()) && ($key != 'x') && ($key != 'y') ) {
                                                  
    $hidden_get_variables .= zen_draw_hidden_field($key$value);
                                                }
                                              }
                                            }
                                        
    ?>
                                        <?php echo zen_draw_pull_down_menu('currency'$currencies_array$_SESSION['currency'], 'class="select" onchange="this.form.submit();"') . $hidden_get_variables zen_hide_session_id()?>
                                    </div>
                                </form>
                            <!-- ====================================== -->
                        </div>
                        <div class="lang">
                            <!-- ========== LANGUAGES ========== -->            
                                <?php 
                                    
    if (!isset($lng) || (isset($lng) && !is_object($lng))) {
                                        
    $lng = new language;
                                    }
                                
                                    
    reset($lng->catalog_languages);
                                
                                    while (list(
    $key$value) = each($lng->catalog_languages)) {
                                        echo 
    '<a href="' zen_href_link($_GET['main_page'], zen_get_all_get_params(array('language''currency')) . 'language=' $key$request_type) . '">' zen_image(DIR_WS_LANGUAGES.$value['directory'].'/images/'.$value['image'], $value['name'], ''''' style="vertical-align:middle;"') . '</a>';
                                    }
                                
    ?>
                            <!-- =============================== -->
                        </div>
                        <div class="navigation">
                            <!-- ========== NAVIGATION LINKS ========== -->                                
                                <?php if ($_SESSION['customer_id']) { ?>
                                    <a href="<?php echo zen_href_link(FILENAME_LOGOFF'''SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF?></a>
                                    <a href="<?php echo zen_href_link(FILENAME_ACCOUNT'''SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT?></a> 
                                <?php
                                      
    } else {
                                        if (
    STORE_STATUS == '0') {
                                
    ?>
                                    <a href="<?php echo zen_href_link(FILENAME_LOGIN'''SSL'); ?>"><?php echo HEADER_TITLE_LOGIN?></a>  
                                <?php } } ?>  
                                
                                <?php if ($_SESSION['cart']->count_contents() != 0) { ?>
                                    <a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART'''NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS?></a>
                                    <a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING'''SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT?></a>
                                <?php ?>
                            <!-- ====================================== -->
                        </div>
                    </div>
                    <div class="wrapper box2">
                        <div class="search">
                            <!-- ========== SEARCH ========== -->
                                <?php echo zen_draw_form('quick_find_header'zen_href_link(FILENAME_ADVANCED_SEARCH_RESULT'''NONSSL'false), 'get');?>
                                    <div>
                                <?php 
                                    
    echo zen_draw_hidden_field('main_page',FILENAME_ADVANCED_SEARCH_RESULT);
                                    echo 
    zen_draw_hidden_field('search_in_description''1') . zen_hide_session_id();
                                
    ?>
                                <?php echo zen_draw_input_field('keyword''''class="input1"');?>
                                <?php echo zen_image_submit ('search.png'HEADER_SEARCH_BUTTON'class="input2" ');?>
                                    </div>
                                </form>
                            <!-- ============================ -->
                        </div>
                        <div class="logo">
                            <!-- ========== LOGO ========== -->
                                <a href="<?php echo zen_href_link(FILENAME_DEFAULT);?>"><?php echo zen_image(DIR_WS_TEMPLATE.'images/logo.png'); ?></a>
                            <!-- ========================== -->
                        </div>
                        <div class="cart">
                            <!-- ========== SHOPPING CART ========== -->
                                <?php 
                                    
    if ($_SESSION['cart']->count_contents() == 1) {
                                        
    $cart_text '<span class="cart1"><?php echo HEADER_NOW_IN_CART; ?></span><a href="' zen_href_link(FILENAME_SHOPPING_CART'''NONSSL') . '">' $_SESSION['cart']->count_contents() . ' articoli</a>';
                                    } else {
                                        
    $cart_text '<span class="cart1"><?php echo HEADER_NOW_IN_CART; ?></span><a href="' zen_href_link(FILENAME_SHOPPING_CART'''NONSSL') . '">' $_SESSION['cart']->count_contents() . ' articoli</a>';
                                    }
                                
    ?>
                                <?php echo $cart_text ?> 
                            <!-- =================================== -->
                        </div>
                    </div>
                </div>     
            </div>  
        </div>
        <div class="wrapp">
                <div class="main-width">
                    <div class="wrapper box3">
                        <!-- ========== MENU ========== -->
                            <div class="menu">
                                <?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE$_SERVER['REMOTE_ADDR'])))) { ?>
                                    <?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?>
                                <?php ?>
                            </div>
                        <!-- ========================== -->
                    </div>
                </div>
            </div>
        </div>
    <div class="main-width">
    <!-- ========== CATEGORIES TABS ========= -->
        <?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?>
    <!-- ==================================== -->
    </div>
         
        
           


        <?php 
            
    if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner zen_banner_exists('dynamic'SHOW_BANNERS_GROUP_SET2))) {
                if (
    HEADER_SALES_TEXT != '') {
        
    ?>
                    <div id="tagline"><?php echo HEADER_SALES_TEXT;?></div>
        <?php
                
    }
            }
        
    ?>
       





                    
        
    <?php ?>
    Is there any other file to edit at all?or a string to add somewhere else in the same files? thanks
    Cinzia

  5. #5
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: now in your cart in another language (tpl_header.php)

    So, how did you change it to read 'articuli' now?

  6. #6
    Join Date
    Nov 2011
    Location
    Harrogate, UK
    Posts
    16
    Plugin Contributions
    0

    Default Re: now in your cart in another language (tpl_header.php)

    I did not touch the 'articoli' bit at all. In fact I was wandering (in case your strategy worked) how could I on and have the 'articoli' in three languages? I guess I needed to define another variable but how?

  7. #7
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: now in your cart in another language (tpl_header.php)

    Ooops

    You need to change:

    Code:
                            <!-- ========== SHOPPING CART ========== --> 
                                <?php  
                                    if ($_SESSION['cart']->count_contents() == 1) { 
                                        $cart_text = '<span class="cart1"><?php echo HEADER_NOW_IN_CART; ?></span><a href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL') . '">' . $_SESSION['cart']->count_contents() . ' articoli</a>'; 
                                    } else { 
                                        $cart_text = '<span class="cart1"><?php echo HEADER_NOW_IN_CART; ?></span><a href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL') . '">' . $_SESSION['cart']->count_contents() . ' articoli</a>'; 
                                    } 
                                ?> 
                                <?php echo $cart_text ?>  
                            <!-- =================================== -->
    to

    Code:
                            <!-- ========== SHOPPING CART ========== --> 
                                <?php  
                                    if ($_SESSION['cart']->count_contents() == 1) { 
                                        $cart_text = '<span class="cart1">'. HEADER_NOW_IN_CART.'</span><a href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL') . '">' . $_SESSION['cart']->count_contents() . ' articoli</a>'; 
                                    } else { 
                                        $cart_text = '<span class="cart1">'.  HEADER_NOW_IN_CART.'</span><a href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL') . '">' . $_SESSION['cart']->count_contents() . ' articoli</a>'; 
                                    } 
                                ?> 
                                <?php echo $cart_text ?>  
                            <!-- =================================== -->

  8. #8
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: now in your cart in another language (tpl_header.php)

    And yes, if you want to do the same for articuli then you'd need to create a new define for that too. Your getting the hang of it

  9. #9
    Join Date
    Nov 2011
    Location
    Harrogate, UK
    Posts
    16
    Plugin Contributions
    0

    Default Re: now in your cart in another language (tpl_header.php)

    Brilliant! IT WORKS
    Now I'll try it with the articoli bit :)
    Thank you ever so much!

  10. #10
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: now in your cart in another language (tpl_header.php)

    You are more than welcome

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v139h tpl_header.php how to set different logos for each language?
    By ilmarchez in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 25 Mar 2013, 11:11 PM
  2. edited tpl_header.php now looks bad in firefox
    By beasleybub in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 13 Jul 2009, 08:36 PM
  3. French - now in your cart (tpl_header.php)
    By imfsub12 in forum Addon Language Packs
    Replies: 9
    Last Post: 18 Jun 2009, 05:12 PM
  4. "now in your cart" - what php file is this in?
    By imfsub12 in forum General Questions
    Replies: 4
    Last Post: 6 Jun 2009, 05:14 PM
  5. Replies: 13
    Last Post: 23 Sep 2008, 05:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR