verbatim from http://www.firewing1.com/node/27
As I mentioned in the introduction, this is due to the fact that each translation is in fact a node to itself. Since Drupal assigns each node with content type "product" the standard Ubercart attribute set, each product node must be updated individually. Fortunately, there is a quick and easy was to solve this by creating a custom module:
- Enable the i18nsync ("Synchronize Translations") module in Administer > Site building > Modules
- Create a custom module which will hook into i18nsync:
- Create the folder sites/all/modules/custommod
- Paste the following into sites/all/modules/custommod/custommod.info:
name = Custom module description = A custom module which helps with the translation of an Ubercart store core = 6.x
- Paste into sites/all/modules/custommod/custommod.module:
<?php /** * Implementation of hook_i18nsync_fields_alter(). */ function custommod_i18nsync_fields_alter($fields, $type) { if(in_array($type, uc_product_types())) { $fields['uc_products']['#title'] = 'Products'; // These values were found by doing a print_r($node) in node-product.tpl.php $fields['uc_products']['#options'] = array ( 'model' => 'SKU', 'list_price' => 'List Price', 'cost' => 'Cost', 'sell_price' => 'Sell Price', 'weight' => 'Weight', 'weight_units' => 'Weight Units', 'dim_length' => 'Length', 'dim_width' => 'Width', 'dim_height' => 'Height', 'length_units' => 'Length Units', 'pkg_qty' => 'Quantity', 'default_qty' => 'Default quantity to add to cart' ); } } ?>
- Go to Administer > Site building > Modules and enable "Custom module"
- Go to Administer > Content management > Content types and edit the "Product" content type
- Under Workflow Settings > Synchronize translations, select all fields you would like to synchronize. However, do not select the Taxonomy terms option (see below for why)
- Repeat this step for any other product classes/content types whose product data you want synchronized
That's all! If you edit a node in one language, you should see the updated product data in all other languages as well. The only caveat is that product attributes and product options will still need to be added and updated on each translation.
Note: As mentioned in the caveat at the bottom of the quote, this doesn't fix the lack of synchronization for product attributes and product options.
Comment | File | Size | Author |
---|---|---|---|
#4 | 894760-uc_product-i18nsync.patch | 1.36 KB | longwave |
Comments
Comment #1
stewart.adam CreditAttribution: stewart.adam commentedsubscribing
Comment #2
intyms CreditAttribution: intyms commentedsubscribing
Comment #3
Gordon_Holtslander CreditAttribution: Gordon_Holtslander commentedI need to convert nodes to deal with setting up taxation properly. Can this module be tied into convert node?
Comment #4
longwaveFix committed to 6.x-2.x-dev. Needs porting to 7.x.
Comment #5
longwaveI think we can do this a better way in 7.x by checking for tnid on product nodes and implementing the translation hooks ourselves, rather than relying on i18nsync. This is more of a feature request than a bug as well.
Comment #6
mortician CreditAttribution: mortician commentedAny update on this? I need synchronize products fields and attributes in Drupal 7 (SKU, Sell price...)
Comment #7
dimitriseng CreditAttribution: dimitriseng commentedI have the same requirement, is there any plan to port this to D7 please? Thank you.
Comment #8
wouter.dierick@gmail.com CreditAttribution: wouter.dierick@gmail.com commentedSubscribe
Comment #9
zzirobcn CreditAttribution: zzirobcn commentedsubscribe
Comment #10
kunoichi CreditAttribution: kunoichi commentedsubscribe
Comment #11
TR CreditAttribution: TR commentedPlease don't post just to "subscribe". Instead, just press the big green "Follow" button at the top of the issue.
Comment #12
longwaveI am not sure this is needed in 7.x; it is probably better to use http://drupal.org/project/entity_translation to translate product nodes.
From http://drupal.org/node/1280632
Comment #13
longwaveIf you need to translate products, please try Entity Translation first. If that doesn't work out or you need i18nsync, then reopen this issue, preferably with a patch if possible!
Comment #14
wishining CreditAttribution: wishining commentedProduct attributes and options can synchronize now?