Skip to content

Instantly share code, notes, and snippets.

@heddn
Created October 1, 2013 18:53
Show Gist options
  • Select an option

  • Save heddn/6783245 to your computer and use it in GitHub Desktop.

Select an option

Save heddn/6783245 to your computer and use it in GitHub Desktop.
disable commerce profile clone
/**
* 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