Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can't checkout with Gift Voucher activated on Windows


Guest

Recommended Posts

The exact same code works on a Linux box but dies on my Windows 2000 development server. Everything else works fine. Any thought will be appreciated.

 

When going through checkout with Gift Voucher and/or Discount Coupon enabled I receive the following error. I tracked it down to the line of code causing the error. Error and code snippet follow:

 

Error!

Unable to determine the page link!

Query was empty - Query was empty

Query was empty

[TEP STOP]

Warning: A session is active. You cannot change the session module's ini settings at this time. in Unknown on line 0

 

/catalog/includes/classes/order_total.php

 

function collect_posts() {

?

if (!tep_session_is_registered($post_var)) tep_session_register($post_var);

 

// MICAH the following Global line is where the problem seems to be

// echo ?<hr>$class<hr>?;

 

$GLOBALS[$class]->collect_posts();

}

}

}

}

Link to comment
Share on other sites

  • 4 weeks later...

Did you ever get around this?

 

I have the GV stuff installed too. My problem is the other way around though. Works on my windows box, but dies on the linux server.

 

I get the Error! Unable to determine the page link! message (none of the extra info that you had though) when I enter payment info and click to go to checkout_confirmation.php. I can't find what on the confirmation page is causing the problem though.

 

Any ideas?

Link to comment
Share on other sites

I still haven't had any luck figuring out what causes the problem on that machine. The same exact code copied to two other machines works without a hitch. So... it's logical to assume it has something to do with the php configuration itself, but darned if I can figure it out.

 

But since it's dieing on my dev machine and not production servers my clients are on, I've moved on to other things like yesterday I built an Auto Image Size feature so when you add a product you just point at the Large image and it automatically resizes it for the small and medium. That saves a bunch of time.

 

I seriously Love This Stuff :D

 

If I come up with any ideas I'll let you know and if you don't mind vice versa.

 

Micah Toland

Link to comment
Share on other sites

What's crazy about mine is that if I hit refresh on checkout_confirmation.php everything works out fine.

 

I've narrowed it down to this:

  if (MODULE_PAYMENT_INSTALLED) {

   $payment_modules->pre_confirmation_check();

 }

 

An echo "here"; exit; before that snippet says 'here' and exits. Directly after gives me the 'Unable to determine...' error.

 

I copied the admin version of the tep_href_link over (it has a little more information on the error) and it says that there's all empty arguments passed to the function!??!?!

 

I'm seriously frustrated. Oh yeah, and my client now officially hates me.

 

-chicken

Link to comment
Share on other sites

Can you both post the following information

 

Operating System

php version & mode (mode=cgi or mode=module)

Mysql version

Web server name & version (e.g. Apache 1.32)

Trust me, I'm an Accountant.

Link to comment
Share on other sites

Hello,

 

I'm having the same problem as orange chicken and on a live store that was working very well right up til my host upgraded php to 4.3.0... Now this same error on checkout_confirmation.php Hitting refresh twice goes right on past without trouble and for now I think I'll mode the error message to let users know they should hit refresh repeatedly because otherwsie they may turn away...

 

If anyone has any info on what may be causing this I'd really, really like to know.

 

NOTE: When 4.3.0 was installed it caused many linkage errors due to problems with $PHP_SELF even when register globals is on but my host aopplied a patch to fix this problem in 4.3.0 and it would appear this linkage problem is the only one I see remaining...

 

Hope this helps the dev type people. I've heavily customized some parts of my system but I'm not very knowledgable in depth on the system.

 

I'd like to fix this real fast though. Of course.

 

Chris :(

Link to comment
Share on other sites

Hooray! I'm not crazy.

 

Now if we can just get some of the OSC devs to look at it (actually, I believe Gary Burton is testing it some where).

 

My client's *pissed* that his store is down and I've been thinking I was just not bright enough to find the issue. It's good to make progress towards an answer.

 

-chicken

Link to comment
Share on other sites

I'm still having this problem on my development server, but it works fine on my production server so... if it's got to screw up that's the order to do it in!

 

Server OS: Windows 2000

Database: MySQL 3.23.53-max-debug

HTTP Server: Microsoft-IIS/5.0

PHP Version: 4.3.0RC2 (Zend: 1.4.0)

Link to comment
Share on other sites

php 4.3 seems to be the common factor. I think this may be a $php_self problem. Although it is still avialable I believe it is no longer an auto global. I really need to go and look at php.net to see if there are any clues there.

Trust me, I'm an Accountant.

Link to comment
Share on other sites

Hi,

There is some connection here for sure. I haven't been able to work on this any more yet. I know that when php 4.3.0 was first installed the $PHP_SELF global was always filled with garbage and every page that referenced links using tep_href_link would not link properly. I asked my host about it and they applied a php_self_fix that corrected that problem,

 

Now all pages are linking except as far as I can tell so far only the checkout_confirmation. Assuming the GV system installed (since I have that) this page makes a call to 2 fucntion is that class and both cause a page link error. If I comment out the 2 calls then it proceeds without trouble but of course it doesn't process any gift vouchers. Since I'm offering an intro special coupon this is really bad for me right now.

 

My suspicion is that there is some other sligh variation between 4.3.0 and 4.2.3 and this GV code in question has something that is affected by it. But I'm pretty busy with other stuff and it may not be until later that I can look at these 2 functions in detail and see where they're going wrong. It sounds like they are coming up with empty page reference when they should be linking back to the checkout_payment page to allow for entering more than 1 coupon/GV code. Maybe the answer for the time being is to hard code in the back linkage...

 

Chris :)

Link to comment
Share on other sites

No, actually $PHP_SELF is built in to php as a global but only I beleive when register globals is on. I may be wrong about that. I didn't look it up for this question. But also it's the same as $GLOBALS['PHP_SELF']. On my installtion this var is now showing correct values so I doubt that it's really causing the trouble. I think some other 4.3.0 change may be hiding in the background. Not sure about that though, as only testing and tracing the code can show for sure...

Link to comment
Share on other sites

Is there some way to reference the line of code that called a function? Doing __LINE__ won't work.

 

I guess maybe you could pass __LINE__ in for every href_link but what a pain that would be. Maybe I'll try and make a back-up of the whole site and do a global search and replace (putting __LINE__ as the first parameter of href_link globally *should* work). I'll try that and come back with my results.

 

-chicken

Link to comment
Share on other sites

Hi orangechicken,

If you're going to do this maybe just try doing it in the places in question in the gv files. Put the parameter at the end (last) and change the function declaration to supply a default value like "unknown". The default paramet means that all the other places ion the system will still work but the few places where you're interested in info will pass a value that you can print or otherwise test. I use this method often and it's helpful.

I haven't tested more because I am away from my office omputer and so don't have an environment. I can do email and browsing and basic maintenance but have to wait til I'm back to really dig in.

Chris :)

Link to comment
Share on other sites

This is seriously weirding me out.

 

My problem doesn't seem to be with the GV stuff (I can't find the two GV functions you reference).

 

My problem, at least partially occurs in ccval.php!?!

 

In the pre_confirmation_check() call of my payment module, CCValidationSolution is called. The cc_number gets passed to it correctly.

 

*BUT*, during that function information ***DISAPPEARS***.

 

I modified the code to print out the value of $Number. I changed it to this:

echo "Before OnlyNumericSolution: " . $Number . "<br>n";

   $Number = OnlyNumericSolution($Number);

echo "After OnlyNumericSolution: " . $Number . "<br>n";

 

And I modified ccval.php's OnlyNumericSolution to look like this:

  function OnlyNumericSolution($Number) {

echo "OnlyNumericSolution: " . $Number . "<br>n";

   return substr(ereg_replace('[^0-9]', '', $Number) , 0, 19);

 }

 

Uploaded it and tested and it echoed this:

 

Before OnlyNumericSolution: 4111 1111 1111 1111

OnlyNumericSolution:

After OnlyNumericSolution:

 

?!?!?!? So the card number is there the line before the call to the function but the value of $Number isn't passed *to* the function? That makes no sense.

 

This is really driving me crazy!

Link to comment
Share on other sites

I'm going to install 4.3.0 on my dev machine tonight to see if I can reproduce it. I'll post here when it's installed and I've tested checkout a couple of times.

Trust me, I'm an Accountant.

Link to comment
Share on other sites

Well it's not an occurance of $PHP_SELF that's causing the problem. I replaced all instances with $_SERVER[ 'PHP_SELF' ];

 

Though I did find a bug that was probably fixed after my snapshot (an old ass August snapshot): There were instances of $_SERVER[ 'php_self' ] which evaluated to blank strings or null. This occurred after an order was processed and the Continue button was clicked (and the action was 'notify'). Changing it to all caps fixed 'PHP_SELF' *that* problem....

 

Too bad it didn't fix this main problem.

Link to comment
Share on other sites

  • 3 years later...

I am now having the same problem on PPHP 4.3.1. Do you know how to fix this?

 

 

What's crazy about mine is that if I hit refresh on checkout_confirmation.php everything works out fine.

I've narrowed it down to this:

  if (MODULE_PAYMENT_INSTALLED) {

$payment_modules->pre_confirmation_check();

 }

An echo "here"; exit; before that snippet says 'here' and exits. Directly after gives me the 'Unable to determine...' error.

I copied the admin version of the tep_href_link over (it has a little more information on the error) and it says that there's all empty arguments passed to the function!??!?!

I'm seriously frustrated. Oh yeah, and my client now officially hates me.

-chicken

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...