Created
February 7, 2016 09:54
-
-
Save aramboyajyan/3a55ec9f947ae758737c to your computer and use it in GitHub Desktop.
Drupal 7 Commerce empty user shopping cart programmatically
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
global $user; | |
$order = commerce_cart_order_load($user->uid); | |
commerce_cart_order_empty($order); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
commerce_cart_order_empty()
throws an exception when$order
is empty. If possible wrap a condition around commerce_cart_order_empty(). :)