Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2006
    Posts
    42
    Plugin Contributions
    0

    Default single language button switches but stays on same page

    I am running a store that has two languages, english and spanish. I have a single button that is supposed to switch everything from one language to the other. I need it to stay on the same page when it switches. Can anyone help a brother out? I am good enough with PHP to be dangerous, but that is about all. You can view what I have set up at www.mylibros.com.

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: single language button switches but stays on same page

    the code attached to your link is this
    Code:
    http://www.mylibros.com/index.php?main_page=index&language=en
    and specifies "main_page", and is why your are taken to this page and not left where ever you might switch from. Now I am not a php coder but there must be a statement that will take a wild card to allow the current page as the variable.
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Aug 2006
    Posts
    42
    Plugin Contributions
    0

    Default Re: single language button switches but stays on same page

    OK, well here's the thing, I have successfully used a hidden field form to post the language variable and it worked quite well. However, when I use a form, it throws the header images out of whack, the spacing on the images get crazy. I want to simply submit the variable using PHP code, but I don't know what functions to create or what variables exist for me to use to be able to use the same code on every page of my template and override pages that I use.

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: single language button switches but stays on same page

    While you can do what you want...you have added many tables to what is designed to be mostly tableless. This has caused many problems...to check go here and attmpt to validate your page: Validator.

    This might & might not correct your initial problem but will assist generally with all cart functions.
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Aug 2006
    Posts
    42
    Plugin Contributions
    0

    Default Re: single language button switches but stays on same page

    Quote Originally Posted by kobra
    This has caused many problems...
    I haven't seen any problems arise as a result of the tables I have added... What possible problems can arise or do you see on my site? If there are any serious problems, I definitely want to get them fixed. Please let me know what issues should be addressed.

  6. #6
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: single language button switches but stays on same page

    did you use the page validator link that I provided?
    Zen-Venom Get Bitten

  7. #7
    Join Date
    Aug 2006
    Posts
    42
    Plugin Contributions
    0

    Default Re: single language button switches but stays on same page

    I did. I checked it. What is the importance of W3C validation?

  8. #8
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: single language button switches but stays on same page

    Mostly cross browser compatibility as each browser will handle these errors in a different manner and with 100 or so this can be a real problem
    Zen-Venom Get Bitten

  9. #9
    Join Date
    May 2004
    Location
    Hong Kong
    Posts
    1,291
    Plugin Contributions
    1

    Default Re: single language button switches but stays on same page

    In my view, for not a web pro and only based on other experiences.
    It is the basic routine work in technical and called problems isolation.

    Validation may not important and although pass the validation not mean problems can be solved.
    However, it is not only for semantic and it also help to reduce human faults and
    isolate all un-related issues which may cause un-predictable effects to the problems which under being solve.


    For your issue, for the variable related to language,

    you can view the file and codes below:
    includes/classes/language.php
    at about line no. 76 - 83
    PHP Code:
        while (!$languages->EOF) {
          
    $this->catalog_languages[$languages->fields['code']] = array('id' => $languages->fields['languages_id'],
          
    'name' => $languages->fields['name'],
          
    'image' => $languages->fields['image'],
          
    'code' => $languages->fields['code'],
          
    'directory' => $languages->fields['directory']);
          
    $languages->MoveNext();
        } 
    Where:
    (values related to the setting in the admin)
    id = the assigned id number of the languages
    name = the name of the languages, e.g. English
    image = the image file name of the languages, e.g. icon.gif
    code = the code ot the languages, e.g. en for english
    directory = the located directory of the languages

    And called by the languages sidebox template file.
    Of which will point to the correct pages of languages selected.
    And you can modidy it for your purpose.

    includes/templates/template_default/sideboxes/tpl_languages.php
    PHP Code:
        $content .= '<a href="' zen_href_link($_GET['main_page'], zen_get_all_get_params(array('language''currency')) . 'language=' $key$request_type) . '">' zen_image(DIR_WS_LANGUAGES .  $value['directory'] . '/images/' $value['image'], $value['name']) . '</a>&nbsp;&nbsp;'
    A New Starter again

 

 

Similar Threads

  1. Some times page switches to default language when refreshed after inactivity
    By Athens Collectibles in forum General Questions
    Replies: 5
    Last Post: 2 Sep 2010, 02:58 PM
  2. Featured Products description stays the same
    By kaiyiwong in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 25 Jul 2009, 06:18 PM
  3. Replies: 4
    Last Post: 11 May 2008, 11:25 AM
  4. add to cart but stay on same page
    By longstockings in forum Customization from the Admin
    Replies: 6
    Last Post: 20 Jul 2007, 12:03 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