             actions.push setAction if setAction
           else
             index = key.substring(1)
-            setAction = buildSetAttributeAction(value.value, variant, index)
+            setAction = buildSetAttributeAction(value.value, variant, index, allSameValueAttributeNames)
             actions.push setAction if setAction
 
     actions
 
   # we assume that the products have the same ProductType
   # TODO: validate ProductType between products
-  actionsMapAttributes: (diff, new_obj) ->
+  actionsMapAttributes: (diff, new_obj, allSameValueAttributeNames = []) ->
     actions = []
     # masterVariant
     masterVariant = diff.masterVariant
     if masterVariant
       attributes = masterVariant.attributes
-      mActions = actionsMapVariantAttributes attributes, new_obj.masterVariant
+      mActions = actionsMapVariantAttributes attributes, new_obj.masterVariant, allSameValueAttributeNames
       actions = actions.concat mActions
 
     # variants
     if diff.variants
       _.each diff.variants, (variant, i)->
         attributes = variant.attributes
-        vActions = actionsMapVariantAttributes attributes, new_obj.variants[i]
+        vActions = actionsMapVariantAttributes attributes, new_obj.variants[i], allSameValueAttributeNames
         actions = actions.concat vActions
 
     actions


  action

buildNewSetAttributeAction = (id, el)->
  action =
    action: "setAttribute"
    variantId: id
    name: el.name
    value: el.value
  action

          else
            # key is index of attribute
            index = key
            setAction = buildSetAttributeAction(value.value, variant, index, allSameValueAttributeNames)
            actions.push setAction if setAction
        else if key.match(/^\_\d$/g)
          if _.isArray value
