Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Nov 2009
    Posts
    1
    Plugin Contributions
    0

    Default Template override in languages/english/modules/shipping not working

    I upgraded my 1.3.8 site to 1.5. I started with a fresh 1.5 install and moved everything over.

    My customer just rang to tell me people are having trouble ordering and when I tried to sign up as a new user I received a message telling me there where no shipping options available. When I log into the admin system and look at modules/shipping I saw lots of messages like this:

    ERROR: module not loaded due to missing language file: /home/plr/public_html/includes/languages/english/modules/shipping/flatCourierUK.php

    The file flatCourierUK.php was in a folder with the template name inside shipping. As soon as I moved it out to shipping then it started working again.

    flatCourierUK.php was a shipping method I created based on the standard flat.php I created as it was the easiest way I found to create multiple flat shipping fees. The customer chooses which flat shipping method they want based on where they are, so for example royal mail for parcels under 5Kg or courier to the shetland islands.

    Is this a bug with zencart not handling my language override properly or is it me not creating the new shipping method correctly?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Template override in languages/english/modules/shipping not working

    Sounds like you didn't *test* any transactions after doing the upgrade. Something to remember for future.

    The "module not loaded due to missing language file" message appears when you don't have matching files for shipping module and its corresponding language file.

    Shipping modules come in pairs:
    /includes/modules/shipping/FILENAME.php
    /includes/languages/YOUR_LANGUAGE/modules/shipping/FILENAME.PHP
    If you don't have the pair of files on the server, you'll get errors and malfunction.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Apr 2011
    Location
    Espoo, Finland
    Posts
    46
    Plugin Contributions
    0

    Default Re: Template override in languages/english/modules/shipping not working

    Quote Originally Posted by TC!! View Post
    The file flatCourierUK.php was in a folder with the template name inside shipping. As soon as I moved it out to shipping then it started working again.
    Quote Originally Posted by DrByte View Post
    Shipping modules come in pairs:
    /includes/modules/shipping/FILENAME.php
    /includes/languages/YOUR_LANGUAGE/modules/shipping/FILENAME.PHP
    The overiding system is being applied for language files in /includes/languages/YOUR_LANGUAGE/modules/shipping/ folder.

    But it seems, the code in admin/modules.php and admin/orders.php files does not provide this option...

    In admin/orders.php should be

    Code:
                        if (file_exists(zen_get_file_directory(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/modules/' . $module_type . '/', $file, 'false'))) {
                            include(zen_get_file_directory(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/modules/' . $module_type . '/', $file, 'false'));
    instead of
    Code:
                        if (file_exists(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/modules/' . $module_type . '/' . $file)) {
                            include(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/modules/' . $module_type . '/' . $file);
    and in admin/orders.php should be (in many places):

    Code:
    require_once zen_get_file_directory(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/modules/payment/', $order->info['payment_module_code'] . '.php', 'false');
    instead of:

    Code:
    require_once(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/modules/payment/' . $order->info['payment_module_code'] . '.php');
    and

    Code:
    require zen_get_file_directory(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/modules/payment/', $order->info['payment_module_code'] . '.php', 'false');
    instead of:

    Code:
    require(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/modules/payment/' . $order->info['payment_module_code'] . '.php');
    (quoting code from v.155e)

  4. #4
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: Template override in languages/english/modules/shipping not working

    The issue described and the suggested revision(s) do not align.

    DrByte pointed out that all modules should be in includes/modules/shipping/ and have whatever name each is to be called. Then the words to be displayed for that shipping module are to be captured within each language used for each such shipping module (a language that does not have definitions for that shipping module will not show the shipping module as available, but will also generate an error.

    The suggested code fix appears that would offer the default language (typically "english") for the admin if the current admin language is not supported by the front end of the system. In otherwords it would make it "easier" on the admin side to use an admin language not supported by the store, but at the cost of the admin's "user experience" because the text would not be presented in the language used by the admin if that language was not addressed in the catalog.

    Basically, the shipping methods themselves are not overrideable. The language part of it is. Limits to the display of a shipping method are contained either in the admin setup (such as zones) or in additional code within the module based on whatever factor(s) of concern.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Apr 2011
    Location
    Espoo, Finland
    Posts
    46
    Plugin Contributions
    0

    Default Re: Template override in languages/english/modules/shipping not working

    Quote Originally Posted by mc12345678 View Post
    The issue described and the suggested revision(s) do not align.
    The issue described and the suggested revision(s) do align.

    Please read carefully the description of the problem and its solution in the initial topicstarter's message:

    Quote Originally Posted by TC!! View Post
    ERROR: module not loaded due to missing language file: /home/plr/public_html/includes/languages/english/modules/shipping/flatCourierUK.php

    The file flatCourierUK.php was in a folder with the template name inside shipping. As soon as I moved it out to shipping then it started working again.
    Additionally, this has absolutely no connection with language (wether English or not) used in admin

  6. #6
    Join Date
    Aug 2004
    Location
    Saint Petersburg, Russia
    Posts
    1,786
    Plugin Contributions
    13

    Default Re: Template override in languages/english/modules/shipping not working

    Hi yesaul,
    Quote Originally Posted by yesaul View Post
    The overiding system is being applied for language files in /includes/languages/YOUR_LANGUAGE/modules/shipping/ folder.

    But it seems, the code in admin/modules.php and admin/orders.php files does not provide this option...

    In admin/orders.php should be

    Code:
                        if (file_exists(zen_get_file_directory(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/modules/' . $module_type . '/', $file, 'false'))) {
                            include(zen_get_file_directory(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/modules/' . $module_type . '/', $file, 'false'));
    instead of
    Code:
                        if (file_exists(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/modules/' . $module_type . '/' . $file)) {
                            include(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/modules/' . $module_type . '/' . $file);
    and in admin/orders.php should be (in many places):

    Code:
    require_once zen_get_file_directory(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/modules/payment/', $order->info['payment_module_code'] . '.php', 'false');
    instead of:

    Code:
    require_once(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/modules/payment/' . $order->info['payment_module_code'] . '.php');
    and

    Code:
    require zen_get_file_directory(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/modules/payment/', $order->info['payment_module_code'] . '.php', 'false');
    instead of:

    Code:
    require(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/modules/payment/' . $order->info['payment_module_code'] . '.php');
    (quoting code from v.155e)
    Thanks for the bugfix. Really unpleasant bug. Add this bugfix to zen-cart-1.5.5-Russian.

 

 

Similar Threads

  1. Replies: 7
    Last Post: 27 May 2015, 09:32 PM
  2. includes/languages/english/custom override not working
    By Bostitch in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 1 Jul 2009, 04:45 PM
  3. v 1.3.5 - 'languages/english/modules/' overrides
    By Pixxi in forum Bug Reports
    Replies: 1
    Last Post: 9 Oct 2006, 09:02 PM
  4. Template overrides in languages/english/modules/shipping ?
    By imac in forum Templates, Stylesheets, Page Layout
    Replies: 14
    Last Post: 18 Aug 2006, 04:11 PM

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