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
    Location
    In a traffic jam
    Posts
    2,012
    Plugin Contributions
    1

    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
    41
    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
    Location
    In a traffic jam
    Posts
    2,012
    Plugin Contributions
    1

    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
    Location
    In a traffic jam
    Posts
    2,012
    Plugin Contributions
    1

    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,019
    Plugin Contributions
    25

    Default Re: define a constant text

    That was a spammer regurgitating an existing post...

 

 

Similar Threads

  1. 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
  2. Define a global CONSTANT
    By dgsignal in forum General Questions
    Replies: 3
    Last Post: 20 Oct 2008, 06:01 AM
  3. Change the text of constant TEXT_SHIPPING_WEIGHT ??
    By miex in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 6 Apr 2008, 11:34 AM
  4. Undefined constant text
    By TheOracle in forum Bug Reports
    Replies: 6
    Last Post: 11 May 2007, 04:19 AM
  5. err: Warning: constant(): Couldn't find constant MODULE_SHIPPING_MZMT_GEOZONE_7_TEXT_
    By ginginca in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 6 Mar 2007, 07:19 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
  •