The confirmation e-mail comes to the customer in English (when you confirm the order in VM configuration panel and send email to customer). The pending order mail (the first one) comes in the correct language. Is there a way to fix this?
I hope you can help use with it, look in FE helpers/shopfunctionsf.php function sendVmMail line 230 . There we load the language for the mails, maybe someone here of the forum can.
The other problem is that we do not store the language of the shopper in the order, so we the emails use always default language imho.
If you change the order status in backend, vm use the administrator language files for the emails. So, language overrides must be configured for site and administrator.
I think the solution for your problem is, to change the global default backend language to your language.
Please let us now if this solved your problem.
Quote from: kkmediaproduction on April 20, 2012, 14:22:11 PM
I think the solution for your problem is, to change the global default backend language to your language.
That did it, thank you for the solution. But I believe it is still a bug and needs fixing
I think indeed that this need a real solution, because in multilingual sites you don't want to change the backend language for every shopper to react upon.
Need help here!!! I'm developing a multilingual site and this is a big issue for us... can anybody give a proper solution or workaround for this?
Do you still have actually the problem? In which version then? As far as I know this is solved.
Fix :
Add a Shopper Field named 'language', title Language, type text, max-length 7, field size 7. Enable this field for users in shipment form.
Add the field to your cart/shopper_address.php template file. If you're using standard template you will need to first make sure the field won't get printed out since this needs to be a hidden field. (add an if statement to the foreach that prints out the fields).
To add the field in the shopper_address.php template file add
<input type="hidden" name="language" value="<?php echo JFactory::getLanguage()->getTag(); ?>" />
to this file.
This will cause the language of the user to get saved in the orders database.
Now we need to make sure the correct language is loaded when sending the email:
Inside helpers/shopfunctions.php, edit the sendVmMail function and add
if ($view->orderDetails['details']['BT']->language) {
$jlang->load('com_virtuemart', JPATH_SITE, $view->orderDetails['details']['BT']->language, true);
}
after the line
$jlang->load('com_virtuemart', JPATH_SITE, null, true);
That's it !
quite a complete workaround.
maybe this or something similar should be implemented in VM? Milbo, what do you think?
I have implemented a solution in core and it will be in vm 2.2
Worked for me, thanks.
When will 2.2 be rolling out?
As Cezard said:
QuoteTo add the field in the shopper_address.php template file add
Code: [Select]
<input type="hidden" name="language" value="<?php echo JFactory::getLanguage()->getTag(); ?>" />
I'm really sorry but I didn't understand where exactly paste this line.
My shopper_address.php code is:
defined('_JEXEC') or die('Restricted access');
?>
<table width="100%">
<tr>
<td width="50%" bgcolor="#ccc">
<?php echo JText::_('COM_VIRTUEMART_USER_FORM_BILLTO_LBL'); ?>
</td>
<td width="50%" bgcolor="#ccc">
<?php echo JText::_('COM_VIRTUEMART_USER_FORM_SHIPTO_LBL'); ?>
</td>
</tr>
<tr>
<td width="50%">
<?php foreach($this->BTaddress['fields'] as $item){
if(!empty($item['value'])){
echo $item['title'].': '.$this->escape($item['value']).'<br/>';
}
} ?>
</td>
<td width="50%">
<?php
if(!empty($this->STaddress['fields'])){
foreach($this->STaddress['fields'] as $item){
if(!empty($item['value'])){
echo $item['title'].': '.$this->escape($item['value']).'<br/>';
}
}
} else {
foreach($this->BTaddress['fields'] as $item){
if(!empty($item['value'])){
echo $item['title'].': '.$this->escape($item['value']).'<br/>';
}
}
} ?>
</td>
</tr>
</table>
I don't see anything recalling the right place to paste the line.
Please help me!
Nice done cezard,
I think we added it also to vm2.0.15, please check the latest version. If it is implemented.
I'm on 2.0.16 and the problem persists :(
It is solved in the next version vm 2.2 (2.1)
Quote from: kkmediaproduction on January 06, 2013, 13:59:08 PM
It is solved in the next version vm 2.2 (2.1)
How do you know that? You can see into the future?Just updated and seems the new version
2.0.18a has not fixed this issue.
Hello,
I'm trying to implement that, but this workaround is not working.
Query gives null value in language column.
SELECT u.*,o.*,
s.order_status_name
FROM s_virtuemart_orders o
LEFT JOIN s_virtuemart_orderstates s
ON s.order_status_code = o.order_status
LEFT JOIN s_virtuemart_order_userinfos u
ON u.virtuemart_order_id = o.virtuemart_order_id;
After exact spelling didn't work I've changed to:
<input type='hidden' name='language' value='<?php echo JFactory::getLanguage()->getTag(); ?>' />
but still it's not working
Tried to change in files:
components/com_virtuemart/views/cart/tmpl/default.php
components/com_virtuemart/views/cart/tmpl/shopper_adresses.php
but still no result. Could you please help me?
Regards,
Lucas
Hi Lucas,
there are changes in different core files necessary. Please wait for vm 2.2 (2.1)
We are working on different new features for this new version and the first test version will come as soon as possible.
Regards
Maik
Hello,
thank you for the quick answer! I'll be waiting for a new version. I was interested in setting parameters because there will be crucial parameter related to TAX requirement that I'll have add to invoice and if it's not going to be filled invoice won't be valid...
That is why below stated query was very important to work correctly with all parameters set.
SELECT u.*,o.*,
s.order_status_name
FROM s_virtuemart_orders o
LEFT JOIN s_virtuemart_orderstates s
ON s.order_status_code = o.order_status
LEFT JOIN s_virtuemart_order_userinfos u
ON u.virtuemart_order_id = o.virtuemart_order_id;
PS. thanks for a great Joomla extension and I would like to say new guy "welcome" to everybody :).
Regards,
Lucas
Hi,
sorry I use this old topic. I have updated to 2.0.26 therefore the latest version and the bug is still not fixed.
kkmediaproduction writes to wait for VM2.2 which should be available soon.
How can I get this version as this topic is already quite old so I hope this should be already implemented.
Thx kratzi
This is also solved in 2.0.26 since some moths. The mails are in the order language from the shopper.
[SOMEHOW SOLVED] Hi,
I have to say it took me very much time to solve. I updated to virtuemart.2.0.26d. But there are two new language English files:
en-GB.com_virtuemart_orders.ini
en-GB.com_virtuemart_shoppers.ini
From that time all Shopper field was always in English.
These files are not translated yet in the Czech translation. I don't need English too much so I simply deleted these files. Now translation forks again.
I really don't understand how such non systematic change could be made to 2.0.26d.
Anyway I have still problem to translate the name: Confirmed by shopper. I haven't find it anywhere in the "active" ENG translation but it is still there!:-)
The different language files are there since vm2.0.20, since Juli. They made all a lot easier. "confirmed by shopper" is in the FE language.
Thank you for reply.
Yes I had 2.0.20 before. I understand there was some reason to make it. I don't know too much about language translations. I can add any missing word if necessary. That is OK for me. A little problem is Joomla itself because the language overrides is too simple it don't show details.