Jump to content

Basket page blank


Christopher Short

Recommended Posts

As its contents? Ok. (Not its filename, nor its CHMOD permissions, that is.)

 

Here is what I have for line 185:

$value = $rateReply->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount;

Technically, this should work. But perhaps there is a quirk in your specific version of PHP. If this is the case, then make that line look like these:

$fedex_tmp1 = $rateReply->RatedShipmentDetails; // an array of objects
$fedex_tmp2 = array_shift($fedex_tmp1); // get first element of array, the value of which is an object
$value = $fedex_tmp2->ShipmentRateDetail->TotalNetCharge->Amount;

It's weird that the error log contained 111, but it could be the logical equivalent of three true values. Anyway, it would probably be better if you now removed that error_log() statement.

 

Hopefully, by breaking down the single statement, PHP won't have a problem with it anymore, or we can get a better idea what piece is still causing a problem.

 

If line 185 in your file is NOT what I coded above, then let us know what line 185 actually is in your file.

Link to comment
Share on other sites

As its contents? Ok. (Not its filename, nor its CHMOD permissions, that is.)

 

Here is what I have for line 185:

$value = $rateReply->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount;

Technically, this should work. But perhaps there is a quirk in your specific version of PHP. If this is the case, then make that line look like these:

$fedex_tmp1 = $rateReply->RatedShipmentDetails; // an array of objects
$fedex_tmp2 = array_shift($fedex_tmp1); // get first element of array, the value of which is an object
$value = $fedex_tmp2->ShipmentRateDetail->TotalNetCharge->Amount;

It's weird that the error log contained 111, but it could be the logical equivalent of three true values. Anyway, it would probably be better if you now removed that error_log() statement.

 

Hopefully, by breaking down the single statement, PHP won't have a problem with it anymore, or we can get a better idea what piece is still causing a problem.

 

If line 185 in your file is NOT what I coded above, then let us know what line 185 actually is in your file.

Line 185 was exact. I changed it and it still does the blank page.

Link to comment
Share on other sites

Is the file as discussed in post#10 still present? And yet, there is no 'error_log' file in CubeCart's main folder?

Fixed that, some how the file was renamed .php.php. Here is the log.

 

[24-Nov-2014 23:34:59 America/New_York] PHP Notice:  Error: Hook 'Featured_Products/hooks/admin.navigation.php' was not found in /home/clarkword/public_html/csrocketry.com/store/classes/hookloader.class.php on line 163

[24-Nov-2014 23:35:01 America/New_York] PHP Fatal error:  Cannot use object of type stdClass as array in /home/clarkword/public_html/csrocketry.com/store/modules/shipping/FedEx/shipping.class.php on line 186

[24-Nov-2014 23:35:08 America/New_York] PHP Notice:  Error: Hook 'Featured_Products/hooks/admin.navigation.php' was not found in /home/clarkword/public_html/csrocketry.com/store/classes/hookloader.class.php on line 163

[24-Nov-2014 23:35:09 America/New_York] PHP Warning:  Invalid argument supplied for foreach() in /home/clarkword/public_html/csrocketry.com/store/modules/plugins/GWorks_Featured_Item/hooks/class.gui.display_random_product.php(1) : eval()'d code(1) : eval()'d code(1) : eval()'d code on line 200

[24-Nov-2014 23:35:09 America/New_York] PHP Warning:  implode() [<a href='http://docs.php.net/manual/en/function.implode.php'>function.implode.php</a>]: Invalid arguments passed in /home/clarkword/public_html/csrocketry.com/store/modules/plugins/GWorks_Featured_Item/hooks/class.gui.display_random_product.php(1) : eval()'d code(1) : eval()'d code(1) : eval()'d code on line 203

[24-Nov-2014 23:35:09 America/New_York] PHP Warning:  Invalid argument supplied for foreach() in /home/clarkword/public_html/csrocketry.com/store/modules/plugins/GWorks_Featured_Item/hooks/class.gui.display_random_product.php(1) : eval()'d code(1) : eval()'d code(1) : eval()'d code on line 208

[24-Nov-2014 23:35:09 America/New_York] PHP Warning:  implode() [<a href='http://docs.php.net/manual/en/function.implode.php'>function.implode.php</a>]: Invalid arguments passed in /home/clarkword/public_html/csrocketry.com/store/modules/plugins/GWorks_Featured_Item/hooks/class.gui.display_random_product.php(1) : eval()'d code(1) : eval()'d code(1) : eval()'d code on line 211

[24-Nov-2014 23:35:09 America/New_York] PHP Warning:  array_rand() expects parameter 1 to be array, boolean given in /home/clarkword/public_html/csrocketry.com/store/modules/plugins/GWorks_Featured_Item/hooks/class.gui.display_random_product.php(1) : eval()'d code(1) : eval()'d code(1) : eval()'d code on line 230

[24-Nov-2014 23:35:09 America/New_York] PHP Notice:  Error: Hook 'Featured_Products/hooks/class.gui.display.php' was not found in /home/clarkword/public_html/csrocketry.com/store/classes/hookloader.class.php on line 163

[24-Nov-2014 23:35:09 America/New_York] PHP Warning:  Invalid argument supplied for foreach() in /home/clarkword/public_html/csrocketry.com/store/modules/plugins/GWorks_Featured_Item/hooks/class.gui.display_random_product.php(1) : eval()'d code(1) : eval()'d code(1) : eval()'d code on line 200

[24-Nov-2014 23:35:09 America/New_York] PHP Warning:  implode() [<a href='http://docs.php.net/manual/en/function.implode.php'>function.implode.php</a>]: Invalid arguments passed in /home/clarkword/public_html/csrocketry.com/store/modules/plugins/GWorks_Featured_Item/hooks/class.gui.display_random_product.php(1) : eval()'d code(1) : eval()'d code(1) : eval()'d code on line 203

[24-Nov-2014 23:35:09 America/New_York] PHP Warning:  Invalid argument supplied for foreach() in /home/clarkword/public_html/csrocketry.com/store/modules/plugins/GWorks_Featured_Item/hooks/class.gui.display_random_product.php(1) : eval()'d code(1) : eval()'d code(1) : eval()'d code on line 208

[24-Nov-2014 23:35:09 America/New_York] PHP Warning:  implode() [<a href='http://docs.php.net/manual/en/function.implode.php'>function.implode.php</a>]: Invalid arguments passed in /home/clarkword/public_html/csrocketry.com/store/modules/plugins/GWorks_Featured_Item/hooks/class.gui.display_random_product.php(1) : eval()'d code(1) : eval()'d code(1) : eval()'d code on line 211

[24-Nov-2014 23:35:09 America/New_York] PHP Warning:  array_rand() expects parameter 1 to be array, boolean given in /home/clarkword/public_html/csrocketry.com/store/modules/plugins/GWorks_Featured_Item/hooks/class.gui.display_random_product.php(1) : eval()'d code(1) : eval()'d code(1) : eval()'d code on line 230

[24-Nov-2014 23:35:09 America/New_York] PHP Notice:  Error: Hook 'Featured_Products/hooks/class.gui.display.php' was not found in /home/clarkword/public_html/csrocketry.com/store/classes/hookloader.class.php on line 163

 

Link to comment
Share on other sites

Ok, the Fatal Error is now on line 186:

$fedex_tmp2 = array_shift($fedex_tmp1); // get first element of array, the value of which is an object

Let's try to make the (supposed) array into an actual array:

$fedex_tmp2 = array_shift((array)$fedex_tmp1); // get first element of array, the value of which is an object
Link to comment
Share on other sites

 

Ok, the Fatal Error is now on line 186:

$fedex_tmp2 = array_shift($fedex_tmp1); // get first element of array, the value of which is an object

Let's try to make the (supposed) array into an actual array:

$fedex_tmp2 = array_shift((array)$fedex_tmp1); // get first element of array, the value of which is an object

[24-Nov-2014 23:57:57 America/New_York] PHP Fatal error:  Only variables can be passed by reference in /home/clarkword/public_html/csrocketry.com/store/modules/shipping/FedEx/shipping.class.php on line 187

[24-Nov-2014 23:58:01 America/New_York] PHP Fatal error:  Only variables can be passed by reference in /home/clarkword/public_html/csrocketry.com/store/modules/shipping/FedEx/shipping.class.php on line 187

Link to comment
Share on other sites

Freaky interesting!

Let's try something funky for line 186:

$fedex_tmp_array = (array)$fedex_tmp1; $fedex_tmp2 = array_shift($fedex_tmp_array); // get first element of array, the value of which is an object

I wonder if line 187 now needs to go all the way:

Was:
$value = $fedex_tmp2->ShipmentRateDetail->TotalNetCharge->Amount;
 
Now:
$fedex_tmp3 = $fedex_tmp2->ShipmentRateDetail;
$fedex_tmp4 = $fedex_tmp3->TotalNetCharge;
$value = $fedex_tmp4->Amount;
Link to comment
Share on other sites

 

Freaky interesting!

Let's try something funky for line 186:

$fedex_tmp_array = (array)$fedex_tmp1; $fedex_tmp2 = array_shift($fedex_tmp_array); // get first element of array, the value of which is an object

I wonder if line 187 now needs to go all the way:

Was:
$value = $fedex_tmp2->ShipmentRateDetail->TotalNetCharge->Amount;
 
Now:
$fedex_tmp3 = $fedex_tmp2->ShipmentRateDetail;
$fedex_tmp4 = $fedex_tmp3->TotalNetCharge;
$value = $fedex_tmp4->Amount;

hmmmm.....Seems to fix it. The page loads. However, it does not pull a shipping quote.

Link to comment
Share on other sites

Well, there is this:

if($this->_settings['FDXG_'.$rateReply->ServiceType]==1){

which tells me that the FedEx module will record what types of services you have enabled.

 

Examples:

FDXG_FIRST_OVERNIGHT

FDXG_PRIORITY_OVERNIGHT

FDXG_STANDARD_OVERNIGHT

FDXG_FEDEX_2_DAY_AM

FDXG_FEDEX_2_DAY

and a couple more.

 

In the response you posted in #24 above, these are coming back with prices.

 

So, which of the FedEx services do you have enabled?

Link to comment
Share on other sites

Well, there is this:

if($this->_settings['FDXG_'.$rateReply->ServiceType]==1){
which tells me that the FedEx module will record what types of services you have enabled.

Examples:

FDXG_FIRST_OVERNIGHT

FDXG_PRIORITY_OVERNIGHT

FDXG_STANDARD_OVERNIGHT

FDXG_FEDEX_2_DAY_AM

FDXG_FEDEX_2_DAY

and a couple more.

In the response you posted above, these are coming back with prices.

So, which of the FedEx services do you have enabled?

Just ground

Link to comment
Share on other sites

Then there should be $9.36 showing, and maybe the phrase "FedEx Ground".

 

Let's look at what used to be line 195:

'name' => (string)"FedEx ".$this->friendlyServiceName($rateReply->ServiceType),

Getting the type caster affixed to the proper variable has been discussed with Devellion before. Change to:

'name' => "FedEx ".$this->friendlyServiceName((string)$rateReply->ServiceType),

Hopefully, making this edit will reveal the 'friendly name' of the service.


Please remind me of the exact version of PHP that is running your site.

Link to comment
Share on other sites

Then there should be $9.36 showing, and maybe the phrase "FedEx Ground".

 

Let's look at what used to be line 195:

'name' => (string)"FedEx ".$this->friendlyServiceName($rateReply->ServiceType),

Getting the type caster affixed to the proper variable has been discussed with Devellion before. Change to:

'name' => "FedEx ".$this->friendlyServiceName((string)$rateReply->ServiceType),

Hopefully, making this edit will reveal the 'friendly name' of the service.

Please remind me of the exact version of PHP that is running your site.

PHP 5.4.33

 

What is this change supposed to do? I don't see any change. The fedex option shows FEDEX, then the choice is $0.00(Fedex ground)

Link to comment
Share on other sites

So you do see the string "(FedEx Ground)" (or is 'ground' actually lower-case)? If so, it seems the edit in post#40 was not necessary.

 

Getting this, "$0.00(Fedex ground)", is entirely not the same problem as, "However, it does not pull a shipping quote."

 

Back at post#36 where I gave an edit to create three lines out of one, let's make this edit:

Was:
$value = $fedex_tmp4->Amount;
 
Now:
$value = (float)$fedex_tmp4->Amount;

Because after this statement, CubeCart wants to add any handling charges, a value, to what is currently an object. But I am not sure what the result will be.

Link to comment
Share on other sites

I am out of ideas.

 

If these were files that I could seriously mangle, I could probably find the culprit. But by mangling the code, the store would not function at all.

 

A more cautious approach would be to put:

$print_r = print_r($suspect_variable,true); trigger_error($print_r);

at the end of every suspect statement and hope there are interpretable results in the error_log file.

Link to comment
Share on other sites

As is seen in post #24, there is a response and the response appears correct. For example, FEDEX_GROUND gives a TotalNetCharge of 9.36.

 

The problem is that, for some reason I cannot determine, the module code is not extracting that value from the response in an appropriate way.

 

The edits made to the module code did find find a couple of peculiarities and they have been dealt with. Yet, the extracted value is still not getting assigned to the $value variable in a way that it can be used for later calculations.

 

The funny thing is that the module code is identical to CubeCart version 5.2.0 (post #20). The shop's handling charge shows up (post #43), so that means all the other code that collects and displays shipping quotes is working.

 

It has to be the means of extracting that quote. The only other change that could have happened between when FedEx was working and now it's not is that the site is now running a version of PHP (5.4.33) that has an undiscovered bug in it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...