Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2011
    Posts
    2
    Plugin Contributions
    0

    Default define a constant text

    hello,
    i hope i place this question in the right area.
    I have a multilanguage website Dutch/English and i use overides.
    I want to place a constant text next to my product image.
    But i cant seem to figure out how to get the dutch text in the dutch area and the english text in the english area.
    Now i have to place the text every time in the product discription but it costs a lot of time to put it in the right place.
    Can someone tell me step by step how to set a text permantly in the template in a way that if a visit the dutch version i see the dutch text and if i visit the english version i see the english text.

    Thank you very much,
    janine

    http://crossstitchplace.nl

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

    Default Re: define a constant text

    You need to make a define in a language file. Steps to do that :

    1. Make a new file in includes/languages/english/extra-definitions and call it something like my_definitions.php . The file should look something like :

    Code:
    <?php
    
    define('MY_NEW_DEFINE', 'Text to appear on page in English');
    2. Make a new file in includes/languages/dutch/extra-definitions and call it the same thing . The file should look something like :

    Code:
    <?php
    
    define('MY_NEW_DEFINE', 'Text to appear on page in Dutch');
    So far you have defined a constant called 'MY_NEW_DEFINE' that will be one thing in english and will be another thing in dutch.

    3. Now you need to used that in one of the templates. If you are trying to put it on the product_info page you will probably want to edit includes/templates/YOURTEMPLATE/templates/tpl_product_info_display.php. Depends a bit where you actually want to out the text. In that file you need to add the following code:

    Code:
    <?php
    echo MY_NEW_DEFINE;
    ?>
    That's it .

    Actually there are a few subtleties ( like making override versions of the first two files ) but the above should work.

  3. #3
    Join Date
    Nov 2011
    Posts
    39
    Plugin Contributions
    0

    Default Re: define a constant text

    or just copy english folder in the admin panel and reupload it as Dutch and from there when you add products you can add dutch text and english txt

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

    Default Re: define a constant text

    Well, I think he was asking how to put some text that wasn't already defined in the language files.

    But if it is just an existing language define then what you say is true. Or of course you could just use one of the existing language packs......

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

    Default Re: define a constant text

    yes, but the question was how to add a define that wasn't already included in the existing defines.

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: define a constant text

    That was a spammer regurgitating an existing post...

 

 

Similar Threads

  1. v151 Constant define: BOX_ENTRY_CUSTOMERS
    By d0ugparker in forum General Questions
    Replies: 2
    Last Post: 16 Nov 2014, 01:47 AM
  2. Replies: 2
    Last Post: 5 Dec 2013, 01:07 PM
  3. Correct method to add new define constant?
    By torvista in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 7 May 2010, 07:21 PM
  4. Define a global CONSTANT
    By dgsignal in forum General Questions
    Replies: 3
    Last Post: 20 Oct 2008, 06:01 AM
  5. Undefined constant text
    By TheOracle in forum Bug Reports
    Replies: 6
    Last Post: 11 May 2007, 04:19 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