File downloads stopped working for orders by anonymous users

Posts: 37
Joined: 10/20/2007

I've got file download products working perfectly for authenticated users. At one time (early this week, when we did thorough testing), I'm positive it was working for anonymous orders too. I've read through everything I can find here on the site regarding anon file downloads and permissions seem to be set correctly. The same product works for an auth'd user purchase and then doesn't for an anonymous user.

The order goes through and is set in the workflow to completed, but the Files page under the user account shows no files available. I've tried several different products and combinations. Also, when an admin views that user's files page, no downloads are available... so it doesn't seem to be just a "viewing" permissions problem, but something to do with the file not getting associated in the first place.

Any ideas what to check?? I don't know what we possibly could have changed to make this stop working but I'm completely out of ideas.

--

Gorgeous themes for Drupal and Ubercart ~ http://www.TopNotchThemes.com

Posts: 331
Joined: 08/07/2007
Administrator

Hmm, I'm going to need some more information here. You can verify whether the user was given the download by looking on the admin's order comments on the order page. It will say "User can now download..." in the comments if the file download was granted. If it didn't there's a few things that would determine whether the download wasn't granted:

There was no uid associated with account (to clarify anonymous downloads are just transfers without being logged in. A user account still must be associated with it).

There are no files associated with the product nid (determined by query on the uc_file_products, uc_product_features, & uc_files tables).

The SKU of the product ordered doesn't match the one associated with the download feature.

The order hasn't been placed into the status specified in Product Feature settings.

That's all I can think of right now. Let me know if that helps.

--

-Shawn Conn: If the Name Don't Rhyme It Ain't Mine

Posts: 68
Joined: 01/19/2008
Uber Donor

not sure if this will help but sometimes it would take 5 minutes for the download to show up when i was testing.

Posts: 37
Joined: 10/20/2007

Thanks for the help so far. The thing that gets me is that the same product purchase works fine when done by a logged in user. I even tried making a purchase as an anonymous user, then logging in with the created account and making a purchase of the exact same product and it'd work the second time. So I think that rules out a few things.

There is no "User can now download..."

Anonymous users should be able to purchase file download products though, correct? It should be associated with the account that's created for them during the checkout.

The order shows as completed, the same order status which works when done by an authenticated user.

--

Gorgeous themes for Drupal and Ubercart ~ http://www.TopNotchThemes.com

Posts: 1139
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

So then, if an anonymous person purchases a downloadable product, how would they get access to the file? Just via a download link? Or would they still be able to login with an auto-generated username and password?

We don't allow anonymous checkout so I've never run into this issue, but I'm curious as to how it works. Is the file association process the same for anonymous and authenticated users?

stephthegeek, when you complete an order as an anonymous user, do you get the File Downloads email? (This is an option you need to check in Store Config > Notification settings, I think.

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com

Posts: 37
Joined: 10/20/2007

All anonymous purchasers get a user account created for them, either with details they supply on checkout or automatically generated if they leave it blank. One of the features I love about UC Smiling But yes, previously it would both create a download link that was sent in an email, plus after the checkout they're logged in and could access it through their account.

File association stuff is completely the same.

No, the file downloads email isn't getting sent for anons either. It's like the file doesn't *exist* for anons. It's driving me batty because I'm sure this was working a few days ago when I was testing all the permutations of after-checkout messages and emails to get all the tokens right. That's how I discovered that you couldn't actually put the file download token or UID on the after-checkout page. Soooo... I'm quite sure it was working then.

I figure it's either something really silly I've overlooked/unset or a bug uncovered by a bizarre combination of settings.

--

Gorgeous themes for Drupal and Ubercart ~ http://www.TopNotchThemes.com

Posts: 37
Joined: 10/20/2007

Here are the admin comments for two back to back orders for the same product. First one is by an anonymous user (who becomes registered automatically as #17 after this order), second is another order placed by that new account.

Date	User	Comment
03/21/2008
3:08:46 PM	-	Credit card charged: $1
03/21/2008
3:08:47 PM	-	Order created through website.



Date	User	Comment
03/21/2008
3:15:29 PM	17	Credit card charged: $1
03/21/2008
3:15:29 PM	17	User can now download the file Survey2005.pdf
03/21/2008
3:15:30 PM	-	Order created through website.

At first I figured it must be a workflow config, but both are getting set to Completed, so workflow's doing its job... it's just not then getting the file attached to the order.

--

Gorgeous themes for Drupal and Ubercart ~ http://www.TopNotchThemes.com

Posts: 1139
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

Well it's hook_order() that allows uesrs to access a file.

<?php
function uc_file_order($op, $order, $status) {
  global
$user;
 
  switch (
$op) {
    case
'update':
      if ((
$order->uid > 0) && ($order_user = user_load(array('uid' => $order->uid))) !== FALSE) {
        foreach (
$order->products as $product) {
         
$files = db_query("SELECT fp.fid, fp.pfid, model, f.filename FROM {uc_file_products} AS fp INNER JOIN {uc_product_features} AS pf ON pf.pfid = fp.pfid INNER JOIN {uc_files} as f ON f.fid = fp.fid WHERE nid = %d",$product->nid);
          while (
$file = db_fetch_object($files)) {
            if ((
$file->model == $product->model || empty($file->model)) && $status == variable_get('uc_file_default_order_status','completed')) {
             
$downloads = _user_table_action('allow',$file->fid,$order_user->uid,$file->pfid);
             
$user_downloads = (!empty($user_downloads)) ? array_merge($user_downloads,$downloads) : $downloads ;
             
$comment = (_get_dir_file_ids($file->fid)) ? t('User can now download files in the directory %dir', array('%dir' => $file->filename)) : t('User can now download the file %file', array('%file' => basename($file->filename)));
             
uc_order_comment_save($order->order_id, $user->uid, $comment);
            }
          }
        }
        if (!
is_null($user_downloads)) {
         
_email_file_download($order_user,$order,$user_downloads);
        }
      }
      break;
    default:
      break;
  }
}
?>

So you can see the line that checks the $order->uid element and then performs a user_load on the same uid, and if the result returns TRUE, it performs

<?php
_user_table_action
('allow',$file->fid,$order_user->uid,$file->pfid);
?>

Here's what that function looks like:

<?php
function _user_table_action($op, $arg1 = NULL, $arg2 = NULL, $arg3 = NULL) {

  switch (
$op) {
    case
'allow': //arg1 = file id, arg2 = user id, $arg3 = pfid
      //@return file_user objects inserted into table
     
if (!is_null($arg1) && !is_null($arg2)) {
       
$output = array();
       
$granted = time();
       
$fids = (_get_dir_file_ids($arg1)) ? _get_dir_file_ids($arg1) : array($arg1);
        foreach (
$fids as $fid) {
         
$values = array($arg1,$arg2,$arg3,"",$granted,0,serialize(array()));
         
$hash = _generate_hash($values);
         
db_query("INSERT INTO {uc_file_users} (fid, uid, pfid, `key`, granted, accessed, addresses) VALUES (%d, %d, %d, '%s', %d, %d, '%s')",$fid,$arg2,$arg3,$hash,$granted,0,serialize(array()));
         
$output[] = db_fetch_object(db_query("SELECT * FROM {uc_file_users} WHERE uid = %d AND `key` = '%s'",$arg2,$hash));
        }
      }
      return (!
is_null($output)) ? $output : FALSE;
      break;
?>
(I cut the rest of the function which isn't needed in this case).

So I guess the question to the uberdudes is, when does the uid get created? My guess is that perhaps the uc_file.module functions are getting called too early? Or there is some other issue that is not passing the $order->uid element correctly for anonymous orders.

I have yet to test anything for you but you might want to add some debug code to track the uid, before and after uc_file's hook_order().

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com

Posts: 331
Joined: 08/07/2007
Administrator

I've going through a debug session with Steph and I can confirm what's happening is the order object being passed to uc_file_order has a uid == 0. This is what's causing the problem. Unfortunately, since I'm not that familiar with the uc_cart checkout code and how workflow-NG updates when order balance == $0, I can't say for sure what is going wrong here. To do illuminate further, I placed in uc_file_order a dump for the $op value and the $order object value. This is what was printed out upon submitting an order as an anon user (payment was completed with a dummy 4111... CC):

  • HOOK ORDER ($op == load)
  • ORDER OBJECT (O:8:"stdClass":31:{s:8:"order_id";s:2:"75";s:3:"uid";s:1:"0";s:12:"order_status";s:11:"in_checkout";s:11:"order_total";s:4:"1.00";s:13:"primary_email";s:16:"123@fakeemail.com";s:19:"delivery_first_name";s:0:"";s:18:"delivery_last_name";s:0:"";s:14:"delivery_phone";s:0:"";s:16:"delivery_company";s:0:"";s:16:"delivery_street1";s:0:"";s:16:"delivery_street2";s:0:"";s:13:"delivery_city";s:0:"";s:13:"delivery_zone";s:1:"0";s:20:"delivery_postal_code";s:0:"";s:16:"delivery_country";s:3:"840";s:18:"billing_first_name";s:5:"Shawn";s:17:"billing_last_name";s:4:"Conn";s:13:"billing_phone";s:0:"";s:15:"billing_company";s:0:"";s:15:"billing_street1";s:16:"123 Fake Street";s:15:"billing_street2";s:0:"";s:12:"billing_city";s:14:"Jeffersonville";s:12:"billing_zone";s:2:"24";s:19:"billing_postal_code";s:5:"47130";s:15:"billing_country";s:3:"840";s:14:"payment_method";s:6:"credit";s:4:"data";a:1:{s:8:"new_user";a:2:{s:4:"name";s:10:"ShawnTest3";s:4:"pass";s:4:"test";}}s:7:"created";s:10:"1206307607";s:8:"modified";s:10:"1206307607";s:8:"products";a:1:{i:0;O:8:"stdClass":11:{s:16:"order_product_id";s:3:"108";s:8:"order_id";s:2:"75";s:3:"nid";s:3:"207";s:5:"title";s:6:"hdtfgn";s:12:"manufacturer";s:0:"";s:5:"model";s:3:"431";s:3:"qty";s:1:"1";s:4:"cost";s:4:"0.00";s:5:"price";s:4:"1.00";s:6:"weight";s:1:"0";s:4:"data";a:4:{s:10:"attributes";a:0:{}s:5:"model";N;s:6:"module";s:10:"uc_product";s:9:"shippable";s:1:"0";}}}s:15:"payment_details";a:7:{s:7:"cc_type";s:4:"Visa";s:8:"cc_owner";s:10:"Shawn Conn";s:9:"cc_number";s:16:"4111111111111111";s:12:"cc_exp_month";s:1:"8";s:11:"cc_exp_year";s:4:"2008";s:6:"cc_cvv";s:3:"111";s:7:"cc_bank";N;}})
  • HOOK ORDER ($op == total)
  • ORDER OBJECT (O:8:"stdClass":32:{s:8:"order_id";s:2:"75";s:3:"uid";s:1:"0";s:12:"order_status";s:11:"in_checkout";s:11:"order_total";s:4:"1.00";s:13:"primary_email";s:16:"123@fakeemail.com";s:19:"delivery_first_name";s:0:"";s:18:"delivery_last_name";s:0:"";s:14:"delivery_phone";s:0:"";s:16:"delivery_company";s:0:"";s:16:"delivery_street1";s:0:"";s:16:"delivery_street2";s:0:"";s:13:"delivery_city";s:0:"";s:13:"delivery_zone";s:1:"0";s:20:"delivery_postal_code";s:0:"";s:16:"delivery_country";s:3:"840";s:18:"billing_first_name";s:5:"Shawn";s:17:"billing_last_name";s:4:"Conn";s:13:"billing_phone";s:0:"";s:15:"billing_company";s:0:"";s:15:"billing_street1";s:16:"123 Fake Street";s:15:"billing_street2";s:0:"";s:12:"billing_city";s:14:"Jeffersonville";s:12:"billing_zone";s:2:"24";s:19:"billing_postal_code";s:5:"47130";s:15:"billing_country";s:3:"840";s:14:"payment_method";s:6:"credit";s:4:"data";a:1:{s:8:"new_user";a:2:{s:4:"name";s:10:"ShawnTest3";s:4:"pass";s:4:"test";}}s:7:"created";s:10:"1206307607";s:8:"modified";s:10:"1206307607";s:8:"products";a:1:{i:0;O:8:"stdClass":11:{s:16:"order_product_id";s:3:"108";s:8:"order_id";s:2:"75";s:3:"nid";s:3:"207";s:5:"title";s:6:"hdtfgn";s:12:"manufacturer";s:0:"";s:5:"model";s:3:"431";s:3:"qty";s:1:"1";s:4:"cost";s:4:"0.00";s:5:"price";s:4:"1.00";s:6:"weight";s:1:"0";s:4:"data";a:4:{s:10:"attributes";a:0:{}s:5:"model";N;s:6:"module";s:10:"uc_product";s:9:"shippable";s:1:"0";}}}s:15:"payment_details";a:7:{s:7:"cc_type";s:4:"Visa";s:8:"cc_owner";s:10:"Shawn Conn";s:9:"cc_number";s:16:"4111111111111111";s:12:"cc_exp_month";s:1:"8";s:11:"cc_exp_year";s:4:"2008";s:6:"cc_cvv";s:3:"111";s:7:"cc_bank";N;}s:10:"line_items";a:1:{i:0;a:5:{s:12:"line_item_id";s:8:"subtotal";s:4:"type";s:8:"subtotal";s:5:"title";s:8:"Subtotal";s:6:"amount";d:1;s:6:"weight";i:0;}}})
  • HOOK ORDER ($op == load)
  • ORDER OBJECT (O:8:"stdClass":31:{s:8:"order_id";s:2:"75";s:3:"uid";s:1:"0";s:12:"order_status";s:11:"in_checkout";s:11:"order_total";s:4:"1.00";s:13:"primary_email";s:16:"123@fakeemail.com";s:19:"delivery_first_name";s:0:"";s:18:"delivery_last_name";s:0:"";s:14:"delivery_phone";s:0:"";s:16:"delivery_company";s:0:"";s:16:"delivery_street1";s:0:"";s:16:"delivery_street2";s:0:"";s:13:"delivery_city";s:0:"";s:13:"delivery_zone";s:1:"0";s:20:"delivery_postal_code";s:0:"";s:16:"delivery_country";s:3:"840";s:18:"billing_first_name";s:5:"Shawn";s:17:"billing_last_name";s:4:"Conn";s:13:"billing_phone";s:0:"";s:15:"billing_company";s:0:"";s:15:"billing_street1";s:16:"123 Fake Street";s:15:"billing_street2";s:0:"";s:12:"billing_city";s:14:"Jeffersonville";s:12:"billing_zone";s:2:"24";s:19:"billing_postal_code";s:5:"47130";s:15:"billing_country";s:3:"840";s:14:"payment_method";s:6:"credit";s:4:"data";a:1:{s:8:"new_user";a:2:{s:4:"name";s:10:"ShawnTest3";s:4:"pass";s:4:"test";}}s:7:"created";s:10:"1206307607";s:8:"modified";s:10:"1206307607";s:8:"products";a:1:{i:0;O:8:"stdClass":11:{s:16:"order_product_id";s:3:"108";s:8:"order_id";s:2:"75";s:3:"nid";s:3:"207";s:5:"title";s:6:"hdtfgn";s:12:"manufacturer";s:0:"";s:5:"model";s:3:"431";s:3:"qty";s:1:"1";s:4:"cost";s:4:"0.00";s:5:"price";s:4:"1.00";s:6:"weight";s:1:"0";s:4:"data";a:4:{s:10:"attributes";a:0:{}s:5:"model";N;s:6:"module";s:10:"uc_product";s:9:"shippable";s:1:"0";}}}s:15:"payment_details";a:7:{s:7:"cc_type";s:4:"Visa";s:8:"cc_owner";s:10:"Shawn Conn";s:9:"cc_number";s:16:"4111111111111111";s:12:"cc_exp_month";s:1:"8";s:11:"cc_exp_year";s:4:"2008";s:6:"cc_cvv";s:3:"111";s:7:"cc_bank";N;}})
  • HOOK ORDER ($op == total)
  • ORDER OBJECT (O:8:"stdClass":32:{s:8:"order_id";s:2:"75";s:3:"uid";s:1:"0";s:12:"order_status";s:11:"in_checkout";s:11:"order_total";s:4:"1.00";s:13:"primary_email";s:16:"123@fakeemail.com";s:19:"delivery_first_name";s:0:"";s:18:"delivery_last_name";s:0:"";s:14:"delivery_phone";s:0:"";s:16:"delivery_company";s:0:"";s:16:"delivery_street1";s:0:"";s:16:"delivery_street2";s:0:"";s:13:"delivery_city";s:0:"";s:13:"delivery_zone";s:1:"0";s:20:"delivery_postal_code";s:0:"";s:16:"delivery_country";s:3:"840";s:18:"billing_first_name";s:5:"Shawn";s:17:"billing_last_name";s:4:"Conn";s:13:"billing_phone";s:0:"";s:15:"billing_company";s:0:"";s:15:"billing_street1";s:16:"123 Fake Street";s:15:"billing_street2";s:0:"";s:12:"billing_city";s:14:"Jeffersonville";s:12:"billing_zone";s:2:"24";s:19:"billing_postal_code";s:5:"47130";s:15:"billing_country";s:3:"840";s:14:"payment_method";s:6:"credit";s:4:"data";a:1:{s:8:"new_user";a:2:{s:4:"name";s:10:"ShawnTest3";s:4:"pass";s:4:"test";}}s:7:"created";s:10:"1206307607";s:8:"modified";s:10:"1206307607";s:8:"products";a:1:{i:0;O:8:"stdClass":11:{s:16:"order_product_id";s:3:"108";s:8:"order_id";s:2:"75";s:3:"nid";s:3:"207";s:5:"title";s:6:"hdtfgn";s:12:"manufacturer";s:0:"";s:5:"model";s:3:"431";s:3:"qty";s:1:"1";s:4:"cost";s:4:"0.00";s:5:"price";s:4:"1.00";s:6:"weight";s:1:"0";s:4:"data";a:4:{s:10:"attributes";a:0:{}s:5:"model";N;s:6:"module";s:10:"uc_product";s:9:"shippable";s:1:"0";}}}s:15:"payment_details";a:7:{s:7:"cc_type";s:4:"Visa";s:8:"cc_owner";s:10:"Shawn Conn";s:9:"cc_number";s:16:"4111111111111111";s:12:"cc_exp_month";s:1:"8";s:11:"cc_exp_year";s:4:"2008";s:6:"cc_cvv";s:3:"111";s:7:"cc_bank";N;}s:10:"line_items";a:1:{i:0;a:5:{s:12:"line_item_id";s:8:"subtotal";s:4:"type";s:8:"subtotal";s:5:"title";s:8:"Subtotal";s:6:"amount";d:1;s:6:"weight";i:0;}}})
  • HOOK ORDER ($op == load)
  • ORDER OBJECT (O:8:"stdClass":31:{s:8:"order_id";s:2:"75";s:3:"uid";s:1:"0";s:12:"order_status";s:11:"in_checkout";s:11:"order_total";s:4:"1.00";s:13:"primary_email";s:16:"123@fakeemail.com";s:19:"delivery_first_name";s:0:"";s:18:"delivery_last_name";s:0:"";s:14:"delivery_phone";s:0:"";s:16:"delivery_company";s:0:"";s:16:"delivery_street1";s:0:"";s:16:"delivery_street2";s:0:"";s:13:"delivery_city";s:0:"";s:13:"delivery_zone";s:1:"0";s:20:"delivery_postal_code";s:0:"";s:16:"delivery_country";s:3:"840";s:18:"billing_first_name";s:5:"Shawn";s:17:"billing_last_name";s:4:"Conn";s:13:"billing_phone";s:0:"";s:15:"billing_company";s:0:"";s:15:"billing_street1";s:16:"123 Fake Street";s:15:"billing_street2";s:0:"";s:12:"billing_city";s:14:"Jeffersonville";s:12:"billing_zone";s:2:"24";s:19:"billing_postal_code";s:5:"47130";s:15:"billing_country";s:3:"840";s:14:"payment_method";s:6:"credit";s:4:"data";a:1:{s:8:"new_user";a:2:{s:4:"name";s:10:"ShawnTest3";s:4:"pass";s:4:"test";}}s:7:"created";s:10:"1206307607";s:8:"modified";s:10:"1206307607";s:8:"products";a:1:{i:0;O:8:"stdClass":11:{s:16:"order_product_id";s:3:"108";s:8:"order_id";s:2:"75";s:3:"nid";s:3:"207";s:5:"title";s:6:"hdtfgn";s:12:"manufacturer";s:0:"";s:5:"model";s:3:"431";s:3:"qty";s:1:"1";s:4:"cost";s:4:"0.00";s:5:"price";s:4:"1.00";s:6:"weight";s:1:"0";s:4:"data";a:4:{s:10:"attributes";a:0:{}s:5:"model";N;s:6:"module";s:10:"uc_product";s:9:"shippable";s:1:"0";}}}s:15:"payment_details";a:7:{s:7:"cc_type";s:4:"Visa";s:8:"cc_owner";s:10:"Shawn Conn";s:9:"cc_number";s:16:"4111111111111111";s:12:"cc_exp_month";s:1:"8";s:11:"cc_exp_year";s:4:"2008";s:6:"cc_cvv";s:3:"111";s:7:"cc_bank";N;}})
  • HOOK ORDER ($op == total)
  • ORDER OBJECT (O:8:"stdClass":32:{s:8:"order_id";s:2:"75";s:3:"uid";s:1:"0";s:12:"order_status";s:11:"in_checkout";s:11:"order_total";s:4:"1.00";s:13:"primary_email";s:16:"123@fakeemail.com";s:19:"delivery_first_name";s:0:"";s:18:"delivery_last_name";s:0:"";s:14:"delivery_phone";s:0:"";s:16:"delivery_company";s:0:"";s:16:"delivery_street1";s:0:"";s:16:"delivery_street2";s:0:"";s:13:"delivery_city";s:0:"";s:13:"delivery_zone";s:1:"0";s:20:"delivery_postal_code";s:0:"";s:16:"delivery_country";s:3:"840";s:18:"billing_first_name";s:5:"Shawn";s:17:"billing_last_name";s:4:"Conn";s:13:"billing_phone";s:0:"";s:15:"billing_company";s:0:"";s:15:"billing_street1";s:16:"123 Fake Street";s:15:"billing_street2";s:0:"";s:12:"billing_city";s:14:"Jeffersonville";s:12:"billing_zone";s:2:"24";s:19:"billing_postal_code";s:5:"47130";s:15:"billing_country";s:3:"840";s:14:"payment_method";s:6:"credit";s:4:"data";a:1:{s:8:"new_user";a:2:{s:4:"name";s:10:"ShawnTest3";s:4:"pass";s:4:"test";}}s:7:"created";s:10:"1206307607";s:8:"modified";s:10:"1206307607";s:8:"products";a:1:{i:0;O:8:"stdClass":11:{s:16:"order_product_id";s:3:"108";s:8:"order_id";s:2:"75";s:3:"nid";s:3:"207";s:5:"title";s:6:"hdtfgn";s:12:"manufacturer";s:0:"";s:5:"model";s:3:"431";s:3:"qty";s:1:"1";s:4:"cost";s:4:"0.00";s:5:"price";s:4:"1.00";s:6:"weight";s:1:"0";s:4:"data";a:4:{s:10:"attributes";a:0:{}s:5:"model";N;s:6:"module";s:10:"uc_product";s:9:"shippable";s:1:"0";}}}s:15:"payment_details";a:7:{s:7:"cc_type";s:4:"Visa";s:8:"cc_owner";s:10:"Shawn Conn";s:9:"cc_number";s:16:"4111111111111111";s:12:"cc_exp_month";s:1:"8";s:11:"cc_exp_year";s:4:"2008";s:6:"cc_cvv";s:3:"111";s:7:"cc_bank";N;}s:10:"line_items";a:1:{i:0;a:5:{s:12:"line_item_id";s:8:"subtotal";s:4:"type";s:8:"subtotal";s:5:"title";s:8:"Subtotal";s:6:"amount";d:1;s:6:"weight";i:0;}}})
  • HOOK ORDER ($op == load)
  • ORDER OBJECT (O:8:"stdClass":31:{s:8:"order_id";s:2:"75";s:3:"uid";s:1:"0";s:12:"order_status";s:11:"in_checkout";s:11:"order_total";s:4:"1.00";s:13:"primary_email";s:16:"123@fakeemail.com";s:19:"delivery_first_name";s:0:"";s:18:"delivery_last_name";s:0:"";s:14:"delivery_phone";s:0:"";s:16:"delivery_company";s:0:"";s:16:"delivery_street1";s:0:"";s:16:"delivery_street2";s:0:"";s:13:"delivery_city";s:0:"";s:13:"delivery_zone";s:1:"0";s:20:"delivery_postal_code";s:0:"";s:16:"delivery_country";s:3:"840";s:18:"billing_first_name";s:5:"Shawn";s:17:"billing_last_name";s:4:"Conn";s:13:"billing_phone";s:0:"";s:15:"billing_company";s:0:"";s:15:"billing_street1";s:16:"123 Fake Street";s:15:"billing_street2";s:0:"";s:12:"billing_city";s:14:"Jeffersonville";s:12:"billing_zone";s:2:"24";s:19:"billing_postal_code";s:5:"47130";s:15:"billing_country";s:3:"840";s:14:"payment_method";s:6:"credit";s:4:"data";a:1:{s:8:"new_user";a:2:{s:4:"name";s:10:"ShawnTest3";s:4:"pass";s:4:"test";}}s:7:"created";s:10:"1206307607";s:8:"modified";s:10:"1206307607";s:8:"products";a:1:{i:0;O:8:"stdClass":11:{s:16:"order_product_id";s:3:"108";s:8:"order_id";s:2:"75";s:3:"nid";s:3:"207";s:5:"title";s:6:"hdtfgn";s:12:"manufacturer";s:0:"";s:5:"model";s:3:"431";s:3:"qty";s:1:"1";s:4:"cost";s:4:"0.00";s:5:"price";s:4:"1.00";s:6:"weight";s:1:"0";s:4:"data";a:4:{s:10:"attributes";a:0:{}s:5:"model";N;s:6:"module";s:10:"uc_product";s:9:"shippable";s:1:"0";}}}s:15:"payment_details";a:7:{s:7:"cc_type";s:4:"Visa";s:8:"cc_owner";s:10:"Shawn Conn";s:9:"cc_number";s:16:"4111111111111111";s:12:"cc_exp_month";s:1:"8";s:11:"cc_exp_year";s:4:"2008";s:6:"cc_cvv";s:3:"111";s:7:"cc_bank";N;}})
  • HOOK ORDER ($op == total)
  • ORDER OBJECT (O:8:"stdClass":32:{s:8:"order_id";s:2:"75";s:3:"uid";s:1:"0";s:12:"order_status";s:11:"in_checkout";s:11:"order_total";s:4:"1.00";s:13:"primary_email";s:16:"123@fakeemail.com";s:19:"delivery_first_name";s:0:"";s:18:"delivery_last_name";s:0:"";s:14:"delivery_phone";s:0:"";s:16:"delivery_company";s:0:"";s:16:"delivery_street1";s:0:"";s:16:"delivery_street2";s:0:"";s:13:"delivery_city";s:0:"";s:13:"delivery_zone";s:1:"0";s:20:"delivery_postal_code";s:0:"";s:16:"delivery_country";s:3:"840";s:18:"billing_first_name";s:5:"Shawn";s:17:"billing_last_name";s:4:"Conn";s:13:"billing_phone";s:0:"";s:15:"billing_company";s:0:"";s:15:"billing_street1";s:16:"123 Fake Street";s:15:"billing_street2";s:0:"";s:12:"billing_city";s:14:"Jeffersonville";s:12:"billing_zone";s:2:"24";s:19:"billing_postal_code";s:5:"47130";s:15:"billing_country";s:3:"840";s:14:"payment_method";s:6:"credit";s:4:"data";a:1:{s:8:"new_user";a:2:{s:4:"name";s:10:"ShawnTest3";s:4:"pass";s:4:"test";}}s:7:"created";s:10:"1206307607";s:8:"modified";s:10:"1206307607";s:8:"products";a:1:{i:0;O:8:"stdClass":11:{s:16:"order_product_id";s:3:"108";s:8:"order_id";s:2:"75";s:3:"nid";s:3:"207";s:5:"title";s:6:"hdtfgn";s:12:"manufacturer";s:0:"";s:5:"model";s:3:"431";s:3:"qty";s:1:"1";s:4:"cost";s:4:"0.00";s:5:"price";s:4:"1.00";s:6:"weight";s:1:"0";s:4:"data";a:4:{s:10:"attributes";a:0:{}s:5:"model";N;s:6:"module";s:10:"uc_product";s:9:"shippable";s:1:"0";}}}s:15:"payment_details";a:7:{s:7:"cc_type";s:4:"Visa";s:8:"cc_owner";s:10:"Shawn Conn";s:9:"cc_number";s:16:"4111111111111111";s:12:"cc_exp_month";s:1:"8";s:11:"cc_exp_year";s:4:"2008";s:6:"cc_cvv";s:3:"111";s:7:"cc_bank";N;}s:10:"line_items";a:1:{i:0;a:5:{s:12:"line_item_id";s:8:"subtotal";s:4:"type";s:8:"subtotal";s:5:"title";s:8:"Subtotal";s:6:"amount";d:1;s:6:"weight";i:0;}}})
  • HOOK ORDER ($op == load)
  • ORDER OBJECT (O:8:"stdClass":31:{s:8:"order_id";s:2:"75";s:3:"uid";s:1:"0";s:12:"order_status";s:11:"in_checkout";s:11:"order_total";s:4:"1.00";s:13:"primary_email";s:16:"123@fakeemail.com";s:19:"delivery_first_name";s:0:"";s:18:"delivery_last_name";s:0:"";s:14:"delivery_phone";s:0:"";s:16:"delivery_company";s:0:"";s:16:"delivery_street1";s:0:"";s:16:"delivery_street2";s:0:"";s:13:"delivery_city";s:0:"";s:13:"delivery_zone";s:1:"0";s:20:"delivery_postal_code";s:0:"";s:16:"delivery_country";s:3:"840";s:18:"billing_first_name";s:5:"Shawn";s:17:"billing_last_name";s:4:"Conn";s:13:"billing_phone";s:0:"";s:15:"billing_company";s:0:"";s:15:"billing_street1";s:16:"123 Fake Street";s:15:"billing_street2";s:0:"";s:12:"billing_city";s:14:"Jeffersonville";s:12:"billing_zone";s:2:"24";s:19:"billing_postal_code";s:5:"47130";s:15:"billing_country";s:3:"840";s:14:"payment_method";s:6:"credit";s:4:"data";a:1:{s:8:"new_user";a:2:{s:4:"name";s:10:"ShawnTest3";s:4:"pass";s:4:"test";}}s:7:"created";s:10:"1206307607";s:8:"modified";s:10:"1206307607";s:8:"products";a:1:{i:0;O:8:"stdClass":11:{s:16:"order_product_id";s:3:"108";s:8:"order_id";s:2:"75";s:3:"nid";s:3:"207";s:5:"title";s:6:"hdtfgn";s:12:"manufacturer";s:0:"";s:5:"model";s:3:"431";s:3:"qty";s:1:"1";s:4:"cost";s:4:"0.00";s:5:"price";s:4:"1.00";s:6:"weight";s:1:"0";s:4:"data";a:4:{s:10:"attributes";a:0:{}s:5:"model";N;s:6:"module";s:10:"uc_product";s:9:"shippable";s:1:"0";}}}s:15:"payment_details";a:7:{s:7:"cc_type";s:4:"Visa";s:8:"cc_owner";s:10:"Shawn Conn";s:9:"cc_number";s:16:"4111111111111111";s:12:"cc_exp_month";s:1:"8";s:11:"cc_exp_year";s:4:"2008";s:6:"cc_cvv";s:3:"111";s:7:"cc_bank";N;}})
  • HOOK ORDER ($op == total)
  • ORDER OBJECT (O:8:"stdClass":32:{s:8:"order_id";s:2:"75";s:3:"uid";s:1:"0";s:12:"order_status";s:11:"in_checkout";s:11:"order_total";s:4:"1.00";s:13:"primary_email";s:16:"123@fakeemail.com";s:19:"delivery_first_name";s:0:"";s:18:"delivery_last_name";s:0:"";s:14:"delivery_phone";s:0:"";s:16:"delivery_company";s:0:"";s:16:"delivery_street1";s:0:"";s:16:"delivery_street2";s:0:"";s:13:"delivery_city";s:0:"";s:13:"delivery_zone";s:1:"0";s:20:"delivery_postal_code";s:0:"";s:16:"delivery_country";s:3:"840";s:18:"billing_first_name";s:5:"Shawn";s:17:"billing_last_name";s:4:"Conn";s:13:"billing_phone";s:0:"";s:15:"billing_company";s:0:"";s:15:"billing_street1";s:16:"123 Fake Street";s:15:"billing_street2";s:0:"";s:12:"billing_city";s:14:"Jeffersonville";s:12:"billing_zone";s:2:"24";s:19:"billing_postal_code";s:5:"47130";s:15:"billing_country";s:3:"840";s:14:"payment_method";s:6:"credit";s:4:"data";a:1:{s:8:"new_user";a:2:{s:4:"name";s:10:"ShawnTest3";s:4:"pass";s:4:"test";}}s:7:"created";s:10:"1206307607";s:8:"modified";s:10:"1206307607";s:8:"products";a:1:{i:0;O:8:"stdClass":11:{s:16:"order_product_id";s:3:"108";s:8:"order_id";s:2:"75";s:3:"nid";s:3:"207";s:5:"title";s:6:"hdtfgn";s:12:"manufacturer";s:0:"";s:5:"model";s:3:"431";s:3:"qty";s:1:"1";s:4:"cost";s:4:"0.00";s:5:"price";s:4:"1.00";s:6:"weight";s:1:"0";s:4:"data";a:4:{s:10:"attributes";a:0:{}s:5:"model";N;s:6:"module";s:10:"uc_product";s:9:"shippable";s:1:"0";}}}s:15:"payment_details";a:7:{s:7:"cc_type";s:4:"Visa";s:8:"cc_owner";s:10:"Shawn Conn";s:9:"cc_number";s:16:"4111111111111111";s:12:"cc_exp_month";s:1:"8";s:11:"cc_exp_year";s:4:"2008";s:6:"cc_cvv";s:3:"111";s:7:"cc_bank";N;}s:10:"line_items";a:1:{i:0;a:5:{s:12:"line_item_id";s:8:"subtotal";s:4:"type";s:8:"subtotal";s:5:"title";s:8:"Subtotal";s:6:"amount";d:1;s:6:"weight";i:0;}}})
  • HOOK ORDER ($op == can_update)
  • ORDER OBJECT (O:8:"stdClass":32:{s:8:"order_id";s:2:"75";s:3:"uid";s:1:"0";s:12:"order_status";s:11:"in_checkout";s:11:"order_total";s:4:"1.00";s:13:"primary_email";s:16:"123@fakeemail.com";s:19:"delivery_first_name";s:0:"";s:18:"delivery_last_name";s:0:"";s:14:"delivery_phone";s:0:"";s:16:"delivery_company";s:0:"";s:16:"delivery_street1";s:0:"";s:16:"delivery_street2";s:0:"";s:13:"delivery_city";s:0:"";s:13:"delivery_zone";s:1:"0";s:20:"delivery_postal_code";s:0:"";s:16:"delivery_country";s:3:"840";s:18:"billing_first_name";s:5:"Shawn";s:17:"billing_last_name";s:4:"Conn";s:13:"billing_phone";s:0:"";s:15:"billing_company";s:0:"";s:15:"billing_street1";s:16:"123 Fake Street";s:15:"billing_street2";s:0:"";s:12:"billing_city";s:14:"Jeffersonville";s:12:"billing_zone";s:2:"24";s:19:"billing_postal_code";s:5:"47130";s:15:"billing_country";s:3:"840";s:14:"payment_method";s:6:"credit";s:4:"data";a:1:{s:8:"new_user";a:2:{s:4:"name";s:10:"ShawnTest3";s:4:"pass";s:4:"test";}}s:7:"created";s:10:"1206307607";s:8:"modified";s:10:"1206307607";s:8:"products";a:1:{i:0;O:8:"stdClass":11:{s:16:"order_product_id";s:3:"108";s:8:"order_id";s:2:"75";s:3:"nid";s:3:"207";s:5:"title";s:6:"hdtfgn";s:12:"manufacturer";s:0:"";s:5:"model";s:3:"431";s:3:"qty";s:1:"1";s:4:"cost";s:4:"0.00";s:5:"price";s:4:"1.00";s:6:"weight";s:1:"0";s:4:"data";a:4:{s:10:"attributes";a:0:{}s:5:"model";N;s:6:"module";s:10:"uc_product";s:9:"shippable";s:1:"0";}}}s:15:"payment_details";a:7:{s:7:"cc_type";s:4:"Visa";s:8:"cc_owner";s:10:"Shawn Conn";s:9:"cc_number";s:16:"4111111111111111";s:12:"cc_exp_month";s:1:"8";s:11:"cc_exp_year";s:4:"2008";s:6:"cc_cvv";s:3:"111";s:7:"cc_bank";N;}s:10:"line_items";a:1:{i:0;a:5:{s:12:"line_item_id";s:8:"subtotal";s:4:"type";s:8:"subtotal";s:5:"title";s:8:"Subtotal";s:6:"amount";d:1;s:6:"weight";i:0;}}})
  • HOOK ORDER ($op == update)
  • ORDER OBJECT (O:8:"stdClass":32:{s:8:"order_id";s:2:"75";s:3:"uid";s:1:"0";s:12:"order_status";s:11:"in_checkout";s:11:"order_total";s:4:"1.00";s:13:"primary_email";s:16:"123@fakeemail.com";s:19:"delivery_first_name";s:0:"";s:18:"delivery_last_name";s:0:"";s:14:"delivery_phone";s:0:"";s:16:"delivery_company";s:0:"";s:16:"delivery_street1";s:0:"";s:16:"delivery_street2";s:0:"";s:13:"delivery_city";s:0:"";s:13:"delivery_zone";s:1:"0";s:20:"delivery_postal_code";s:0:"";s:16:"delivery_country";s:3:"840";s:18:"billing_first_name";s:5:"Shawn";s:17:"billing_last_name";s:4:"Conn";s:13:"billing_phone";s:0:"";s:15:"billing_company";s:0:"";s:15:"billing_street1";s:16:"123 Fake Street";s:15:"billing_street2";s:0:"";s:12:"billing_city";s:14:"Jeffersonville";s:12:"billing_zone";s:2:"24";s:19:"billing_postal_code";s:5:"47130";s:15:"billing_country";s:3:"840";s:14:"payment_method";s:6:"credit";s:4:"data";a:1:{s:8:"new_user";a:2:{s:4:"name";s:10:"ShawnTest3";s:4:"pass";s:4:"test";}}s:7:"created";s:10:"1206307607";s:8:"modified";s:10:"1206307607";s:8:"products";a:1:{i:0;O:8:"stdClass":11:{s:16:"order_product_id";s:3:"108";s:8:"order_id";s:2:"75";s:3:"nid";s:3:"207";s:5:"title";s:6:"hdtfgn";s:12:"manufacturer";s:0:"";s:5:"model";s:3:"431";s:3:"qty";s:1:"1";s:4:"cost";s:4:"0.00";s:5:"price";s:4:"1.00";s:6:"weight";s:1:"0";s:4:"data";a:4:{s:10:"attributes";a:0:{}s:5:"model";N;s:6:"module";s:10:"uc_product";s:9:"shippable";s:1:"0";}}}s:15:"payment_details";a:7:{s:7:"cc_type";s:4:"Visa";s:8:"cc_owner";s:10:"Shawn Conn";s:9:"cc_number";s:16:"4111111111111111";s:12:"cc_exp_month";s:1:"8";s:11:"cc_exp_year";s:4:"2008";s:6:"cc_cvv";s:3:"111";s:7:"cc_bank";N;}s:10:"line_items";a:1:{i:0;a:5:{s:12:"line_item_id";s:8:"subtotal";s:4:"type";s:8:"subtotal";s:5:"title";s:8:"Subtotal";s:6:"amount";d:1;s:6:"weight";i:0;}}})
  • HOOK ORDER UPDATE (USER ID 0)
  • HOOK ORDER ($op == total)
  • ORDER OBJECT (O:8:"stdClass":32:{s:8:"order_id";s:2:"75";s:3:"uid";s:1:"0";s:12:"order_status";s:11:"in_checkout";s:11:"order_total";s:4:"1.00";s:13:"primary_email";s:16:"123@fakeemail.com";s:19:"delivery_first_name";s:0:"";s:18:"delivery_last_name";s:0:"";s:14:"delivery_phone";s:0:"";s:16:"delivery_company";s:0:"";s:16:"delivery_street1";s:0:"";s:16:"delivery_street2";s:0:"";s:13:"delivery_city";s:0:"";s:13:"delivery_zone";s:1:"0";s:20:"delivery_postal_code";s:0:"";s:16:"delivery_country";s:3:"840";s:18:"billing_first_name";s:5:"Shawn";s:17:"billing_last_name";s:4:"Conn";s:13:"billing_phone";s:0:"";s:15:"billing_company";s:0:"";s:15:"billing_street1";s:16:"123 Fake Street";s:15:"billing_street2";s:0:"";s:12:"billing_city";s:14:"Jeffersonville";s:12:"billing_zone";s:2:"24";s:19:"billing_postal_code";s:5:"47130";s:15:"billing_country";s:3:"840";s:14:"payment_method";s:6:"credit";s:4:"data";a:1:{s:8:"new_user";a:2:{s:4:"name";s:10:"ShawnTest3";s:4:"pass";s:4:"test";}}s:7:"created";s:10:"1206307607";s:8:"modified";s:10:"1206307607";s:8:"products";a:1:{i:0;O:8:"stdClass":11:{s:16:"order_product_id";s:3:"108";s:8:"order_id";s:2:"75";s:3:"nid";s:3:"207";s:5:"title";s:6:"hdtfgn";s:12:"manufacturer";s:0:"";s:5:"model";s:3:"431";s:3:"qty";s:1:"1";s:4:"cost";s:4:"0.00";s:5:"price";s:4:"1.00";s:6:"weight";s:1:"0";s:4:"data";a:4:{s:10:"attributes";a:0:{}s:5:"model";N;s:6:"module";s:10:"uc_product";s:9:"shippable";s:1:"0";}}}s:15:"payment_details";a:7:{s:7:"cc_type";s:4:"Visa";s:8:"cc_owner";s:10:"Shawn Conn";s:9:"cc_number";s:16:"4111111111111111";s:12:"cc_exp_month";s:1:"8";s:11:"cc_exp_year";s:4:"2008";s:6:"cc_cvv";s:3:"111";s:7:"cc_bank";N;}s:10:"line_items";a:1:{i:0;a:5:{s:12:"line_item_id";s:8:"subtotal";s:4:"type";s:8:"subtotal";s:5:"title";s:8:"Subtotal";s:6:"amount";d:1;s:6:"weight";i:0;}}})
  • HOOK ORDER ($op == load)
  • ORDER OBJECT (O:8:"stdClass":31:{s:8:"order_id";s:2:"75";s:3:"uid";s:1:"0";s:12:"order_status";s:9:"completed";s:11:"order_total";s:4:"1.00";s:13:"primary_email";s:16:"123@fakeemail.com";s:19:"delivery_first_name";s:0:"";s:18:"delivery_last_name";s:0:"";s:14:"delivery_phone";s:0:"";s:16:"delivery_company";s:0:"";s:16:"delivery_street1";s:0:"";s:16:"delivery_street2";s:0:"";s:13:"delivery_city";s:0:"";s:13:"delivery_zone";s:1:"0";s:20:"delivery_postal_code";s:0:"";s:16:"delivery_country";s:3:"840";s:18:"billing_first_name";s:5:"Shawn";s:17:"billing_last_name";s:4:"Conn";s:13:"billing_phone";s:0:"";s:15:"billing_company";s:0:"";s:15:"billing_street1";s:16:"123 Fake Street";s:15:"billing_street2";s:0:"";s:12:"billing_city";s:14:"Jeffersonville";s:12:"billing_zone";s:2:"24";s:19:"billing_postal_code";s:5:"47130";s:15:"billing_country";s:3:"840";s:14:"payment_method";s:6:"credit";s:4:"data";a:1:{s:8:"new_user";a:2:{s:4:"name";s:10:"ShawnTest3";s:4:"pass";s:4:"test";}}s:7:"created";s:10:"1206307607";s:8:"modified";s:10:"1206307607";s:8:"products";a:1:{i:0;O:8:"stdClass":11:{s:16:"order_product_id";s:3:"108";s:8:"order_id";s:2:"75";s:3:"nid";s:3:"207";s:5:"title";s:6:"hdtfgn";s:12:"manufacturer";s:0:"";s:5:"model";s:3:"431";s:3:"qty";s:1:"1";s:4:"cost";s:4:"0.00";s:5:"price";s:4:"1.00";s:6:"weight";s:1:"0";s:4:"data";a:4:{s:10:"attributes";a:0:{}s:5:"model";N;s:6:"module";s:10:"uc_product";s:9:"shippable";s:1:"0";}}}s:15:"payment_details";a:7:{s:7:"cc_type";s:4:"Visa";s:8:"cc_owner";s:10:"Shawn Conn";s:9:"cc_number";s:16:"4111111111111111";s:12:"cc_exp_month";s:1:"8";s:11:"cc_exp_year";s:4:"2008";s:6:"cc_cvv";s:3:"111";s:7:"cc_bank";N;}})
  • HOOK ORDER ($op == total)
  • ORDER OBJECT (O:8:"stdClass":32:{s:8:"order_id";s:2:"75";s:3:"uid";s:1:"0";s:12:"order_status";s:9:"completed";s:11:"order_total";s:4:"1.00";s:13:"primary_email";s:16:"123@fakeemail.com";s:19:"delivery_first_name";s:0:"";s:18:"delivery_last_name";s:0:"";s:14:"delivery_phone";s:0:"";s:16:"delivery_company";s:0:"";s:16:"delivery_street1";s:0:"";s:16:"delivery_street2";s:0:"";s:13:"delivery_city";s:0:"";s:13:"delivery_zone";s:1:"0";s:20:"delivery_postal_code";s:0:"";s:16:"delivery_country";s:3:"840";s:18:"billing_first_name";s:5:"Shawn";s:17:"billing_last_name";s:4:"Conn";s:13:"billing_phone";s:0:"";s:15:"billing_company";s:0:"";s:15:"billing_street1";s:16:"123 Fake Street";s:15:"billing_street2";s:0:"";s:12:"billing_city";s:14:"Jeffersonville";s:12:"billing_zone";s:2:"24";s:19:"billing_postal_code";s:5:"47130";s:15:"billing_country";s:3:"840";s:14:"payment_method";s:6:"credit";s:4:"data";a:1:{s:8:"new_user";a:2:{s:4:"name";s:10:"ShawnTest3";s:4:"pass";s:4:"test";}}s:7:"created";s:10:"1206307607";s:8:"modified";s:10:"1206307607";s:8:"products";a:1:{i:0;O:8:"stdClass":11:{s:16:"order_product_id";s:3:"108";s:8:"order_id";s:2:"75";s:3:"nid";s:3:"207";s:5:"title";s:6:"hdtfgn";s:12:"manufacturer";s:0:"";s:5:"model";s:3:"431";s:3:"qty";s:1:"1";s:4:"cost";s:4:"0.00";s:5:"price";s:4:"1.00";s:6:"weight";s:1:"0";s:4:"data";a:4:{s:10:"attributes";a:0:{}s:5:"model";N;s:6:"module";s:10:"uc_product";s:9:"shippable";s:1:"0";}}}s:15:"payment_details";a:7:{s:7:"cc_type";s:4:"Visa";s:8:"cc_owner";s:10:"Shawn Conn";s:9:"cc_number";s:16:"4111111111111111";s:12:"cc_exp_month";s:1:"8";s:11:"cc_exp_year";s:4:"2008";s:6:"cc_cvv";s:3:"111";s:7:"cc_bank";N;}s:10:"line_items";a:1:{i:0;a:5:{s:12:"line_item_id";s:8:"subtotal";s:4:"type";s:8:"subtotal";s:5:"title";s:8:"Subtotal";s:6:"amount";d:1;s:6:"weight";i:0;}}})
  • HOOK ORDER ($op == submit)
  • ORDER OBJECT (O:8:"stdClass":32:{s:8:"order_id";s:2:"75";s:3:"uid";s:1:"0";s:12:"order_status";s:11:"in_checkout";s:11:"order_total";s:4:"1.00";s:13:"primary_email";s:16:"123@fakeemail.com";s:19:"delivery_first_name";s:0:"";s:18:"delivery_last_name";s:0:"";s:14:"delivery_phone";s:0:"";s:16:"delivery_company";s:0:"";s:16:"delivery_street1";s:0:"";s:16:"delivery_street2";s:0:"";s:13:"delivery_city";s:0:"";s:13:"delivery_zone";s:1:"0";s:20:"delivery_postal_code";s:0:"";s:16:"delivery_country";s:3:"840";s:18:"billing_first_name";s:5:"Shawn";s:17:"billing_last_name";s:4:"Conn";s:13:"billing_phone";s:0:"";s:15:"billing_company";s:0:"";s:15:"billing_street1";s:16:"123 Fake Street";s:15:"billing_street2";s:0:"";s:12:"billing_city";s:14:"Jeffersonville";s:12:"billing_zone";s:2:"24";s:19:"billing_postal_code";s:5:"47130";s:15:"billing_country";s:3:"840";s:14:"payment_method";s:6:"credit";s:4:"data";a:1:{s:8:"new_user";a:2:{s:4:"name";s:10:"ShawnTest3";s:4:"pass";s:4:"test";}}s:7:"created";s:10:"1206307607";s:8:"modified";s:10:"1206307607";s:8:"products";a:1:{i:0;O:8:"stdClass":11:{s:16:"order_product_id";s:3:"108";s:8:"order_id";s:2:"75";s:3:"nid";s:3:"207";s:5:"title";s:6:"hdtfgn";s:12:"manufacturer";s:0:"";s:5:"model";s:3:"431";s:3:"qty";s:1:"1";s:4:"cost";s:4:"0.00";s:5:"price";s:4:"1.00";s:6:"weight";s:1:"0";s:4:"data";a:4:{s:10:"attributes";a:0:{}s:5:"model";N;s:6:"module";s:10:"uc_product";s:9:"shippable";s:1:"0";}}}s:15:"payment_details";a:7:{s:7:"cc_type";s:4:"Visa";s:8:"cc_owner";s:10:"Shawn Conn";s:9:"cc_number";s:16:"4111111111111111";s:12:"cc_exp_month";s:1:"8";s:11:"cc_exp_year";s:4:"2008";s:6:"cc_cvv";s:3:"111";s:7:"cc_bank";N;}s:10:"line_items";a:1:{i:0;a:5:{s:12:"line_item_id";s:8:"subtotal";s:4:"type";s:8:"subtotal";s:5:"title";s:8:"Subtotal";s:6:"amount";d:1;s:6:"weight";i:0;}}})
  • Modified uc_file.module
  • HOOK ORDER ($op == load)
  • ORDER OBJECT (O:8:"stdClass":30:{s:8:"order_id";s:2:"75";s:3:"uid";s:1:"0";s:12:"order_status";s:9:"completed";s:11:"order_total";s:4:"1.00";s:13:"primary_email";s:16:"123@fakeemail.com";s:19:"delivery_first_name";s:0:"";s:18:"delivery_last_name";s:0:"";s:14:"delivery_phone";s:0:"";s:16:"delivery_company";s:0:"";s:16:"delivery_street1";s:0:"";s:16:"delivery_street2";s:0:"";s:13:"delivery_city";s:0:"";s:13:"delivery_zone";s:1:"0";s:20:"delivery_postal_code";s:0:"";s:16:"delivery_country";s:3:"840";s:18:"billing_first_name";s:5:"Shawn";s:17:"billing_last_name";s:4:"Conn";s:13:"billing_phone";s:0:"";s:15:"billing_company";s:0:"";s:15:"billing_street1";s:16:"123 Fake Street";s:15:"billing_street2";s:0:"";s:12:"billing_city";s:14:"Jeffersonville";s:12:"billing_zone";s:2:"24";s:19:"billing_postal_code";s:5:"47130";s:15:"billing_country";s:3:"840";s:14:"payment_method";s:6:"credit";s:4:"data";a:1:{s:8:"new_user";a:2:{s:4:"name";s:10:"ShawnTest3";s:4:"pass";s:4:"test";}}s:7:"created";s:10:"1206307607";s:8:"modified";s:10:"1206307607";s:8:"products";a:1:{i:0;O:8:"stdClass":11:{s:16:"order_product_id";s:3:"108";s:8:"order_id";s:2:"75";s:3:"nid";s:3:"207";s:5:"title";s:6:"hdtfgn";s:12:"manufacturer";s:0:"";s:5:"model";s:3:"431";s:3:"qty";s:1:"1";s:4:"cost";s:4:"0.00";s:5:"price";s:4:"1.00";s:6:"weight";s:1:"0";s:4:"data";a:4:{s:10:"attributes";a:0:{}s:5:"model";N;s:6:"module";s:10:"uc_product";s:9:"shippable";s:1:"0";}}}})
  • HOOK ORDER ($op == total)
  • ORDER OBJECT (O:8:"stdClass":31:{s:8:"order_id";s:2:"75";s:3:"uid";s:1:"0";s:12:"order_status";s:9:"completed";s:11:"order_total";s:4:"1.00";s:13:"primary_email";s:16:"123@fakeemail.com";s:19:"delivery_first_name";s:0:"";s:18:"delivery_last_name";s:0:"";s:14:"delivery_phone";s:0:"";s:16:"delivery_company";s:0:"";s:16:"delivery_street1";s:0:"";s:16:"delivery_street2";s:0:"";s:13:"delivery_city";s:0:"";s:13:"delivery_zone";s:1:"0";s:20:"delivery_postal_code";s:0:"";s:16:"delivery_country";s:3:"840";s:18:"billing_first_name";s:5:"Shawn";s:17:"billing_last_name";s:4:"Conn";s:13:"billing_phone";s:0:"";s:15:"billing_company";s:0:"";s:15:"billing_street1";s:16:"123 Fake Street";s:15:"billing_street2";s:0:"";s:12:"billing_city";s:14:"Jeffersonville";s:12:"billing_zone";s:2:"24";s:19:"billing_postal_code";s:5:"47130";s:15:"billing_country";s:3:"840";s:14:"payment_method";s:6:"credit";s:4:"data";a:1:{s:8:"new_user";a:2:{s:4:"name";s:10:"ShawnTest3";s:4:"pass";s:4:"test";}}s:7:"created";s:10:"1206307607";s:8:"modified";s:10:"1206307607";s:8:"products";a:1:{i:0;O:8:"stdClass":11:{s:16:"order_product_id";s:3:"108";s:8:"order_id";s:2:"75";s:3:"nid";s:3:"207";s:5:"title";s:6:"hdtfgn";s:12:"manufacturer";s:0:"";s:5:"model";s:3:"431";s:3:"qty";s:1:"1";s:4:"cost";s:4:"0.00";s:5:"price";s:4:"1.00";s:6:"weight";s:1:"0";s:4:"data";a:4:{s:10:"attributes";a:0:{}s:5:"model";N;s:6:"module";s:10:"uc_product";s:9:"shippable";s:1:"0";}}}s:10:"line_items";a:1:{i:0;a:5:{s:12:"line_item_id";s:8:"subtotal";s:4:"type";s:8:"subtotal";s:5:"title";s:8:"Subtotal";s:6:"amount";d:1;s:6:"weight";i:0;}}})
  • HOOK ORDER ($op == load)
  • ORDER OBJECT (O:8:"stdClass":30:{s:8:"order_id";s:2:"75";s:3:"uid";s:2:"25";s:12:"order_status";s:9:"completed";s:11:"order_total";s:4:"1.00";s:13:"primary_email";s:16:"123@fakeemail.com";s:19:"delivery_first_name";s:0:"";s:18:"delivery_last_name";s:0:"";s:14:"delivery_phone";s:0:"";s:16:"delivery_company";s:0:"";s:16:"delivery_street1";s:0:"";s:16:"delivery_street2";s:0:"";s:13:"delivery_city";s:0:"";s:13:"delivery_zone";s:1:"0";s:20:"delivery_postal_code";s:0:"";s:16:"delivery_country";s:3:"840";s:18:"billing_first_name";s:5:"Shawn";s:17:"billing_last_name";s:4:"Conn";s:13:"billing_phone";s:0:"";s:15:"billing_company";s:0:"";s:15:"billing_street1";s:16:"123 Fake Street";s:15:"billing_street2";s:0:"";s:12:"billing_city";s:14:"Jeffersonville";s:12:"billing_zone";s:2:"24";s:19:"billing_postal_code";s:5:"47130";s:15:"billing_country";s:3:"840";s:14:"payment_method";s:6:"credit";s:4:"data";a:1:{s:8:"new_user";a:2:{s:4:"name";s:10:"ShawnTest3";s:4:"pass";s:4:"test";}}s:7:"created";s:10:"1206307607";s:8:"modified";s:10:"1206307607";s:8:"products";a:1:{i:0;O:8:"stdClass":11:{s:16:"order_product_id";s:3:"108";s:8:"order_id";s:2:"75";s:3:"nid";s:3:"207";s:5:"title";s:6:"hdtfgn";s:12:"manufacturer";s:0:"";s:5:"model";s:3:"431";s:3:"qty";s:1:"1";s:4:"cost";s:4:"0.00";s:5:"price";s:4:"1.00";s:6:"weight";s:1:"0";s:4:"data";a:4:{s:10:"attributes";a:0:{}s:5:"model";N;s:6:"module";s:10:"uc_product";s:9:"shippable";s:1:"0";}}}})
  • HOOK ORDER ($op == total)
  • ORDER OBJECT (O:8:"stdClass":31:{s:8:"order_id";s:2:"75";s:3:"uid";s:2:"25";s:12:"order_status";s:9:"completed";s:11:"order_total";s:4:"1.00";s:13:"primary_email";s:16:"123@fakeemail.com";s:19:"delivery_first_name";s:0:"";s:18:"delivery_last_name";s:0:"";s:14:"delivery_phone";s:0:"";s:16:"delivery_company";s:0:"";s:16:"delivery_street1";s:0:"";s:16:"delivery_street2";s:0:"";s:13:"delivery_city";s:0:"";s:13:"delivery_zone";s:1:"0";s:20:"delivery_postal_code";s:0:"";s:16:"delivery_country";s:3:"840";s:18:"billing_first_name";s:5:"Shawn";s:17:"billing_last_name";s:4:"Conn";s:13:"billing_phone";s:0:"";s:15:"billing_company";s:0:"";s:15:"billing_street1";s:16:"123 Fake Street";s:15:"billing_street2";s:0:"";s:12:"billing_city";s:14:"Jeffersonville";s:12:"billing_zone";s:2:"24";s:19:"billing_postal_code";s:5:"47130";s:15:"billing_country";s:3:"840";s:14:"payment_method";s:6:"credit";s:4:"data";a:1:{s:8:"new_user";a:2:{s:4:"name";s:10:"ShawnTest3";s:4:"pass";s:4:"test";}}s:7:"created";s:10:"1206307607";s:8:"modified";s:10:"1206307607";s:8:"products";a:1:{i:0;O:8:"stdClass":11:{s:16:"order_product_id";s:3:"108";s:8:"order_id";s:2:"75";s:3:"nid";s:3:"207";s:5:"title";s:6:"hdtfgn";s:12:"manufacturer";s:0:"";s:5:"model";s:3:"431";s:3:"qty";s:1:"1";s:4:"cost";s:4:"0.00";s:5:"price";s:4:"1.00";s:6:"weight";s:1:"0";s:4:"data";a:4:{s:10:"attributes";a:0:{}s:5:"model";N;s:6:"module";s:10:"uc_product";s:9:"shippable";s:1:"0";}}}s:10:"line_items";a:1:{i:0;a:5:{s:12:"line_item_id";s:8:"subtotal";s:4:"type";s:8:"subtotal";s:5:"title";s:8:"Subtotal";s:6:"amount";d:1;s:6:"weight";i:0;}}})

Interestingly enough, $op == "submit" is being fired after $op == "update". That runs counter to what I'd think sequence should be. Hopefully, Ryan & Lyle can shed some light on this subject.

--

-Shawn Conn: If the Name Don't Rhyme It Ain't Mine

Posts: 37
Joined: 10/20/2007

I'd just like to add that we identified a potential cause -- between when this was last working and now, we'd upgraded to workflow-ng 2.x. After an upgrade to UC beta 7, we were getting some workflow module errors and decided to upgrade. After Shawn's debugging comments, I have a hunch it may be related to that, but I'm not much of a module developer/troubleshooter, so I can't say much more than that...

--

Gorgeous themes for Drupal and Ubercart ~ http://www.TopNotchThemes.com

Posts: 1139
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

Any updates on this?

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com

Posts: 37
Joined: 10/20/2007

Nope Sad Tried upgrading to the non-beta Workflow ng 2, same thing. Going to try downgrading to 1.6 today.

--

Gorgeous themes for Drupal and Ubercart ~ http://www.TopNotchThemes.com

Posts: 1139
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

Let me know how you make out. I'm guessing the version of WF-ng won't really make a difference, but I suppose anything is possible. It makes me wonder if it's the way the $order object is getting passed (without a uid as you and Shawn discovered) or if the $order->uid object is being destroyed by the new Workflow? Should be interesting to find out.

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com

Posts: 37
Joined: 10/20/2007

Yeah I'm not exactly holding my breath, but it's the only significant thing related to this (other than upgrading UC itself to beta 7) that we did between when it was working and not.

--

Gorgeous themes for Drupal and Ubercart ~ http://www.TopNotchThemes.com

Posts: 37
Joined: 10/20/2007

No luck downgrading to workflow 1.6 Sad

Anonymous downloads *are* supposed to be a feature though, right?

--

Gorgeous themes for Drupal and Ubercart ~ http://www.TopNotchThemes.com

Posts: 1139
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

Yeah. For instance I can download a file as an anonymous user, as long as I have a link that is from a real purchase. Those links are ALWAYS attached to a uid, even if that uid is from an anonymous purchase (that is, if this were possible at the moment). But it boils down to being able to download the file whether or not you are logged in - the only thing necessary is a uc_file_users row that contains a link between the file's id (fid) and the file itself.

So I really think that somehow the $order object is being corrupted, whether it's a bug or "by design" at the moment... bug is more my guess and I get the feeling it's simply the order in which things are being called, but I could be wrong. Shawn seemed to be getting a handle on the issue.

Ryan and Lyle- what do you guys think of this?

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com

Posts: 331
Joined: 08/07/2007
Administrator

After further study, I see what's going on here. Upon submission of the review order form, the submit handler uc_cart_checkout_review_form_submit is called:

<?php
     
...
     
// Invoke hook_order($op = 'submit') to test to make sure the order can
      // be completed... used for auto payment in uc_credit.module.
     
$order = uc_order_load($_SESSION['cart_order']);
     
$pass = module_invoke_all('order', 'submit', $order, NULL);
      ...
?>

At this point uc_credit_order is called with $op == 'submit', this will process the credit card, which in turn triggers the workflow event that updates the status of the order). From there, hook_order is invoked with $op == 'update' (which triggers uc_file_order. However, at this point the new user account hasn't been created.

It's not until later, when the customer is kicked to the order completion page (cart/checkout/complete), uc_cart_checkout_complete calls the function uc_cart_complete_sale which creates a new user account. In short, the uc_credit module processes the card (and updates the order) before there's a user account to be associated with a file (or role as this bug would apply to the uc_roles module as well).

--

-Shawn Conn: If the Name Don't Rhyme It Ain't Mine

Posts: 1139
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

Wow, interesting. Nice work there, Shawn Smiling

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com

Posts: 4368
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

So... it sounds like the only solution is going to be to make the addition of file downloads and roles work through a workflow-ng action on the "customer completes checkout" event?

Posts: 1139
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

I'm not sure that's the only solution. What about breaking out the uid creation process away from the submitting of a completed order? Perhaps that should be the workflow-ng config. "Create user account at checkout" could be an action for the condition "User checks out anonymously".. something to that effect.

I think the main reason being you have the possibility of more modules in the future that might need the flexibility to act differently depending on if the order comes from an anonymous user or not. Specifying it just for Roles and File Downloads seems getting a little too specific to me. What do you think?

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com

Posts: 4368
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Aye, good point. There could be changes made elsewhere, but I wouldn't want to break other modules this late in the game. I'm not sure creating a user account through a workflow-ng configuration would be best, since we require that to happen and someone could disable the configuration, but having a condition might be possible.

I guess I'm just not sure what the best solution to these specific anonymous issues are. I'm up for implementing a recommended course of action restricted in scope for now that we can rework post 1.0.

Posts: 1
Joined: 04/21/2008

Is there any update on a fix for this? This is a pretty major bug for any website selling files.

Posts: 1139
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

I don't allow anonymous ordering so I can't say I have any experience with this bug. That would be my best suggestion (disabling anonymous checkout) but, if that's what you require then I'm sure this will get fixed, if it hasn't been already.

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com

Posts: 2008
Joined: 08/07/2007
AdministratoreLiTe!

This sounds like the same problem that uc_roles had with giving permission to anonymous purchasers. The trick is to make the order go to the completed status after the user account has been created, not when the payment is complete. The Workflow event should be "customer completes checkout", the condition "check the order balance ($0)", and the action "update the order status (completed)". With roles, I noticed a slight delay in the processing, so that on the next page the customer saw, they didn't have permissions until the next page load. But if they have to log in, that wouldn't be a problem.

Posts: 32
Joined: 03/17/2008

Lyle,

Your method worked perfectly. Thanks!

Posts: 37
Joined: 10/20/2007

- nevermind, brain left me temporarily -

--

Gorgeous themes for Drupal and Ubercart ~ http://www.TopNotchThemes.com

Posts: 13
Joined: 05/07/2008

I would just like to state that as of RC4, as per Lyle above, this is the solution to the problem of downloads not appearing in the user's queue. I would suggest adding this as a default configuration in the uc_file module, but I know, being so close to release 1.0, that breaks all sorts of rules Smiling

For those that follow behind, here are the exact steps (you must use the admin interface):

  1. Select Administer >> Site building >> Workflow-ng
  2. Click "Add a new configuration"
  3. Fill in the form:
    • Event: "Customer completes checkout"
    • Label: "Update order status to 'Completed'"
    • Check the "active" configuration box
  4. Click "Add a condition
  5. Select Payment >> Check the order balance
  6. Click "Add"
  7. On the editing form, select "Balance is equal to $0.00"
  8. Click "Submit"
  9. Click "Add an action"
  10. Select "Update the order status"
  11. Click "Add"
  12. Chance the Order Status selection box to "Completed"
  13. Click "Submit"
  14. Viola! If you're working on a live site, you might want to leave the "active" box unchecked in Step 3 until you've completed the rule addition. You can always go back and make it active by "editing" the rule from the Workflow-ng "home" page.

Posts: 4368
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Devon, if this is the way to make it work as expected, then I'd consider it a bug if the code isn't doing this by default. I'll look over your post on Monday and consider whether or not I can test it and add it to core as a bugfix. I'm open to others' opinions on the issue.

Posts: 1139
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

Maybe I'm being dense, but I don't really see what that Workflow-ng config has to do with File Downloads. I use the same type of config, except instead of "User completes checkout" I am using "Payment is entered for an order" - mainly because 1/3 of our orders are PayPal. PayPal IPN doesn't always report back to us at the same time checkout is completed, so a lot of times we'd get orders not moving from pending to completed.

Anyways I have that setup and File Downloads set to unlock files at the Completed status. We have only had a few bugs but they've always been due to IPN not reporting.

Sorry if I'm missing something. Ryan, feel free to shoot me down with more details, since I can't seem to grasp what bug it is that you'd be fixing Smiling Thanks!

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com

Posts: 37
Joined: 10/20/2007

I can confirm that we had to make the exact same change to workflow, instead of using the default workflow configuration, in order to get anonymous file downloads to work on our site. Otherwise, those checking out as an anonymous user never got access to the file download.

--

Gorgeous themes for Drupal and Ubercart ~ http://www.TopNotchThemes.com

Posts: 13
Joined: 05/07/2008

You'll have to forgive me. As I said earlier, I'm a total n00b re: Drupal, Ubercart, and honestly, PHP. I have over 15 years of C++/Java/C# experience, though so I do have that knowledge to fall on.

As near as I can tell (without a debugger to step through stuff), Lyle has it right: If you allow anonymous checkouts, and the user creates the account during the checkout process, the file downloads are not made available in the user's account. With my limited knowledge, it appears uc_file_order() is no calling _user_table_action. I say this not because I am watching to code execute, but rather, the two comments in that section of code are not being applied to the order as you would expect and the information is not in the uc_file _users table. So, this is circumstantial, I agree. But I don't yet have the knowledge of how to debug PHP properly.

For more information, if it helps at all, prior to creating my own workflow rule based on Lyle's post, I was using the default rule provided by uc_payment that changes the status of an order. I added a second "action" that moved the order from 'Payment received' to 'Completed.' This worked for me when I was testing originally, but that, evidently, was because I already had an account on the server. When testing new accounts, that's when I noticed the problem.

You're more qualified than I, but since I wouldn't begin to know how to solve the cart before the horse (file downloads before the user account) problem, a simple approach would be to add a uc_file_workflow.inc file that contained the appropriate rule and add some documentation to the uc_file#help page.

As an aside, I do want to say that I'm impressed with the software. Yes it's early, yes there are a lot of people asking for more, but I, with no knowledge of Drupal or PHP have set up a site and am beginning to develop my own modules in less than 1 week. That says something. Keep up the good work.

Posts: 1139
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

I understand now, I think. Was the _user_table_action('allow, blah blah) function not being called because there was no "uid" to pass? (Due to anonymous customer account creation, etc.). Am I on the right track? Just trying to poke around so if I think of something I'd like to contribute.

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com

Posts: 2008
Joined: 08/07/2007
AdministratoreLiTe!

Right. When a customer is checking out anonymously, credit card gateways can trigger the "payment received" event before the user account has been created (or found if it's a duplicate email). This causes problems on file download and role permission products. I'm adding another default configuration that's basically the same as described earlier in the thread. The only change is I'm adding a condition that the order can not be shippable. That's the closest to the standard configuration, but also the safest for nearly every kind of store I can think of. Those who do sell shippable and non-shippable products can tinker with the settings to find a configuration that works better.

Posts: 3
Joined: 08/12/2008

Is it possible to share the proposed workflow or put it in the documentation for anonymous user file downloads? Thanks!

Edited:
Ok, let me just post my procedure for recreating the workflow described above. I've tested it and anonymous buyers get sent the link properly, as well as are able to access the files after logging in.

1. As admin, goto Administer -> Workflow-ng -> Add a new rule configuration
2. Choose for the "Event": Customer completes checkout
3. For the label, enter a meaningful text for yourself. I use "Update status on completed checkout, non-shippable", and hit submit
4. Click on add a condition, choose "check the order balance" under the "Payment" heading, then hit add
5. Select "Balance is equal to 0" and hit submit
6. Click on add a condition again, choose "Check if the order can be shipped", check the "Negate" field and then hit add button. (Note, this was the noted in the thread above. Also note that for my product, I have shippable and non-shippable items. In the product setting, I have "Product and its derivatives are shippable" checked, but in its features, file download, the "Shippable product" box is unchecked)
7. Click on add an action, select "update the order status" under the "order" heading
8. Change the order status to "completed" and hit submit

That's it. I've attached a screen shot of my workflow to this post.

AttachmentSize
anon-shipping-workflow.jpg67.88 KB