How would you go about saving products ordered in a custom table?

Posts: 76
Joined: 09/19/2007
Bug FinderGetting busy with the Ubercode.

I am building a site that sells a single product that has customizable attributes. Each order may contain several of the product with different attributes. Upon completion of payment using PayPal Website Payments Pro, I would like to grab each product purchased and add it into a custom table that will have a column for each attribute.

Just in case someone has done something like this before, what would be the best practice in handling this? Is there a hookable API call once the IPN goes through? If so, are variables passed that contain information about the products, including the attributes?

Thanks!
Chris

Posts: 76
Joined: 09/19/2007
Bug FinderGetting busy with the Ubercode.

Just wanted to bump. I guess I'm wondering if there is some kind of hook once an order has been fully paid for that I can use to grab the products ordered and do my own thing with it.

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

Yeah, hook_order() has an update $op that you can use to see if an order has changed statuses. However, there is a new order status system coming in Alpha 7d (hopefully this afternoon) that will facilitate things like this a lot better. If you can wait a bit to dig into this, I think you'll be much happier.

Posts: 76
Joined: 09/19/2007
Bug FinderGetting busy with the Ubercode.

If you don't mind me asking, what will be different about the order status system? Is the current version usable, or is it actually broken in some way?

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

Current version is usable, and the .install files should handle the update. It's just that the current system wasn't forward thinking enough. The new one is, and it adds an admin menu so stores can customize some of the default order workflow and add/rename statuses as they please. There are a few helper functions now, too, to help modules decide for example when an order is being switch from an 'in_checkout' to a 'post_checkout' status. I'm testing an update on a site right now and will be testing a clean install, then I'll get to releasing and posting documentation. Eye-wink

Posts: 76
Joined: 09/19/2007
Bug FinderGetting busy with the Ubercode.

Thanks, Ryan! I'll be looking forward to the update. Smiling

Posts: 82
Joined: 08/31/2007
Bug FinderInternationalizationizerNot KulvikThe other woman.

updated to the latest bzr update. would the changes you're talking about be the (or one of them) reason i'm getting this error:

Fatal error: Call to undefined function uc_get_order_status_id()

?

thanks!

--

i plurk. i twit.

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

Yep... that function is gone. Eye-wink

What module is throwing up that error?

Posts: 82
Joined: 08/31/2007
Bug FinderInternationalizationizerNot KulvikThe other woman.

eep! i just saw this today. ill try to reproduce the error (if it's still there) and let you know. sorry. i wasn't ignoring the thread.

--

i plurk. i twit.