Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2008
    Posts
    133
    Plugin Contributions
    1

    Default What is the correct way to include a file from the current language?

    I need to include this file path to an override:

    includes/languages/english/CUSTOM/account_history_info.php

    Of course, I can just hard-code it and it works. However, what is the correct syntax so that it would still work after changing to a different template or language?

    I can't come up with an example at the moment in the code, although I'm sure there is one.

    For example, here's some code that gets the correct directory for a template file:
    Code:
    require($template->get_template_dir('tpl_account_history_info_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_account_history_info_default.php');
    I'm thinking there must be something similar for language files. Thanks!

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,514
    Plugin Contributions
    126

    Default Re: What is the correct way to include a file from the current language?

    What you're looking for here is $_SESSION['language']. So for

    includes/languages/english/CUSTOM/account_history_info.php

    the include would be

    include_once(zen_get_file_directory( DIR_WS_LANGUAGES . $_SESSION['language'] , 'account_history_info.php', 'false'));
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Apr 2008
    Posts
    133
    Plugin Contributions
    1

    Default Re: What is the correct way to include a file from the current language?

    Thanks much, I'll try that tomorrow!

 

 

Similar Threads

  1. What would be the best way to include WordPress?
    By Drachsi in forum General Questions
    Replies: 9
    Last Post: 27 Mar 2013, 10:37 PM
  2. What is the correct way to reference language file?
    By venablc in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 7 Jul 2012, 02:29 PM
  3. Replies: 0
    Last Post: 19 Nov 2011, 11:04 PM
  4. What is the correct way to display multiple images?
    By keemeng in forum Setting Up Categories, Products, Attributes
    Replies: 9
    Last Post: 6 Jun 2011, 12:19 AM
  5. what does 'Set the desired text in the language file' - in cart mod mean?
    By what44 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 28 Oct 2007, 11:53 PM

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