Hello,
I was looking for solution to sync attributes and options in ubercart. Not alot was found so I decided to write it by myself. I hope it will be useful for somebody. ;)
I haven't found how to insert here a file, so i just paste the code.
NOTE:
1. i18_sync (Synchronize translations) module should be enabled.
2. On product content type edit page there is a tab "Synchronize translations", so "Attributes" checkbox should be checked. (This checkbox will appear after creating custom module with the code below. Don't forget to clear cache.)
3. To synchronize, after making and saving changes to attributes or options you should click save button on product/edit page.

You can create a custom module with this content:

<?php
function modulename_i18n_sync_options_alter(&$fields, $entity_type, $bundle_name) {
  if(in_array($bundle_name, uc_product_types())) {
    $fields['model']        = array('title' => t('SKU'));
    $fields['list_price']   = array('title' => t('List Price'));
    $fields['cost']         = array('title' => t('Cost'));
    $fields['sell_price']   = array('title' => t('Sell Price'));
    $fields['shippable']    = array('title' => t('Product is shippable')); // doesn't work
    $fields['weight']       = array('title' => t('Weight'));
    $fields['weight_units'] = array('title' => t('Weight Units'));
    $fields['dim_length']   = array('title' => t('Length'));
    $fields['dim_width']    = array('title' => t('Width'));
    $fields['dim_height']   = array('title' => t('Height'));
    $fields['length_units'] = array('title' => t('Length Units'));
    $fields['pkg_qty']      = array('title' => t('Quantity'));
    $fields['default_qty']  = array('title' => t('Default quantity to add to cart'));
    $fields['ordering']     = array('title' => t('List position'));

    $fields['attributes']   = array('title' => t('Attributes'));
    //shipping_type
    //sshipping_address
  }
}

/**
 * Add info to db about attributes and options of new translation node.
 */
function uc_translation_node_insert($node) {
  if (!empty($node->translation_source) && ($sync_fields = i18n_sync_node_fields($node->type)) && isset($node->attributes)) {
    $source = $node->translation_source;
    $i18n_options = i18n_sync_node_options($node->type);
    foreach ($sync_fields as $field) {
      if (!empty($source->$field) && empty($i18n_options[$field]['field_name'])) {
        if ($field == 'attributes') {
          modulename_sync_attributes($node, $source);
        }
      }
    }
  }
}

/**
 * Add info to db about attributes and options on node update.
 */
function uc_translation_i18n_sync_translation($entity_type, $translation, $translation_language, $source, $source_language, $field_names) {
  // If it is not new created translation.
  if (!isset($source->translation_source)) {
    foreach ($field_names as $field) {
      if ($field == 'attributes') {
        modulename_sync_attributes($translation, $source);
      }
    }
  }
}

function modulename_sync_attributes($node, $source) {
  db_delete('uc_product_options')
    ->condition('nid', $node->nid)
    ->execute();

  db_delete('uc_product_attributes')
    ->condition('nid', $node->nid)
    ->execute();

  db_delete('uc_product_adjustments')
   ->condition('nid', $node->nid)
   ->execute();

  // Set attributes from source attributes.
  $select = db_select('uc_product_attributes', 'upa')
    ->fields('upa', array(
      'aid',
      'label',
      'ordering',
      'required',
      'display',
      'default_option',
    ))
    ->condition('nid', $source->nid);
  $select->addExpression(':nid', 'nid', array(':nid' => $node->nid));

  db_insert('uc_product_attributes')
    ->from($select)
    ->execute();

  // Set options from source options.
  $select = db_select('uc_product_options', 'upo')
    ->fields('upo', array(
      'oid',
      'cost',
      'price',
      'weight',
      'ordering',
    ))
    ->condition('nid', $source->nid);
  $select->addExpression(':nid', 'nid', array(':nid' => $node->nid));

  db_insert('uc_product_options')
    ->from($select)
    ->execute();

  // Set adjustments from source adjustments .
  $select = db_select('uc_product_adjustments', 'upadj')
    ->fields('upadj', array(
      'combination',
      'model',
    ))
    ->condition('nid', $source->nid);
  $select->addExpression(':nid', 'nid', array(':nid' => $node->nid));

  db_insert('uc_product_adjustments')
    ->from($select)
    ->execute();
}
?>

Comments

tchka’s picture

Hello,
I tried your code, and there is no "Attributes" checkbox on the "Synchronize translations" tab.
The Drupal version is 7.27, ubercart 7.x-3.6, i18n 7.x-1.10
I created and enabled the new module with the code above. Then cleared the cache.
And nothing changed on the tab "Synchronize translations" tab of product content type edit page.
May be I missed smth.
Please help to find out what can be the problem.

vandijkstef’s picture

I have exactly the same, nothing shows, nothing syncs.
Looking for a solution for almost the complete day now. Most information seems to be Drupal 6.

saerts’s picture

Worked for me! Thx!

wishining’s picture

Hello,
Sku and Price can sync,but the product attributes and options still doesn't work