Created
January 5, 2016 16:10
-
-
Save mglaman/630b53d1ffe40f6de790 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // HINDSIGHT: Don't use presave. You'd need save (right, that exists?) | |
| function mymodule_commerce_customer_profile_save($profile) { | |
| if (isset($profile->my_custom_boolean)) { | |
| // Okay so the field was set, or exists on this bundle. | |
| if (!empty($profile->my_custom_boolean[LANGUAGE_NONE][0])) { | |
| // Okay, we have a value (double check this var) | |
| variable_set('commerce_addressbook_defaults', $profile->id); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment