Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
rszrama CreditAttribution: rszrama commentedPlease see hook_commerce_product_reference_default_delta_alter() documented in commerce_product_reference.api.php.
Comment #2
michphip CreditAttribution: michphip commentedHi
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...
Comment #3
michphip CreditAttribution: michphip commentedOk,
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.
Comment #4
rszrama CreditAttribution: rszrama commentedThis 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.