Page 4 of 11 FirstFirst ... 23456 ... LastLast
Results 31 to 40 of 102
  1. #31
    Join Date
    May 2006
    Posts
    725
    Plugin Contributions
    0

    Default Re: Language/Currency Links in Header

    Quote Originally Posted by 121webconsultancy View Post
    Hi.

    I have installed bunyip's most excellent currency header mod and it works fine. However, an ongoing issue I have is attempting to display a preferred sort order of the currencies.

    I only have GBP, EUR and USD and this is the order I wish to achieve.

    See: www.prestigeringcompany.com/index.php and you will note the order is USD, EUR, GBP

    I have deleted and reset the currencies to try and change the order and I have tried kuroi's fix and changed the currency title to try and influence any alphabetic sort, etc... but I am having no luck and slowly going mad...

    Would anybody know how I can achieve the preferred sort order of GBP EUR USD ...???

    Thank you kindly in advance...

    Steve
    Hello,

    Also trying to get the above. Any solution pls?

    Thank you

  2. #32
    Join Date
    Sep 2004
    Location
    Western Massachusetts
    Posts
    2,945
    Plugin Contributions
    5

    Default Re: Language/Currency Links in Header

    Berserker,

    The problem is that Zen Cart doesn't have a built-in sort order capability for currencies like it has for languages. You would have to modify your admin currencies page and the database currencies table in order to implement a sort order.

    Here's the steps to do so - please make a backup of your database and affected files first!

    1. Add the sort order field to the currencies table - run this query from Admin > Tools > Install SQL Patches:
    PHP Code:
    ALTER TABLE currencies ADD sort_order INT(3NOT NULL DEFAULT '0'
    2. Edit admin/currencies.php so you can enter a sort order:
    after this line (line 42):
    PHP Code:
    $value zen_db_prepare_input((float)$_POST['value']); 
    add this line
    PHP Code:
    $sort_order zen_db_prepare_input($_POST['sort_order']); 
    edit the sql query at line 45 so it reads:
    PHP Code:
            $sql_data_array = array('title' => $title,
                                    
    'code' => $code,
                                    
    'symbol_left' => $symbol_left,
                                    
    'symbol_right' => $symbol_right,
                                    
    'decimal_point' => $decimal_point,
                                    
    'thousands_point' => $thousands_point,
                                    
    'decimal_places' => $decimal_places,
                                    
    'value' => $value,
                                    
    'sort_order' => $sort_order); 
    before this line at line 200,
    PHP Code:
                    <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION?>&nbsp;</td>
    add this line:
    PHP Code:
                    <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_SORT_ORDER?></td>
    Edit the query at line 204 so it reads:
    PHP Code:
      $currency_query_raw "select currencies_id, title, code, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, last_updated, value, sort_order from " TABLE_CURRENCIES " order by sort_order"
    after this line at line 225,
    PHP Code:
                    <td class="dataTableContent" align="right"><?php echo number_format($currency->fields['value'], 8); ?></td>
    add this line
    PHP Code:
                    <td class="dataTableContent" align="right"><?php echo $currency->fields['sort_order']; ?></td>
    After this line at line 269,
    PHP Code:
          $contents[] = array('text' => '<br>' TEXT_INFO_CURRENCY_VALUE '<br>' zen_draw_input_field('value')); 
    add this line
    PHP Code:
          $contents[] = array('text' => '<br>' TEXT_INFO_CURRENCY_SORT_ORDER '<br>' zen_draw_input_field('sort_order')); 
    After this line at line 286
    PHP Code:
          $contents[] = array('text' => '<br>' TEXT_INFO_CURRENCY_VALUE '<br>' zen_draw_input_field('value'$cInfo->value)); 
    add this line
    PHP Code:
          $contents[] = array('text' => '<br>' TEXT_INFO_CURRENCY_SORT_ORDER '<br>' zen_draw_input_field('sort_order'$cInfo->sort_order)); 
    3. Add the two new language definitions to admin/includes/languages/english/currencies.php (or to a new file in admin/includes/languages/english/extra_definitions/)
    PHP Code:
    define('TABLE_HEADING_SORT_ORDER''Sort Order');
    define('TEXT_INFO_CURRENCY_SORT_ORDER''Sort Order:'); 
    4. Edit the file includes/classes/currencies.php (this is a core file - no override capability)

    Modify the query at line 27 to read:
    PHP Code:
        $currencies_query "select code, title, symbol_left, symbol_right, decimal_point,
                             thousands_point, decimal_places, value, sort_order 
                             from " 
    TABLE_CURRENCIES " order by sort_order"
    You should be done...now you can add/edit sort orders for the currencies from admin, and they should be displayed in that order in the header.
    Neville
    An assumption is what you arrive at when you get tired of thinking...

  3. #33
    Join Date
    May 2009
    Posts
    2
    Plugin Contributions
    0

    Default Re: Language/Currency Links in Header

    Hi,

    As per an earlier post, I've modified the currency display into a drop down list by replacing all the codes in tpl_header_currencies with:

    $content = "";
    $content .= zen_draw_form('currencies_form', zen_href_link(basename(ereg_replace('.php','', $PHP_SELF)), '', $request_type, false), 'get');
    $content .= zen_draw_pull_down_menu('currency', $currencies_array, $_SESSION['currency'], 'onchange="this.form.submit();"') . $hidden_get_variables . zen_hide_session_id();
    $content .= '</form>';

    echo $content;
    ?>


    However the drop down list displays the currency with my left symbol (US$, S$ etc). I'm trying to display the full title of the respective currency instead (US Dollar, Singapore Dollar etc), just like that on http://www.serahsonline.com

    Will some kind soul please advise on this? Thanks!

  4. #34
    Join Date
    Sep 2004
    Location
    Western Massachusetts
    Posts
    2,945
    Plugin Contributions
    5

    Default Re: Language/Currency Links in Header

    Quote Originally Posted by missy eiinix View Post
    Hi,

    As per an earlier post, I've modified the currency display into a drop down list by replacing all the codes in tpl_header_currencies with:

    $content = "";
    $content .= zen_draw_form('currencies_form', zen_href_link(basename(ereg_replace('.php','', $PHP_SELF)), '', $request_type, false), 'get');
    $content .= zen_draw_pull_down_menu('currency', $currencies_array, $_SESSION['currency'], 'onchange="this.form.submit();"') . $hidden_get_variables . zen_hide_session_id();
    $content .= '</form>';

    echo $content;
    ?>


    However the drop down list displays the currency with my left symbol (US$, S$ etc). I'm trying to display the full title of the respective currency instead (US Dollar, Singapore Dollar etc), just like that on http://www.serahsonline.com

    Will some kind soul please advise on this? Thanks!
    Edit your copy of includes/modules/header_currencies.php
    replace this line:
    PHP Code:
            $currencies_array[] = array('id' => $key'text' => (zen_not_null($value['symbol_left']) ? $value['symbol_left'] : $value['symbol_right']) ); 
    with this:
    PHP Code:
            $currencies_array[] = array('id' => $key'text' => $value['title']); 
    Neville
    An assumption is what you arrive at when you get tired of thinking...

  5. #35
    Join Date
    May 2009
    Posts
    2
    Plugin Contributions
    0

    Default Re: Language/Currency Links in Header

    Thanks, that worked perfectly!

  6. #36
    Join Date
    Feb 2009
    Posts
    15
    Plugin Contributions
    0

    Default Re: Language/Currency Links in Header

    Hello anyone note that this Language/Currency header disapper on all the Checkout pages?

  7. #37
    Join Date
    Feb 2009
    Posts
    15
    Plugin Contributions
    0

    Default Re: Language/Currency Links in Header

    Hello bunyip I just read your very first post and see that you keep the code to prevernt this header show on all Checkout pages. How if I really want to remove these code? Or at least just show the Language header? It's really necessary for me. Thanks!

  8. #38
    Join Date
    Sep 2004
    Location
    Western Massachusetts
    Posts
    2,945
    Plugin Contributions
    5

    Default Re: Language/Currency Links in Header

    Quote Originally Posted by cocteau View Post
    Hello bunyip I just read your very first post and see that you keep the code to prevernt this header show on all Checkout pages. How if I really want to remove these code? Or at least just show the Language header? It's really necessary for me. Thanks!
    To have the language links display on the checkout pages, edit includes/modules/header_languages.php
    change this section of code at lines 12-18:
    PHP Code:
    // test if box should display
      
    $show_currenciesfalse;

      
    // don't display on checkout page:
      
    if (substr($current_page08) != 'checkout') {
        
    $show_currenciestrue;
      } 
    to be just:
    PHP Code:
    // test if box should display
      
    $show_currenciestrue
    Make exactly the same edit to the file includes/modules/header_currencies.php if you want the currency links to display on checkout pages.
    Neville
    An assumption is what you arrive at when you get tired of thinking...

  9. #39
    Join Date
    Feb 2009
    Posts
    15
    Plugin Contributions
    0

    Default Re: Language/Currency Links in Header

    Thank so much for the reply.

  10. #40
    Join Date
    Mar 2009
    Location
    Serbia
    Posts
    349
    Plugin Contributions
    0

    Default Re: Language/Currency Links in Header

    A download a: Contribution: Language/Currency Links in Header
    Hay to install?
    Whare to put code into tpl_header.php?
    <!-- bof languages/currencies header display -->
    <div id="navCurrenciesWrapper" class="forward">
    <?php
    if (HEADER_LANGUAGES_DISPLAY == 'True') require(DIR_WS_MODULES . 'header_languages.php');
    if (HEADER_CURRENCIES_DISPLAY == 'True') require(DIR_WS_MODULES . 'header_currencies.php');
    ?>
    </div>
    <!-- eof languages/currencies header display -->


    I trie to put code on end in file end nothing happen.


    Whare to put new classes to my stylesheet so I can control the format of the currency links?

    #navCurrenciesWrapper a {
    color: #ffffff;
    text-decoration: none;
    }

    #navCurrenciesWrapper a:hover {
    color: #000000;
    text-decoration: none;
    }

 

 
Page 4 of 11 FirstFirst ... 23456 ... LastLast

Similar Threads

  1. Language and Currency in the Header
    By jdes in forum General Questions
    Replies: 1
    Last Post: 13 Aug 2010, 04:38 PM
  2. Language and Currency in header
    By DocRocks in forum All Other Contributions/Addons
    Replies: 9
    Last Post: 8 Nov 2009, 10:53 AM
  3. Error with 'Language/Currency Links in Header'
    By [email protected] in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 14 Mar 2007, 03:23 PM
  4. Error with 'Language/Currency Links in Header'
    By [email protected] in forum Customization from the Admin
    Replies: 1
    Last Post: 6 Feb 2007, 10:17 PM
  5. Replies: 0
    Last Post: 26 Jan 2007, 06:10 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