Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default language defines... inconsistent overrides for order_total modules

    I've wondered this for years and now that I'm customizing (yet another) zen cart installation, I figured I'd ask...

    It seems that some files you can place just the defines you want to change in the override file. For example

    /inculdes/languages/english.php is overrided with /includes/languages/YOUR_TEMPLATE/english.php and you can pick and choose which defines you include in the new file. Any that you don't, will (logically) be taken from the main file.

    BUT this isn't always the case. Other language files you have to include the whole text with all the define or they don't work.

    Why is that? Is there any rhyme or reason to it that I'm missing?

    - Steven

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: language defines... inconsistent overrides...

    Could you give a specific example of one of the language files which 'have to include the whole text' ?

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,497
    Plugin Contributions
    88

    Default Re: language defines... inconsistent overrides...

    There's currently a report (http://www.zen-cart.com/showthread.p...ing-text/page2) in the Bug Reports about an override problem with order_totals ...

  4. #4
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: language defines... inconsistent overrides...

    Quote Originally Posted by stevesh View Post
    Could you give a specific example of one of the language files which 'have to include the whole text' ?
    Sure. One particular instance is /includes/languages/english/modules/order_total/ot_total.php

    Perhaps its a modules thing? I'll look deeper and find out exactly what files.

  5. #5
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: language defines... inconsistent overrides for order_total modules

    Nope. Found another one and its just a regular one...

    /includes/languages/english/YOUR_TEMPLATE/button_names.php

  6. #6
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: language defines... inconsistent overrides for order_total modules

    The default is that you need a complete list of language defines in the override file, as when there's an override, only that will be loaded.

    There is an exception for the primary language file, e.g. english.php. This wasn't always there, but was quietly introduced in version 1.3.2 or thereabouts. For this file only the override file would be loaded, followed by the main file. The rationale behind this was that the primary language files were so large that duplicating them seemed excessive and often caused problems in the next upgrade, as new definitions added to the default file tended to get missed from the override file during upgrades.

    However, there is drawback to this approach. First the overrides are loaded and then the default values, which fills in the gaps. However, it also causes PHP to issue warning notices for those definitions that appear in both files and nowadays these are treated with much more respect, so I doubt you'll see this approach extended further.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  7. #7
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: language defines... inconsistent overrides for order_total modules

    Interesting... so to be clear, what is the best practice then? To duplicate the entire file in each case and make edits in the duplicated file?

 

 

Similar Threads

  1. Replies: 7
    Last Post: 27 May 2015, 09:32 PM
  2. WARNING: Could not locate language file: modules/order_total/ot_loworderfee.php
    By stressedout72 in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 4 Feb 2012, 07:43 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