8 replies [Last post]
torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Was this information Helpful?

Hey guys, quick question. I have some links that get build upon order completion / payment received status. Suppose I want to be able to add these links to the $output during uc_cart_checkout_complete. Is this easy to do, with the current code?

I don't see a module_invoke_all for that function so it doesn't look like I can write my own hook implementation.

Any thoughts? Thanks in advance.

--
Help directly fund development: Donate via PayPal!

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Possible to hook into cart_checkout_complete()?

Hmm... I guess the thing to do here is to update order completion messages to allow the PHP filter like I did for checkout instruction messages... thoughts?

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Re: Possible to hook into cart_checkout_complete()?

IF that's easy enough to do. Do you think a new hook is out of the question? Granted we're using Workflow-ng for a lot of these actions ... but to be honest, I find it easier to write my own module to hook into your API, than it is to keep requesting a new W-ng condition every time Smiling

But, if using the PHP filter would allow for strings to be passed at the end of a module's hook, and it works, then I don't see a problem with it. Seems a bit roundabout to me, though.

--
Help directly fund development: Donate via PayPal!

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: Possible to hook into cart_checkout_complete()?

Sorry, I should've explained... the order completion messages actually define what that functions returns. So any PHP you executed and output you generated from it would be returned from uc_cart_complete_sale() depending on the checkout type (anonymous, existing user but not logged in, or authenticated user).

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Re: Re: Re: Possible to hook into cart_checkout_complete()?

Really. Well when you put it that way, I find it hard to argue Smiling I suppose then, at that point, it'd be pretty easy to grab the returned values from my module, which generates its output during the update $op and checks for order status... So there is the possibility that if paying with PayPal, the user might not see the output anyway. But that's fine. At least having the ability to add disclaimers depending on what product type is in the order would be excellent. For instance if they purchase JUST downloadable products, we could mention "Your files will be available under your My Account > Files area" or what have you, conditionally based on, again, items in the order.

Sorry for rambling. Many thanks for taking this into consideration!

--
Help directly fund development: Donate via PayPal!

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: Re: Re: Possible to hook into cart_checkout_complete

Yeah, I should've put configurable filters on these fields a while back... I probably won't get to it today, but you can check out the checkout message code if you need to piece it in yourself.

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Hey Ryan, Following up on

Hey Ryan,

Following up on this. I'm trying to add a link to the user's files in the Checkout Complete screen. I was hoping I could use tokens on these text fields, but they are not getting parsed. How easy is it to add the token values to these Checkout pane messages?

Also, can you briefly explain why UC panes use !new_username instead of [new-username]? Is there a difference I'm missing? I know you're probably swamped but if you can give any help it'd be appreciated. It's definitely not urgent, more of a "holding the customer's hand" type of thing Smiling

--
Help directly fund development: Donate via PayPal!

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Hey Ryan, Following up on

I'm not sure about the token values other than using a PHP filter on the completion message and using the token replace functions yourself. As for my funky !new_username as opposed to [new-username]... the ! values are being generated from a session variable instead of the order, so I can't really count on making those tokens all the time. As such I just parse them separately and it seems to work alright. It's not my favorite solution, though... I think I'd prefer to store all new account info in the data array of the order object like I'm now doing for http://www.ubercart.org/forum/bug_reports/2066/checkout_new_user_not_storing_entered_password_or_username">user specified usernames/passwords.

PaulW's picture
Offline
Joined: 05/23/2008
Juice: 148
I, too, would like to see a

I, too, would like to see a hook into cart_checkout_complete(). After several days of trial and error, the only way I could add the functionality I needed was to hack uc_cart.module. I really hated to do that, but had no real alternative.

You can see a bit of my struggle at http://www.ubercart.org/forum/development/6460/add_button_cartcheckoutco...