Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2007
    Posts
    513
    Plugin Contributions
    2

    Default Putting currency dropdown in the header

    I am looking to find an easy solution or put the currency dropdown code in the header but what I am doing is not work, I am a bit new with PHP.

    This is the code I would like to rip out and put in my header

    \includes\templates\template_default\sideboxes\tpl_currencies.php

    Code:
    <?php
        $content = "";
        $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
        $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>';
        $content .= '</div>';
    ?>


    Or (I dont know how I would use it but..)

    \includes\modules\sideboxes\currencies.php

    Code:
     
    <?php
    /**
     * currencies sidebox - allows customer to select from available currencies
     *
     * @package templateSystem
     * @copyright Copyright 2003-2005 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: currencies.php 2834 2006-01-11 22:16:37Z birdbrain $
     */
    // test if box should display
      $show_currencies= false;
      // don't display on checkout page:
      if (substr($current_page, 0, 8) != 'checkout') {
        $show_currencies= true;
      }
      if ($show_currencies == true) {
        if (isset($currencies) && is_object($currencies)) {
          reset($currencies->currencies);
          $currencies_array = array();
          while (list($key, $value) = each($currencies->currencies)) {
            $currencies_array[] = array('id' => $key, 'text' => $value['title']);
          }
          $hidden_get_variables = '';
          reset($_GET);
          while (list($key, $value) = each($_GET)) {
            if ( ($key != 'currency') && ($key != zen_session_name()) && ($key != 'x') && ($key != 'y') ) {
              $hidden_get_variables .= zen_draw_hidden_field($key, $value);
            }
          }
          require($template->get_template_dir('tpl_currencies.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_currencies.php');
          $title =  '<label>' . BOX_HEADING_CURRENCIES . '</label>';
          $title_link = false;
          require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
        }
      }
    ?>


    I took the top code and made a few things to insert into the header but I dont know what I am doing
    e.g.
    Code:
    <?php
    <div>
     zen_draw_form('currencies_form', zen_href_link(basename(ereg_replace('.php','', $PHP_SELF)), '', $request_type, false), 'get') zen_draw_pull_down_menu('currency', $currencies_array, $_SESSION['currency'], 'onchange="this.form.submit();"') $hidden_get_variables zen_hide_session_id() </form> </div>;
    ?>

  2. #2
    Join Date
    Nov 2006
    Posts
    73
    Plugin Contributions
    0

    Default Re: Putting currency dropdown in the header

    There is this mod, which, unmodified, gives you text buttons for each active currency. I just discovered it and I'm trying to figure out how to move them around and replace the text with images.
    Headsonic.com.au - Headphones and Microphones for Australians

  3. #3
    Join Date
    Feb 2007
    Posts
    513
    Plugin Contributions
    2

    Default Re: Putting currency dropdown in the header

    Thanks!

  4. #4
    Join Date
    Sep 2008
    Posts
    95
    Plugin Contributions
    0

    Default Re: Putting currency dropdown in the header

    Use below given code in your header file.

    Code:
    <!-- Currencies -->
    
    <?=zen_draw_form('currencies', zen_href_link(basename(ereg_replace('.php','', $PHP_SELF)), '', $request_type, false), 'get')?>
    
    <?
    
        if (isset($currencies) && is_object($currencies)) {
    
          reset($currencies->currencies);
          $currencies_array = array();
          while (list($key, $value) = each($currencies->currencies)) {
            $currencies_array[] = array('id' => $key, 'text' => $value['title']);
          }
    
          $hidden_get_variables = '';
          reset($_GET);
          while (list($key, $value) = each($_GET)) {
            if ( ($key != 'currency') && ($key != zen_session_name()) && ($key != 'x') && ($key != 'y') ) {
              $hidden_get_variables .= zen_draw_hidden_field($key, $value);
            }
          }
        }
    
    ?>
    
            <?=zen_draw_pull_down_menu('currency', $currencies_array, $_SESSION['currency'], 'class="header1_sel" onchange="this.form.submit();"') . $hidden_get_variables . zen_hide_session_id()?>
    </form>
    <!-- End Currencies -->

  5. #5
    Join Date
    Sep 2008
    Posts
    95
    Plugin Contributions
    0

    Default Re: Putting currency dropdown in the header

    Hi,

    Can anyone say how to put one particular default currency in drop down in header irrespective of what default currency is in admin.

    ~ Time

  6. #6
    Join Date
    Dec 2009
    Posts
    1
    Plugin Contributions
    0

    Default Re: Putting currency dropdown in the header

    How about the language code please. Thanks

  7. #7
    Join Date
    Feb 2007
    Posts
    513
    Plugin Contributions
    2

    Default Re: Putting currency dropdown in the header

    It was sometime ago, but if I remember correctly the code was in the module http://www.zen-cart.com/index.php?ma...roducts_id=107
    and also someone has provided code above.
    This code is very old and I have not used it in the new zencart versions.

  8. #8
    Join Date
    Feb 2007
    Posts
    513
    Plugin Contributions
    2

    Default Re: Putting currency dropdown in the header

    The link I provided above is very old.
    I would try one of the newer ones
    - http://www.zen-cart.com/index.php?ma...oducts_id=1530
    - http://www.zen-cart.com/index.php?ma...roducts_id=992
    - http://www.zen-cart.com/index.php?ma...roducts_id=857


    Found by doing a search for 'currency' in the 'free add-on's'

 

 

Similar Threads

  1. Do I need the currency dropdown?
    By stevelucky in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 18 Jul 2010, 12:30 PM
  2. Header Dropdown Menu (CSS) Without the Dropdown???
    By hcd888 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 27 May 2009, 01:20 AM
  3. currency dropdown box in header
    By james739 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 28 Mar 2008, 01:18 AM
  4. Moving Currency Dropdown box to header
    By james739 in forum General Questions
    Replies: 0
    Last Post: 21 Sep 2007, 03:07 PM
  5. Currency dropdown menu in header
    By james739 in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 2
    Last Post: 4 Aug 2007, 01:10 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