Skip to content

Instantly share code, notes, and snippets.

@aramboyajyan
Created February 7, 2016 09:54
Show Gist options
  • Save aramboyajyan/3a55ec9f947ae758737c to your computer and use it in GitHub Desktop.
Save aramboyajyan/3a55ec9f947ae758737c to your computer and use it in GitHub Desktop.
Drupal 7 Commerce empty user shopping cart programmatically
global $user;
$order = commerce_cart_order_load($user->uid);
commerce_cart_order_empty($order);
@JayKandari
Copy link

commerce_cart_order_empty() throws an exception when$order is empty. If possible wrap a condition around commerce_cart_order_empty(). :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment