Author Topic: Virtue Mart changes to default language  (Read 5023 times)

gargantouas

  • Beginner
  • *
  • Posts: 15
Virtue Mart changes to default language
« on: January 27, 2012, 12:52:48 pm »
Hi everyone,
  and thanks for the wonderful VM. I am facing with a weird behavior while developing a website in VM 1.1.8, Joomla 1.5.23 and Joomfish 2.1.7. 
  The website is in two languages Greek (default) and English.
  So I have set up everything with no problem, inserted categories, products etc....the problem is this:
  Whenever i am on the English language and I have a select box with the child products the Virtuemart language changes to the default (Greek). If I refresh the page then it comes back to the English language.
  In addition to that, check out it only performed on the default language.  Refreshing each checkout step, displays the English language, moving to the next step it changes to the default (Greek).
  The joomla language is displayed correctly on the product page but changes also on the checkout.
  If I remember correctly, I had changed the default language from Greek to English and then back again
  Does anyone came across this problem or has any suggestions?
  Thanks in advance.

gargantouas

  • Beginner
  • *
  • Posts: 15
Re: Virtue Mart changes to default language
« Reply #1 on: February 10, 2012, 10:44:59 am »
Thank you for your replay
The versions as stated are VM 1.1.8, Joomla 1.5.23 and Joomfish 2.1.7.
I had to do a fresh install in order to fix this unfortunately...and I think this is not a virtuemart problem after all but a joomfish, joomla bug by changing the default language, because it happened on another site I was working with no virtuemart installed.

lmas

  • Beginner
  • *
  • Posts: 5
Re: Virtue Mart changes to default language
« Reply #2 on: February 23, 2012, 18:16:09 pm »
Same problem here. when pressed checkout it was changing to default language bu using this http://www.joomfish.net/forum/viewtopic.php?f=24&t=7401 fixed this part but when i press next on delivery address selection it changes to default again.

ksanna

  • Beginner
  • *
  • Posts: 2
Re: Virtue Mart changes to default language
« Reply #3 on: March 15, 2012, 04:32:46 am »
Same problem here. when pressed checkout it was changing to default language bu using this http://www.joomfish.net/forum/viewtopic.php?f=24&t=7401 fixed this part but when i press next on delivery address selection it changes to default again.

1. To fix language change to default language when next button is clicked:
(Note: you need to fix the problem what Imas mentioned first)
../root/administrator/components/com_virtuemart/html/checkout.index.php
In my case: add ?lang=us to the following code (us is my website's alternative language)
Code: [Select]
$basket_html .= '<form action="'. SECUREURL.basename($_SERVER['PHP_SELF']) .'?lang=us" method="post" name="adminForm">if you need some code to differentiate default/alternative language:
Code: [Select]
$current_url =& JFactory::getURI();
$current_url_string = $current_url->toString();
if( stristr($current_url_string,'lang=us') === FALSE )

My modification is as follows:
Code: [Select]
$current_url =& JFactory::getURI();
$current_url_string = $current_url->toString();
if ($perm->is_registered_customer($auth['user_id'])) { // user is logged in and a registered customer

if( stristr($current_url_string,'lang=us') === FALSE )
$basket_html .= '<form action="'. SECUREURL.basename($_SERVER['PHP_SELF']) .'" method="post" name="adminForm">
<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="Itemid" value="'. $Itemid .'" />
<input type="hidden" name="user_id" value="'. $auth['user_id'] .'" />
<input type="hidden" name="page" value="'. $next_page .'" />
<input type="hidden" name="func" value="checkoutProcess" />
<input type="hidden" name="zone_qty" value="'. $zone_qty .'" />
<input type="hidden" name="ship_to_info_id" value="'. $ship_to_info_id .'" />
<input type="hidden" name="shipping_rate_id" value="'. urlencode($shipping_rate_id) .'" />
<input type="hidden" name="payment_method_id" value="'. $payment_method_id .'" />
<input type="hidden" name="checkout_last_step" value="'. $current_stage .'" />';
else
$basket_html .= '<form action="'. SECUREURL.basename($_SERVER['PHP_SELF']) .'?lang=us" method="post" name="adminForm">
<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="Itemid" value="'. $Itemid .'" />
<input type="hidden" name="user_id" value="'. $auth['user_id'] .'" />
<input type="hidden" name="page" value="'. $next_page .'" />
<input type="hidden" name="func" value="checkoutProcess" />
<input type="hidden" name="zone_qty" value="'. $zone_qty .'" />
<input type="hidden" name="ship_to_info_id" value="'. $ship_to_info_id .'" />
<input type="hidden" name="shipping_rate_id" value="'. urlencode($shipping_rate_id) .'" />
<input type="hidden" name="payment_method_id" value="'. $payment_method_id .'" />
<input type="hidden" name="checkout_last_step" value="'. $current_stage .'" />';

2. To fix language change to default language when a previous step of checkout current step is clicked:
../root/components/com_virtuemart/themes/vmtheme068/templates/checkout/checkout_bar.tpl.php
In my case: add lang=us to the following code (us is my website's alternative language)
Note: no question mark, ? , this time.
Code: [Select]
echo '<a href="'. $sess->url(SECUREURL."index.php?page=checkout.index&amp;option=com_virtuemart&amp;ship_to_info_id=$ship_to_info_id&amp;shipping_rate_id=".@$shipping_rate_id."&amp;lang=us&amp;checkout_stage=".$step[0]['step_order'] ).'">';
My setting:
Joomla! version: 1.5.23 Stable
VirtueMart 1.1.4
default language: Traditional Chinese
Alternative language: English
May be nothing to do with the problems:
System SEF plugin: disabled
Joom!Fish Version V2.1.7 (Dafad)

mbit

  • Jr. Member
  • **
  • Posts: 323
Re: Virtue Mart changes to default language
« Reply #4 on: June 18, 2012, 11:35:25 am »
Hello, i am facing same problem but at my site language switch to default when i press add to cart, before checkout process. Any hint how to solve this?

PopUp is disabled and at addtocart_form.tpl.php , i changed <form action="index.php?lang=<?php echo $lang  ?>&option=com_virtuemart&page=shop.cart"...> but although the url after button add to cart (index.php?lang=el&option=com_virtuemart&page=shop.cart) uses the lang i was using, the product is still in default and not in english. If i refresh that page, url works and page turns to english.