Hi,

My question is how can I interfere with the default choice (which would be the 1st element I think) ? This is surely a question which interests more people.

In my particular case, I have pdf files that the user can purchase in different languages. Therefore I'd like to choose EN (english) material by default if the user is viewing the page in EN.

Please help me out on this one, as I have not much idea on how to proceed. I hope that it is possible.

Best,
michphip

Comments

rszrama’s picture

Status: Active » Closed (duplicate)

Please see hook_commerce_product_reference_default_delta_alter() documented in commerce_product_reference.api.php.

michphip’s picture

Hi

Thanks for your answer

You marked my support request as duplicate, but I don't understand of what thread it is a duplicate (there is no link?).

Did you mean to refer me to this page? https://github.com/commerceguys/kickstart-drops-7/blob/master/profiles/c...

michphip’s picture

Ok,

I have found the file in my installation and added code. It is refernenced from the module code - but how do I know if my added alter-code is being executed? So far I have no indication in the html - even if I do some debug string printing.

Thanks for any hint.

rszrama’s picture

This just comes up quite a bit; I think I answered it on the Drupal Stack Exchange most recently, but we also have the old issues in here from where we first implemented the feature.