Using Flags to remember not only the node, but also its attributes In our current development, running with Drupal 7, we need to let the end-user bookmark some products within a "catalog".   We will use the flag module for this. 

However, we would like the flag to remember not only the products, but its variants. Not only the node/entity itself, but also the "attributes" selected by the user.
i.e. : bookmark a T-shirt in such size / such color.  

Is there a "drupal way" to do this ? Do I need to use an extra or different module ? 

Thank you.
You could try some Rules trickery and save the attributes data to the users profile upon the flag action. However, I really think you will be best going down the custom module route because it is rather specific.

A very basic outline of the module would be something like the below:


Create your .info file to provide Drupal the details of your custom module
Create a .install file to create a db schema to contain the additional data, ensure you include a fcid row (to reference to the flag "flag_content" table).
Create your .module file with function which hooks into the flag actions with appropriate if statements to refine the scope to these products. In this function you will want to save the additional "attributes" data to your new db table with a reference to the fcid to tie them up.
While in your .module file, if flag exists you will also want to perform a hook_form_alter on the products to change the default values to that which has been stored in the database.


I know my answer is very brief with regards to build the module but that is a bit beyond the scope of an answer here and I think that highlights the Drupal Way for what you will need.