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?
Comment | File | Size | Author |
---|---|---|---|
#7 | Modules_page.png | 159.55 KB | arijits.drush |
Comments
Comment #1
longwaveIt 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.
Comment #2
longwaveAre you using any modules that may affect checkout such as uc_ssl?
Comment #3
josebrito CreditAttribution: josebrito commentedThank you for your answer.
I'm using bank transfer and check. Probably this modules have problems with clean-urls.
I'll continue debugging.
Comment #4
TR CreditAttribution: TR commentedClosing due to lack of further information.
Comment #5
arijits.drushHello ,
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']))
insites\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
Comment #6
longwaveThis 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?
Comment #7
arijits.drushNo 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.
Comment #8
longwaveGlobal 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?
Comment #9
stop14 CreditAttribution: stop14 commentedI'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.
Comment #10
longwaveThis 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!
Comment #11
arijits.drushHello longwave ,
thanks for the time you spend for the problem,I will check the code and let you know if I found any solution.
Comment #12
TR CreditAttribution: TR commentedNo further information provided.
Comment #13
DanZ CreditAttribution: DanZ commentedI'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:
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?
Comment #14
TR CreditAttribution: TR commentedWell, 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.
Comment #15
Webpo CreditAttribution: Webpo commentedI 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.
Comment #16
TR CreditAttribution: TR commented