Created
October 1, 2013 18:53
-
-
Save heddn/6783245 to your computer and use it in GitHub Desktop.
disable commerce profile clone
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
| /** | |
| * Implements hook_entity_query_alter(). | |
| */ | |
| function ibs_services_entity_query_alter($query) { | |
| // Don't allow commerce to clone new custom profiles. | |
| // Inspired by http://www.bywombats.com/blog/04-12-2013/bypassing-drupal-commerce-customer-profile-duplication. | |
| if (isset($query->tags['commerce_order_commerce_customer_profile_can_delete'])) { | |
| $query->propertyCondition('order_id', 1); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment