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:

  1. Enable the i18nsync ("Synchronize Translations") module in Administer > Site building > Modules
  2. Create a custom module which will hook into i18nsync:
    1. Create the folder sites/all/modules/custommod
    2. Paste the following into sites/all/modules/custommod/custommod.info:
    3. name = Custom module
      description = A custom module which helps with the translation of an Ubercart store
      core = 6.x
      
    4. Paste into sites/all/modules/custommod/custommod.module:
    5. <?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'
          );
        }
      }
      ?>
      
  3. Go to Administer > Site building > Modules and enable "Custom module"
  4. Go to Administer > Content management > Content types and edit the "Product" content type
    1. 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)
    2. 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.

CommentFileSizeAuthor
#4 894760-uc_product-i18nsync.patch1.36 KBlongwave
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

stewart.adam’s picture

subscribing

intyms’s picture

subscribing

Gordon_Holtslander’s picture

I need to convert nodes to deal with setting up taxation properly. Can this module be tied into convert node?

longwave’s picture

Title: Ubercart doesn't synchronize product data across translated nodes (product information needs to be updated for each translation) » Synchronize product data across translated nodes
Version: 6.x-2.4 » 7.x-3.x-dev
Status: Active » Patch (to be ported)
FileSize
1.36 KB

Fix committed to 6.x-2.x-dev. Needs porting to 7.x.

longwave’s picture

Category: bug » feature
Status: Patch (to be ported) » Active

I 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.

mortician’s picture

Any update on this? I need synchronize products fields and attributes in Drupal 7 (SKU, Sell price...)

dimitriseng’s picture

I have the same requirement, is there any plan to port this to D7 please? Thank you.

wouter.dierick@gmail.com’s picture

Subscribe

zzirobcn’s picture

subscribe

kunoichi’s picture

subscribe

TR’s picture

Please don't post just to "subscribe". Instead, just press the big green "Follow" button at the top of the issue.

longwave’s picture

Status: Active » Postponed (maintainer needs more info)

I 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

Entity translation is particularly useful for content that should be language-independent and should always exist in all languages in the same state. Entities [...] that are involved in transactions (products) are good candidates for entity translation.

longwave’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

If 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!

wishining’s picture

Product attributes and options can synchronize now?