12 replies [Last post]
diegohermes's picture
Offline
Joined: 09/12/2007
Juice: 147
Was this information Helpful?

Well, the subject says everything, i just buy, review and go to complete screen, how can i get the order values again? I know that in this step they are already submited, so, how can i show/acess them like in the review screen?

I don't want to hack the core code to make this work, it's why im asking for help.

thanks

Shawn Conn's picture
Offline
Administrator
Joined: 08/07/2007
Juice: 916
uc_orders table

Once you've entered the checkout review page the order has been saved into the uc_orders table. It will have the order status of "in_checkout".

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

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: uc_orders table

Well, I think his problem is that I'm not sure that my checkout completion message settings allow for PHP. Really they probably should, that way you could load the completed order. So basically, at the moment this isn't possible. You could try creating a custom checkout page and pointing to it in your checkout settings. Set its input filter to PHP and you can load an order using uc_order_load(). But then again, I believe by this time I've already wiped the order ID from the session... so some way to get this info to the completion page will need to be devised.

diegohermes's picture
Offline
Joined: 09/12/2007
Juice: 147
Re: Re: uc_orders table

Hummm, and about when click on the submit order button i open 2 pages? one is the complete screen and the other the page that i need the order values, its possible?

The main problem is that i must allow clients to print this data after they complete the buy, i think this is similar to the invoice system but, again, if the client is a anonymous user (my shops client allows that), how can he access the invoice? only the received by e-mail i believe, access the orders page is restrict to registered users only, right?

So, brainstorming here, its possible to, from the emailed invoice, i have link that point to some page in the site that will receive the order values contained in the invoice and show them for the client, so he can print that page?

By the way, thanks for the answers.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: uc_orders table

I suppose it wouldn't be a bad idea for customers to be able to view their invoice directly from the order completion page. I think I've seen that on other stores like Tiger Direct. It is being e-mailed, though, and for anonymous users Ubercart will automatically create an account for them that they can login to to view their invoices.

diegohermes's picture
Offline
Joined: 09/12/2007
Juice: 147
It is being e-mailed,


It is being e-mailed, though, and for anonymous users Ubercart will automatically create an account for them that they can login to to view their invoices.

Cool, 7e already do that or this will be a new feature for alpha8? Sorry for asking, my 7e sites are running offline, i can't test, my only online is 7c and don't have that.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: It is being e-mailed,

Hmm... already working for 7e and was working for 7c as best as I can remember. Sticking out tongue

diegohermes's picture
Offline
Joined: 09/12/2007
Juice: 147
Re: Re: It is being e-mailed,

Are you sure about 7c? I don't find anything like that in the emailed invoice, you can see by yourself in the attached file. Maybe i forgot to config something? I look at the orders config screen and don't find any config about that.

I edit the attached image, so you can see to where the link is pointing.

AttachmentSize
invoice.jpg 124.25 KB
Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: It is being e-mailed,

Hmm... well, it's actually sending the e-mail using the invoice template. They should just be able to print that out through their e-mail program or web app. Perhaps you mean something different by a printable invoice page?

diegohermes's picture
Offline
Joined: 09/12/2007
Juice: 147
Re: Re: Re: Re: It is being e-mailed,

Maybe i start to confuse you, the invoice issue have two parts, the first is about what you saying that when someone do an anonymous checkout, ubercart will create a account for him, where i config that? As you can see, the client don't receive any account details in the invoice emailed, its a separated feature? Another e-mail? I read in the forum a topic asking about how to not create the accounts, my problem is the oposite.

And the second issue, the original by the way, its that i have 2 invoice template, the customer that will be emailed and a second, that is acessed (if possible) by the order screen because it must print and pay in the bank, but for the client acess the order screen he must be logged and if he do a anonymous checkout he don't have any account and then, we return to the first paragraph.Puzzled

I hope i could explain the situation, maybe i'm messing up everything Shocked

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: Re: Re: It is being e-mailed,

In your custom invoice template, it may be that you have removed the lines dealing with login information? I haven't changed anything regarding with new customer login details for a while, so I don't expect it to be much different in 7c. It may be that you've customized the checkout messages or template to remove those lines. There are tokens you can use for this data I believe.

Also, just look at the checkout settings form... there should be an option to make sure Drupal sends its usual new account e-mail notification.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: How do i get order values from complete screen?

Ok, this is in response to the original post and question. I have updated the cart module in Bazaar so that checkout messages use input formats. You can choose to use PHP now on the checkout pages for instructions and completion text if you want.

I have also changed around where session variables are getting unset from checkout, so you have access to the cart contents if you wish and also the order ID in $_SESSION['cart_order'] which you can use to load the full order object with

<?php
  uc_order_load
($_SESSION['cart_order']);
?>

This should be useful for many people. Smiling

budda@drupal.org's picture
Offline
Joined: 09/02/2008
Juice: 16
Re: Re: How do i get order values from complete screen?

This code doesn't work for me, if i do a var_dump($_SESSION['cart_order']); there's nothing for an anonymous user, or a logged in user on the /cart/checkout page.

I need to execute some code based on the order total, how should I be calculating the order total on the checkout page?