Skip to content

Instantly share code, notes, and snippets.

@joshmiller83
Created November 16, 2015 23:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshmiller83/5e9adbdc2906cc1de552 to your computer and use it in GitHub Desktop.
Save joshmiller83/5e9adbdc2906cc1de552 to your computer and use it in GitHub Desktop.
Quickly decouple a user's current cart from Drupal Commerce 7.x
<?php
// Only meant for quick development issues where the current order
// is somehow borked.
global $user;
$order_id = commerce_cart_order_id($user->uid);
db_query("UPDATE commerce_order SET uid = 0 WHERE order_id=".$order_id)->execute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment