Forums / General Questions / Shopping Cart Error when enabling inline shipping estimator?

Shopping Cart Error when enabling inline shipping estimator?

Locked

Views: 5,143

Results 21 to 32 of 32
This thread is locked. New replies are disabled.
26 Apr 2008, 7:01 PM
#22
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Shopping Cart Error when enabling inline shipping estimator?

BlessIsaacola:

Is it possible that this fix I applied could be responsible for my problem? http://www.zen-cart.com/forum/showpost.php?p=487733&postcount=10

Thanks!

Unlikely

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

26 Apr 2008, 9:19 PM
#23
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: Shopping Cart Error when enabling inline shipping estimator?

DrByte, I sent you and Wilt a PM of the code that was output on the screen. It looks like googlecheckout is the culprit. Here is what I suspect:

$products = $cart->get_products();
require_once(DIR_WS_CLASSES . 'order.php');
$order = new order;
$order_items = $order->products;

The above google is from googlecheckout/gcheckout.php. Obviously if GCO is loading php require_once(DIR_WS_CLASSES . 'order.php'); that would explain why it cannot be redeclared. Of course I don't how to convert this so GCO only load ```php
require_once(DIR_WS_CLASSES . 'order.php');


I am not even sure where I am going with this but please take a look at your PM and see if you can guide me in the right direction.
26 Apr 2008, 9:42 PM
#24
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Shopping Cart Error when enabling inline shipping estimator?

BlessIsaacola:

It looks like googlecheckout is the culprit.

I'm not surprised. Hence the suggestion to compare all files vs originals and look for any and all differences.
Of course, checking that each contribution is correctly installed is important too.

Perhaps re-reviewing the GC module files and bugfixes would be appropriate?
Granted, if your site is running an older version of Zen Cart than what the latest GC code is designed for, you could get confusing behavior.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

26 Apr 2008, 9:50 PM
#25
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: Shopping Cart Error when enabling inline shipping estimator?

DrByte:

I'm not surprised. Hence the suggestion to compare all files vs originals and look for any and all differences.
Of course, checking that each contribution is correctly installed is important too.

Perhaps re-reviewing the GC module files and bugfixes would be appropriate?
Granted, if your site is running an older version of Zen Cart than what the latest GC code is designed for, you could get confusing behavior.

You lost me DrByte because your post really is not a solution or suggestion of what to do :) Comparing files actually did not pick up this problem because this is not a standard Zen Cart feature. I was comparing ZC1.3.8a in production to a fresh download of zc1.3.8a to make sure I have the same thing in production. There is not original GCO file to compare to because it's not a Zen Cart core.

I am also using GCO version 1.4.7 which is intended for ZC 1.3.8a. The GCO is no longer supported but I will post in that thread to see if someone have a solution. It's still baffling that the shipping estimator is the action that is triggering this. It would actually have been smarter for shipping estimator and google checkout to both check if something has been declared before trying to redeclare it.

26 Apr 2008, 10:07 PM
#26
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Shopping Cart Error when enabling inline shipping estimator?

Oops ... Somehow I'd thought you'd said you were running 1.3.7 still. Hence the version difference comment.

I can't vouch for the quality of coding of the Google checkout module, nor for any of their reasons behind it being "no longer supported". I can say though that the shipping estimator functions work fine on a clean install of Zen Cart that hasn't been tainted by the GC code.

Technically the "require_once" means ... "only ever load this once, so that 'redeclare' errors cannot happen".

Hopefully someone who's been using or writing the GC code will be able to help you find a way to not start the order class when it's not needed.

Of course if you want to hack up your own Zen Cart code just to accomodate their methods, you could try adding additional code before the require_once statements to check if the $order variable isset() or not, and/or check to see if the order class has been declared yet, and skip the require if it has been. But, that's all hacking about in ZC all because of an addon that's mussing things up ... You can see where I'm going with that thought ...

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 May 2008, 2:42 PM
#27
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: Shopping Cart Error when enabling inline shipping estimator?

Wilt, I just want to update that your fix worked. We've been live with the code changes for about a week now without a single error in the log. Thank you so much. I am surprised that this problem didn't surfaced until now.

31 May 2008, 12:55 PM
#28
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
733
Plugin Contributions:
0

Re: Shopping Cart Error when enabling inline shipping estimator?

Hello there,

I am having the same exact problem. Thought I have 1.38a zencart. But it is definitely when googlecheckout is enabled, inline shipping estimator and when somebody is logged in and viewing shopping cart.

I would be grateful for the fix Wilt gave, this has been driving me crazy for months. lol

Regards,

Heathenmagic :smile:

31 May 2008, 6:33 PM
#29
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: Shopping Cart Error when enabling inline shipping estimator?

in includes/modules/shipping_estimator.php at line 84
chnge it from

require(DIR_WS_CLASSES . 'order.php');

to

require_once(DIR_WS_CLASSES . 'order.php');
31 May 2008, 9:07 PM
#31
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: Shopping Cart Error when enabling inline shipping estimator?

You are certainly welcome but Thanks to Wilt who actually took the time to come up with the solution. The problem was blamed on GCO for a long time but the fix needed to happen in ZC because of the way GCO changes things :smile: