Active
Project:
Ubercart Internationalization
Version:
6.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Mar 2012 at 20:07 UTC
Updated:
16 Mar 2012 at 17:05 UTC
Jump to comment: Most recent file
Comments
Comment #1
splash112 commentedHi 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.
Comment #2
kungfuchris commentedThanks 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?
Comment #3
kungfuchris commentedHi 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.
Comment #4
kungfuchris commentedIgnore this attached file. The previous one is the patch.
Comment #5
splash112 commentedThinking 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.