Author Topic: Attribute not translating  (Read 1895 times)

Gambalunga

  • Beginner
  • *
  • Posts: 31
Attribute not translating
« on: January 26, 2011, 22:09:53 pm »
VirtueMart 1.1.6 JoomFish 2.0.4

I have discovered what seems to be a longstanding problem translating attribute_name from tables vm_product_attribute and vm_product_attribute_sku. This refers to both the attribute of the parent product that refers to the child products. Both tables us the field name attribute_name. The result is that in the drop down list to select child products everything is translated except the attribute name. In my case the Italian 'Misura' that should be translated to 'Size'

It is briefly refered to in the post below:

see http://forum.virtuemart.net/index.php?topic=16124.msg34310#msg34310

I suspect it has never been resolved.

If anyone has resoved this problem I would really like to know how.

To me it is a bug that should not be impossible to resolve. If the problem is that the field name is the same in both tables, as mentioned in the old post above, then one or the other of the field names should be changed.

Thanks
I thought I had retired but now I have discovered I am just tired

Gambalunga

  • Beginner
  • *
  • Posts: 31
Re: Attribute not translating
« Reply #1 on: January 28, 2011, 15:24:43 pm »
I managed to resolve my own question.

The fix for translating the attribute name in the drop down list was so simple as to be ridiculous. I finally discovered that JoomFish requires the primary key to translate.

In the file ..administrator\components\com_virtuemart\classes\ps_product_attribute.php at or about line 312 I modified the line
Code: [Select]
while( $db_sku->next_record() ) {
$q = "SELECT attribute_name, attribute_value, product_id " ;
(which calls everything but the primary key)
to
Code: [Select]
while( $db_sku->next_record() ) {
$q = "SELECT * " ;

I am not able to test it in all circumstances but for me it works.

I hope this is able to help someone with a similar problem and I also hope that this fix enters the distribution code.
I thought I had retired but now I have discovered I am just tired