Forums / Templates, Stylesheets, Page Layout / How can I return to my Home page, when I switch my language's icons.

How can I return to my Home page, when I switch my language's icons.

Locked

Views: 1,222

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
25 Nov 2010, 8:30 PM
#1
shipper58 avatar

shipper58

New Zenner

Join Date:
Nov 2010
Posts:
9
Plugin Contributions:
0

How can I return to my Home page, when I switch my language's icons.

Hi.
I use 2 languages.
How can I return to my Home page, when I switch my language's icons.
Where can I change the code?
Thank you.

27 Nov 2010, 4:41 PM
#2
shipper58 avatar

shipper58

New Zenner

Join Date:
Nov 2010
Posts:
9
Plugin Contributions:
0

Re: How can I return to my Home page, when I switch my language's icons.

Hello everybody.
Does anyone have an idea?
When I switch languages, I need return to main (home) page.
Best regards...

27 Nov 2010, 6:10 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: How can I return to my Home page, when I switch my language's icons.

Why?

If I'm looking at a particular product in one language, and I want to view that product in another language, and click the language link, if you return me to the home page, then I have to go find that product all over again. I'll probably close your site and go find another that's more friendly and usable.

What specific business problem are you thinking you'll solve by changing the way it's designed to work?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

27 Nov 2010, 7:31 PM
#4
shipper58 avatar

shipper58

New Zenner

Join Date:
Nov 2010
Posts:
9
Plugin Contributions:
0

Re: How can I return to my Home page, when I switch my language's icons.

Thank you for your reply.
I do not have the same products (categories) in both languages. Different products for different languages (countries).
When a customer uses one language, switch language to another, he returns to the home page on another language with other products.

27 Nov 2010, 8:44 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: How can I return to my Home page, when I switch my language's icons.

/includes/init_includes/overrides/init_languages.php
add a new line as shown:```
if (isset($_GET['language']) && zen_not_null($_GET['language'])) {
$lng->set_language($_GET['language']);
[B] zen_redirect(zen_href_link(FILENAME_DEFAULT, '', $request_type));[/B]
} else {

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

27 Nov 2010, 10:03 PM
#6
shipper58 avatar

shipper58

New Zenner

Join Date:
Nov 2010
Posts:
9
Plugin Contributions:
0

Re: How can I return to my Home page, when I switch my language's icons.

Thank you. I add new line.
I can return to home page, but...
Now I can use only one language and I can open my store only on one language. And how about second language?
My site :https://www.bookpolka.com

27 Nov 2010, 10:55 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: How can I return to my Home page, when I switch my language's icons.

Try this instead:```
if (!isset($_SESSION['language']) || isset($_GET['language'])) {
$lng = new language();
if (isset($_GET['language']) && zen_not_null($_GET['language'])) {
$lng->set_language($_GET['language']);
[B] $redir = ($_SESSION['language'] != $_GET['language']);[/B]
} else {
if (LANGUAGE_DEFAULT_SELECTOR=='Browser') {
$lng->get_browser_language();
} else {
$lng->set_language(DEFAULT_LANGUAGE);
}
}
$_SESSION['language'] = (zen_not_null($lng->language['directory']) ? $lng->language['directory'] : 'english');
$_SESSION['languages_id'] = (zen_not_null($lng->language['id']) ? $lng->language['id'] : 1);
$_SESSION['languages_code'] = (zen_not_null($lng->language['code']) ? $lng->language['code'] : 'en');
[B]if ($redir) {
zen_redirect(zen_href_link(FILENAME_DEFAULT, '', $request_type));
}
[/B]
}

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

27 Nov 2010, 11:24 PM
#8
shipper58 avatar

shipper58

New Zenner

Join Date:
Nov 2010
Posts:
9
Plugin Contributions:
0

Re: How can I return to my Home page, when I switch my language's icons.

Now my store is OK!!!
DrByte . Thanks for all your help!!!