Using drupal_goto for checkout redirection to add $_GET variable, but gets overwritten So I want to do redirect to the following URL:


  http:/www.url.com/checkout?foo=bar


Tried using this:

drupal_goto($path = 'checkout', $options = array( 'query' =&gt; array( 'foo' =&gt; 'bar')), $http_response_code = 302);


Now it works, but instally redirects to this:


  http:/www.url.com/checkout/order_id/


...meaning that I lose the GET variable. How do I do this? The same happens if you just type /checkout into the address bar, it redirects to checkout/order_id. I think it might be commerce doing this automatically. Any idea how to resolve this?
drupal_goto should work just fine. You can confirm (e.g with Firebug) that it does the initial redirect to where you want (including foo=bar).
Then you'll see a second redirect to the plain URL which is being performed by another code/module that you haven't told us about.