Tags/topics: 
1
Answers
Vote up!
0
Vote down!

Create order programatically for anonymous users

Hello, guys. I need a help :)

I'm trying create order programmatically, following this excelent article by Ryan Szrama, and it working (almost) perfectly... Except for anonymous users :/

In that case, a "not found" page is returned and the order (as my debug) is not created.

Can anybody help me?

Thanks in advance :)

Asked by: tregismoreira
on June 21, 2013

Comments

@tregismoreira did you succeed to solve this problem? If yes, can you post a solution?

- Piotr Janiak on July 18, 2013

1 Answer

Vote up!
0
Vote down!

global $user;
$order = commerce_cart_order_new($user->uid);

Answer by: Ismail Noman
Posted: Jun 14, 2016