After I changed my system to clean-urls I've a strange behavior when I try to complete my orders (submitting orders on the review screen), because was not completing my orders and return to cart/checkout screen. So I debugged a little and on uc_cart/uc_cart.pages.inc on line 375 the condition that was tested here was false.

if (empty($_SESSION['cart_order']) || empty($_SESSION['uc_checkout'][$_SESSION['cart_order']]['do_review'])) {
drupal_goto('cart/checkout');
}

When I change to non clean-urls the condition is true and I can complete my orders.
I notice that with clean-urls
$_SESSION['cart_order'] is ok with order number in
$_SESSION['uc_checkout'][$_SESSION['cart_order']]['do_review'] is empty

Can anyone tell me where the $_SESSION['uc_checkout'][$_SESSION['cart_order']]['do_review'] is filled?

CommentFileSizeAuthor
#7 Modules_page.png159.55 KBarijits.drush
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

longwave’s picture

Status: Active » Postponed (maintainer needs more info)

It is set in uc_cart_checkout_review_form_submit() unless you are using a payment method which subverts this process. You have not specified which payment method you are using, however.

longwave’s picture

Are you using any modules that may affect checkout such as uc_ssl?

josebrito’s picture

Thank you for your answer.
I'm using bank transfer and check. Probably this modules have problems with clean-urls.
I'll continue debugging.

TR’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing due to lack of further information.

arijits.drush’s picture

Status: Closed (cannot reproduce) » Active

Hello ,
I am using ubercart and in payment method I use
a.)COD
b.)Check
After filling all my information on http:///cart/checkout, I click on Review order and it takes me to http:///cart/checkout/review page .Now when I am clicking on "submit order" button it take me back to http:///cart/checkout instead of completing the order.
Now I look at the code and found
line no 403
if (empty($_SESSION['cart_order']) || empty($_SESSION['uc_checkout'][$_SESSION['cart_order']]['do_review'])) in
sites\all\modules\ubercart\uc_cart\uc_cart.pages.inc
causes the problem.

because $_SESSION['uc_checkout'][$_SESSION['cart_order']]['do_review'] is empty and when I do not use clean url then this problem is solved but this seems to not work with clean url

longwave’s picture

Status: Active » Postponed (maintainer needs more info)

This works for me with clean URLs enabled. Are you using secure pages or uc_ssl to provide https support? Or any other modules that may affect sessions somehow?

arijits.drush’s picture

FileSize
159.55 KB

No I am working over http only no secure layer implemented so far.
I am providing screenshot off all my modules as attachment,so you can see by yourself.

longwave’s picture

Global Redirect is the only one that stands out for me there. Also have you tried changing your theme to see if that makes any difference?

stop14’s picture

I'm noticing this to in one of our staging environments as well.

I'm checking a few things that may affect sessions - clean urls, changes we made to RewriteBase in the .htaccess file, and changes we made to the base url to accommodate the staging I.P. address and subfolder structure. Will check back.

longwave’s picture

This is definitely something related to session storage, cookies, or your server setup - there is no special handling for clean URLs in Ubercart. I have no further suggestions, and have not seen this happen myself, but it would be good to know what the solution is if you find it!

arijits.drush’s picture

Hello longwave ,
thanks for the time you spend for the problem,I will check the code and let you know if I found any solution.

TR’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

No further information provided.

DanZ’s picture

Version: 7.x-3.x-dev » 7.x-3.10
Issue summary: View changes
Status: Closed (cannot reproduce) » Active

I'm seeing a very similar problem. This is on our production site and happens rarely, so we have had a very hard time troubleshooting. Our customers report behavior like this:

I placed a large order today (full set of math books and a few additional books) and did not receive a confirmation. I did not see any button to finalize my order.

I had books in my cart, put in the addressing, billing info, etc, and hit "review order" and the next page said my cart was empty.

every time I am at the point of paying, it says my cart is empty, except for the time it said I had three books ordered !

I was able to sign in. It looked like my book was in the cart, so I tried to complete my order (even entered my CC info). When I went to actually complete the transaction, it kicked me out and said nothing was in my cart.

When trying to place an order I either get a message saying "There are no products in your shopping cart." or it returns to the review order page with the message "You have entered an invalid credit card number." Neither message is correct.

I tried to order, but when I go to check out, I get a message that I don't have anything in my cart. So I go back and, indeed, I do have the book in the cart.

So, it looks like it happens to both anonymous and signed-in users and happens at the "review order" stage. Also, it displays the "There are no products in your shopping cart" on the shopping cart page, but the products are still in the cart.

Also, it usually works when customers switch to a different browser or computer.

We are using the Secure Pages module and clean URLs. We have Paypal and Authorize.net for payment methods.

Is there anything I can do to troubleshoot this better?

TR’s picture

Well, you're definitely loosing the session at some point. The curious part is that this happens only rarely, and that it works mostly.

The "normal" reason this happens is a problem with Secure Pages or with your assets (css, images, JavaScript, etc.). The session goes from an http session to an https session when you switch protocols, so if Secure Pages isn't configured exactly right or if some of your assets are not being loaded by https after you switch to the https session, then the session breaks. Look for errors loading images or css files or background images etc. - this can be hard to spot, e.g. when a css file properly loaded via https accesses an img with a non-https url.

A guess as to why this may work most of the time but not some of the time is that perhaps you have some assets that are cached by your client - a repeat customer for example may have images etc. cached that were initially downloaded by http, but you later changed your site and now serve them via https. That client would have a problem with broken session when going from http to https, but no one else would. I suppose you could "touch" all your assets to force the server to identify them as recently changed, which should invalidate all your client's caches.

If you switch your entire site to https and make sure everything is loaded via https (disable http!) then this should go away (you probably also have to invalidate caches like I said above so that clients get the "new" site.) If this doesn't fix it then there may be some other problem.

Also, search this queue (especially closed issues) for session loss, https, return to checkout, etc. I know there are many many posts about similar problems, and it's likely I may be forgetting some of the other things that cause this problem.

Webpo’s picture

I have the same problem here. After completion I get redirected to the filled out checkoutpane and and the cart will not empty. While working on the e-mail template I made a mistake in my uc-order--customer.tpl so the mail did not work. As a surprise I was redirected to the "Thanks" page I made and the cart was emty. Whe I fixed the e-mail template the redirection stopped working properly again.
Log report: Notice: Undefined index: cart_order in _paynl_order_update_status() (regel 263 van /home/karsijns2/domains/karsijns.eu/public_html/sites/all/modules/paynl/paynl.inc.php).
Ubercart 3.8
Drupal 7.53
I use a third part module for payment : Ideal payment by Pay.nl
The line in the module:
$_SESSION['uc_checkout'][$_SESSION['cart_order']]['do_complete'] = true;

$goto = 'cart/checkout/complete';
break;
Strange thing is that it works propperly as the mail has not been sent.

Anyone?
I'm not a real php specialist so forgive my probable incompleteness in this.

TR’s picture

Status: Active » Closed (cannot reproduce)