Not sure if this affects anyone else, but while the module translates the attributes and options in the cart and checkout panes, invoices emailed lists the options in the default language and not the language the users was viewing the site in.

Also if using PayPal as the payment gateway, the PayPal payment page lists the attribute options in the default language and not the language the uses was viewing the site in.

Comments

splash112’s picture

Hi Chris,

Yes, this should effect everyone at this moment. The module is still only 60% finished, most of the items after the order are yet to come.

So far, the data needed to solve your problem is in uc_i18n_order_products (extra_data) where a more complete order attribute array is stored. That array could be translated and be used in invoice/Paypal and other places.

kungfuchris’s picture

Thanks splash112 for your response.

I had a look and could see the translated data in the "l_data" column. The ubercart paypal form in the uc_paypal.module gets it order data to pass to Paypal from a call to uc_order_load($order_id) in the uc_paypal_form_alter() function, which then goes on to call uc_order_module_invoke('load', $order, NULL); in the uc_order module.

I noticed the uc_i18n module implements hook_order() and in the load operation, fetches the translated data from the uc_i18n_order_products table. I was thinking that in the load operation of the implementation, a drupal_alter() e.g. drupal_alter('uc_i18n_order_attributes', $arg1); could be added so that modules could alter the data. e.g. as in my use case when I need to override the default product data attribute names and option names values with the translated values passed to paypal.

Thoughts?

kungfuchris’s picture

StatusFileSize
new440 bytes

Hi Mark,

The above works well. By adding the Drupal alter I was able to manipulated the order attributes and the translated data is being passed to PayPal and the invoices emailed has the translated attributes and options.

I have attached a patch.

kungfuchris’s picture

StatusFileSize
new760 bytes

Ignore this attached file. The previous one is the patch.

splash112’s picture

Thinking how to tackle these problems. Problem is with an order_load that it could be followed with an order_save. Overwriting the default language data in the DB.

Check the paypal-code, seems not much to do there at the moment. Might need a core patch to get that working.

The invoice might be a different story. We maybe could use the localised product name and attributes in the corresponding tokens.