Author Topic: Virtuemart registration form country and state list tanslation  (Read 11327 times)

ctkhai

  • Beginner
  • *
  • Posts: 1
Hi everyone,

     I use joomfish to translate the registration form but I can't translate country list and state list. Is any way to translate the country list and state/province list on registration form? Thank in advance. my system is

Joomla 1.5.15
Joomfish 2.0.4
Virtuemart 1.1.4

bibibastille

  • Beginner
  • *
  • Posts: 3
Re: Virtuemart registration form country and state list tanslation
« Reply #1 on: May 19, 2010, 20:57:26 pm »
Hello,

I have the same problem did you find a solution ? did you try joomfish/translation/(choose the language of translation)/virtuemart country?

ph0enix

  • Beginner
  • *
  • Posts: 1
Re: Virtuemart registration form country and state list tanslation
« Reply #2 on: August 12, 2010, 12:07:45 pm »
You need to patch administrator/components/com_virtuemart/classes/ps_html.php

Attached patches for Virtuemart 1.1.4 and 1.1.5 (Joomla 1.5).

[attachment cleanup by admin]

_fD_

  • Jr. Member
  • **
  • Posts: 118
    • Printdesign :: Joomla! CMS Webdesign :: Apple Computer Support
Re: Virtuemart registration form country and state list tanslation
« Reply #3 on: August 12, 2010, 15:58:55 pm »
Hi Guys,

this patch is confirmed and goes into Virtuemart 1.1.6.  ;D

Thank you for the patch ph0enix.

Best regards,
_fD_

Stefanos

  • Jr. Member
  • **
  • Posts: 93
Re: Virtuemart registration form country and state list tanslation
« Reply #4 on: October 13, 2010, 03:48:48 am »
..thanks looks good and works.
.. the truth is it only translates the Country, but can wait for the next step !

cheers

lgmsampaio

  • Beginner
  • *
  • Posts: 2
Re: Virtuemart registration form country and state list tanslation
« Reply #5 on: November 04, 2010, 07:27:34 am »
Thanks ph0enix by your huge help, but doesn't solve all the problem.

The country selection is fixed, it's true, but your patch don't fix the problem about state selection.

I made some steps and it worked well. If someone else need to have states translated too, try to do the following:

  • In administrator\components\com_joomfish\contentelements create a xml file called vm_state.xml, following the same style as vm_country.xml, just replacing the values by correct field  names for this table.
  • Go to your Joom!Fish control panel and translate the states that you want
  • In the file administrator/components/com_virtuemart/classes/ps_html.php , try to find the function "dynamic_state_lists"
  • Look for the first SQL Select statement and replace by this:
Code: [Select]
SELECT s.state_id, c.country_id, c.country_3_code, s.state_name, s.state_2_code
FROM #__{vm}_country c
LEFT JOIN #__{vm}_state s
ON c.country_id=s.country_id OR s.country_id IS NULL
ORDER BY c.country_id, s.state_id

The main differences are:
1. included "s.state_name" on select return
2. changed the ORDER BY to s.state_id in place of s.state_name

Good luck!

Stefanos

  • Jr. Member
  • **
  • Posts: 93
Re: Virtuemart registration form country and state list tanslation
« Reply #6 on: November 04, 2010, 07:39:19 am »
Nice lgmsampaio thanks for that, I had already created the contentelements but I will try your change I am sure it will work. thanks again

cheers

Stefanos

  • Jr. Member
  • **
  • Posts: 93
Re: Virtuemart registration form country and state list tanslation
« Reply #7 on: November 28, 2010, 22:58:48 pm »
Hi, and congrats to the 1.1.6 update. Please correct me if I am wrong, I post this here concerning the Bug #156:
http://dev.virtuemart.net/redmine/issues/156

.. this is supposed to be fixed as stated in the changelog:
* Bug #156: Virtuemart registration form country and state list tanslation

In fact only the 1st part of this post was corrected in ps_html.php as I have tested. Meaning that in order to be able to translate the State I had to move on to lgmsampaio's reply and change.

Another short comment (not that important) is that there is no way to order the translation by "Name" of translation once I suppose the

Code: [Select]
ORDER BY c.country_id, s.state_name
.. orders the states alphabetically based on the original language and not the translated. Any ideas on this appreciated.

cheers

Wallace Campos

  • Beginner
  • *
  • Posts: 2
    • Sap Training Videos
Re: Virtuemart registration form country and state list tanslation
« Reply #8 on: January 30, 2011, 12:40:05 pm »
This is a quick tip How to  easily fix the Virtuemart Countries and States validationon, on the virtuemart user registration.

Hello,

In Virtuemart V.1.1.4 the validation of Country and State fields was not working with JS, but you can fix thus issue very easily:

1.Fin the files administrator/components/com_virtuemart/classes/ps_userfield.php

2.Open it up in your script  editor or you can use http://notepad-plus-plus.org/ 

3.Around like 695 "function: printJS_formValidation()"

4.formelement.selectedIndex.value should be changed to formelement.value
Offering all Types of Video Based Sap Training Materials Over Printed Materials. Sap Training