VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: tzic on April 20, 2012, 10:49:47 AM

Title: [SOLVED Workaround] No translation in the CONFIRM email
Post by: tzic on April 20, 2012, 10:49:47 AM
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?
Title: Re: No translation in the CONFIRM email
Post by: Milbo on April 20, 2012, 13:26:18 PM
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.
Title: Re: No translation in the CONFIRM email
Post by: K&K media production on April 20, 2012, 14:22:11 PM
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.
Title: Re: No translation in the CONFIRM email
Post by: tzic on April 23, 2012, 13:17:07 PM
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
Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: digiversum on June 07, 2012, 08:56:49 AM
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.
Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: Liewilyn on September 19, 2012, 08:10:05 AM
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?
Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: Milbo on September 19, 2012, 10:01:13 AM
Do you still have actually the problem? In which version then? As far as I know this is solved.
Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: cezard on September 19, 2012, 19:50:48 PM
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 !
Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: 4est on September 20, 2012, 09:04:36 AM
quite a complete workaround.
maybe this or something similar should be implemented in VM? Milbo, what do you think?
Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: K&K media production on November 07, 2012, 11:19:56 AM
I have implemented a solution in core and it will be in vm 2.2
Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: exhost on November 29, 2012, 19:07:00 PM
Worked for me, thanks.

When will 2.2 be rolling out?
Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: neleausta on December 16, 2012, 17:19:55 PM
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!
Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: Milbo on December 16, 2012, 20:26:13 PM
Nice done cezard,

I think we added it also to vm2.0.15, please check the latest version. If it is implemented.
Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: chiappa on January 06, 2013, 12:38:05 PM
I'm on 2.0.16 and the problem persists  :(
Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: K&K media production on January 06, 2013, 13:59:08 PM
It is solved in the next version vm 2.2 (2.1)
Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: chiappa on January 20, 2013, 14:38:38 PM
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.
Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: K&K media production on January 20, 2013, 17:22:38 PM
Quote from: kkmediaproduction on November 07, 2012, 11:19:56 AM
I have implemented a solution in core and it will be in vm 2.2
Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: bacaro on January 23, 2013, 22:23:33 PM
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
Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: K&K media production on January 25, 2013, 13:06:51 PM
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

Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: bacaro on January 26, 2013, 10:21:32 AM
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
Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: kratzi on January 21, 2014, 10:14:07 AM
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
Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: K&K media production on February 10, 2014, 20:29:29 PM
This is also solved in 2.0.26 since some moths. The mails are in the order language from the shopper.
Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: tnet on March 13, 2014, 15:38:41 PM
[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!:-)
Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: Milbo on March 13, 2014, 19:49:13 PM
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.
Title: Re: [SOLVED Workaround] No translation in the CONFIRM email
Post by: tnet on March 15, 2014, 00:09:43 AM
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.