I am testing on the CVS version of ecommerce. When I go to check out, I get through all the screens in the checkout process, then I get to the review screen where I "Place your order" and when I hit place your order, instead of getting sent off to the payment process, I'm sent back to the first screen of the checkout screens - address. Perhaps something in checkout_review function...

I saw there was looping reported as a bug earlier, as well as one blank checkout screen - I see both of these happening, but I've checked the diff and I indeed have the latest versions of the modules in CVS.

Ian

Comments

ajwwong’s picture

Another sighting confirmed. CVS ecommerce with drupal 4.7CVS

cart/checkout/review

screen is fine, but attempt to complete order, via "Place your Order"

cart/checkout?op=next

sends back to

/cart/checkout

(which is the old Choose Billing Address page), rather than "next" page.

ajwwong’s picture

Don't know what happened... maybe I just updated to latest cvs... but works now! Thanks everyone! :-)

phildu’s picture

i have the same problem, but no magic effect for me ,
i have the latest version
could you details what you have do
thanks

phildu’s picture

maybe, the problem is in the screen order i have this by default
address
paypalpro_express
payment
shipping
cart

??

gordon’s picture

This should be ok, but paypalpro_express needs to be after the payment module or it is not going work at all.

I am actually going to be removing this because the paypal express checkout needs to be called after the review screen.

Ian Ward’s picture

I have:

address
payment
shipping
cart

and it sends me back to cart/checkout?op=next and the address screen and starts the loop all over after I press "Place your order". I had done some customizations to the file module for ecommerce and had it using the checkoutapi, but then for testing i just now updated to the latest CVS of ecommerce, with file.module disabled, and I get thrown into this same loop. Any idea how I could test this? I've looked at the variables $num_screens > $data->screen+1 and screen+1 is greater than the number of screens on the review page. What else could i try and look at?

Ian

sym’s picture

This is a problem with clean URLs - I can't find it yet, but if I do I'll let everyone know.

sym’s picture

I've been looking a this for most of the day and I can't work it out.

I'm sure it's to do with clean URLs (as when I turn them off it works) but I don't know where to look. I think it's to do with

  $num_screens = count($data->screens);
  if ($num_screens > $data->screen+1) {
    drupal_goto('cart/checkout','op=next');
  }

and the drupal_goto function, but I really don't know.

Can anyone help me out with this? Is there some help with clean URL problems in modules? I really need it to work ASAP and I can't turn my clean URLs off...

sym’s picture

Priority: Normal » Critical

I've been looking a this for most of the day and I can't work it out.

I'm sure it's to do with clean URLs (as when I turn them off it works) but I don't know where to look. I think it's to do with

  $num_screens = count($data->screens);
  if ($num_screens > $data->screen+1) {
    drupal_goto('cart/checkout','op=next');
  }

and the drupal_goto function, but I really don't know.

Can anyone help me out with this? Is there some help with clean URL problems in modules? I really need it to work ASAP and I can't turn my clean URLs off...

neclimdul’s picture

I've tried and tried but can't reproduce this. Is there anything else you can give us to work on. Maybe enable the devel redirect page. It might be able to tell us something about the redirect page that's causing a problem. *shrug*

sym’s picture

neclimdul, are you using clean URLs?

You can see the problem at http://www.playfestival.co.uk/shop - it's not live yet so don't worry about trying to buy anything (not that you can anyway).

using the devel module just shows that the page is being redirected to http://www.playfestival.co.uk/cart/checkout?op=next after clicking 'Place your order'.

What more can I do to help you with it? I don't mind giving you a temp admin longin for the site if that would help? I am using the most up to date files from CVS.

As I say, as soon as clean URLs are turned off, it workd fine.

gordon’s picture

I have taken a quick look, and I also cannot replicate this. I have triied both clean urls on and off.

I will email you and we can work together on this, If I don't get a hold of you email me through my contact.

gordon’s picture

I have done a lot of investigation on this, and basically what is happening.

When the review screen is submitted for some reason when the clean urls is on when you submit the last review page the select from the select from the ec_tmp is not returning the most resent version of the what is in ec_tmp, but what looks like the first from when you start working throught the checkout.

It is like you have multiple mysql servers on the backend and on the last page you are reading from an unsynced slave.

I am fairly certain this is not an ecommerce issue, but an issue with the set up of apache, php and mysql. esp. when if you turn of clean urls it all works.

sym’s picture

Thanks a lot for your time and help.

I have contacted the host (opensourcehost) to ask them if they can help at all. Do you have any ideas on anything else I can do?

I could move servers if it comes to it, but this should be a fixable problem on the server I'm on I guess.

Thanks again

Ian Ward’s picture

I just tried disabling clean urls, and it does stop the looping, though the paypal url looks like it's encoded wrong - meaning it's got % characters in the url, and goes to a 404 because of these encoded chars. This is on a beta5 site. I then made an RC test site for ecommerce, and it works with and without clean urls. I'm going to update the beta5 site to RC later today and see if that helps with anything. I will post here w/ the results,

Ian

sym’s picture

I've just tried this on a different server and I get the same problem.

What are the chances of this being a system wide error? Should I grab the latest CVS version of every module? I might try RS2 now it's out...

Ian Ward’s picture

I upgraded to 4.7 RC1 and then RC2 and I still get the loop, on both. This is on the same web server and mysql server as the fresh RC1 site I made for testing ecommerce. The site with the loop is an upgraded site, upgraded from 4.6.x to beta5, then RC1, then RC2. With clean urls off on the upgraded site, it tries to complete the payment, but just gets a badly encoded url to paypal. On the fresh RC1 install, it works with or without clean urls.

This is curious - could something be cached or not updating correctly which could cause a problem? It's curious because it works on the fresh RC1 install, but not on a site upgraded from 4.6.x

The log during the upgrade is normal/successful. I have the test site and the upgraded site both in subdirectories.

Ian

sym’s picture

The site I have the problem with it an upgrade from 4.6 too...

gordon’s picture

Can you try dropping the ec_tmp and re creating this table.

What I saw on sym's web site is that the the ec_checkout_get_data() which returns the txn object when you are doing the checkout is returning an old version of the cart and not the most resent version.

on the first display of the cart/checkout/review, ec_checkout_get_data() returns correctly.
On the submit of cart/checkout/review, ec_checkout_get_data() returns an older version so it goes back to the first page.

anyone have any other ideas.

Ian Ward’s picture

I just tried dropping and readding the ec_tmp table, but it still does the loop. Afterwards I also cleared the cache table, cleared the sessions table, and the ec_cart table - doing this did not help either.

Perhaps it has something to do with 4.6 to 4.7 upgrade, but what could it be? I checked to see i have the right .htaccess file, and I do (since the old one could have been left there since it's a hidden file).

I'm looking through some things on the database, and the upgrade log which i saved, but there is nothing immediately noticable to me.

Ian

sym’s picture

I ahve another idea to follow up...I've just changed the themeto bluemarine and it works.

My theme is a phptemplate theme from 4.6, just pluged in to 4.7. Does anyone know why this might change anything? Ian, can you try this? If anyone wants to talk over IM let me know, I'll be on for the news few hours.

Ian Ward’s picture

I just tried changing the theme to bluemarine, and i shut off the other theme (also based on phptemplate), and it still does not work. Sym, is there something else that you might have done that made it work?

sym’s picture

No, and I can change back and forth and it works or doesn't accordingly. Are you using the 4.7 template?

Ian Ward’s picture

That's pretty good evidence. What version of bluemarine are you running? From RC2? I'll go poke around a little. Does anyone know what might cause this?

sym’s picture

I've fixed it now! I'm not 1005 sure what change fixed it, as I started to copy the bluemarine code over and it started working!

I'll post back hwere when I find it. All I can advise for now is to look at the code around


      <div id="main">

        <?php print $breadcrumb ?>
        <h1 class="title"><?php print $title ?></h1>
        <div class="tabs"><?php print $tabs ?></div>
        <?php print $help ?>
        <?php print $messages ?>
        <?php print $content; ?>
      
	  </div>

And see what your theme has

Ian Ward’s picture

Sym, can you send me or post your bluemarine theme and phptemplate.engine so I see what versions you're running and check what I might be missing?

Ian

Ian Ward’s picture

I tried replacing the theme directory on the site that this is not working on (the site upgraded from 4.6) with the theme directory of the fresh 4.7 install which does work (no looping) and enabling bluemarine, and I also tried another theme, and it did not fix the problem.

I'm not sure where to go from here. Though, that it works with clean urls off, but not with them on makes me think i should follow that lead. So, if it is not using the ec_tmp column that it should use when clean urls are on, what could possibly cause that? How could i check for this on my site?

thanks,
Ian

Ian Ward’s picture

Ok, I made some progress - I was able to break my working site's ecommerce checkout and make it loop by enabling my custom theme. However, I then took the default theme on the working site and put it on the broken site, but it did not fix it.

Does this give anyone any clues?

Ian

Ian Ward’s picture

I got it! Simon, thanks for your leads. I looked at your two themes and I saw that one difference is that you @import print.css in the html head in page.tpl.php of the looping one, and in your working one, you commented this out. I tried removing the one @import call to a css file i had, and it responded on my fresh 4.7 install by indeed making my broken template work. So then, this did not help at all on my 4.6 upgraded site - still looped. Then, I was just watching it loop and loop, and I watched in FireFox as some broken images failed to appear in the footer. So, I went to where I have the footer code, in admin/settings -> General Settings, and I fixed the broken images, which were relative paths, so i just temporarily fixed them by hand coding the base path in front like this /dev/sitename/themes/mytemplate/image/image.png ... before it was just themes/mytemplate/image/image.png

Then, the cart suddenly works! No loop, and it goes to paypal. Now, maybe someone knows _why_ broken images (404s) cause the cart to loop?

Ian

sym’s picture

Great! I don't know enough about drupal to know why that would cause a problem, maybe the ecommerce modules pick up the op=next, get no post data and resets $txn?

jmiccolis’s picture

ok, I've got a theory as to why 404's could cause the looping, and why it would go away when you turn clean-urls off. When drupal gets a path that doesn't make sense, like "node/not-a-path" it basically strips things off the end of the node untill it makes sense, ie "node/not-a-path" sends you to "node".

So, like what Sym said - in ecommerce when you try to checkout a broken stylesheet or image may retriggers the review process by resetting $txn and pushing you back.

neclimdul’s picture

*scratching head* um... wow. This will surely need to be looked into. Assuming that everyone will have a perfect page is probably asking for trouble and more support threads like this.

gordon’s picture

I got it.

What is happening is the images have a relative path so when the web server is looking up and image like
<img src="broken_image.png" /< is being changed to http://www.example.com/cart/checkout/broken_image.png which is resetting the cart back to start.

The removal of the <base> means that this can happen.

gordon’s picture

Status: Active » Fixed

I have change the path to the review page from cart/checkout/review to cart/review which will fix the issue of the cart looping if there is a broken link (image/css) on the page.

Remember when upgrading from 4.6 to 4.7/cvs there is no <base> anymore and all images need to be absolute in the path.

Ian Ward’s picture

Great, Gordon thanks for fixing this, and thanks for everyone for helping to get to the bottom of this. It had me puzzled for awhile.

Sidenote: Also congratulations on this: http://heydon.com.au/node/922 this is going to be great. We'll be launching an ecommerce section on a site which i'll blog about - it is going to be neat, as it uses taxonomy relations to help w/ controlling related products themeing. Will post when it's live.

Ian

Anonymous’s picture

Status: Fixed » Closed (fixed)