bsmither Posted November 25, 2014 Share Posted November 25, 2014 What do you mean by, "and the file has 111"? Quote Link to comment Share on other sites More sharing options...
Christopher Short Posted November 25, 2014 Author Share Posted November 25, 2014 What do you mean by, "and the file has 111"? The error log created by the code you had me add. All it had was that set of numbers. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 25, 2014 Share Posted November 25, 2014 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. Quote Link to comment Share on other sites More sharing options...
Christopher Short Posted November 25, 2014 Author Share Posted November 25, 2014 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. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 25, 2014 Share Posted November 25, 2014 Now you need to look in whatever error log file you found the log entry in as you posted in #17 above. Quote Link to comment Share on other sites More sharing options...
Christopher Short Posted November 25, 2014 Author Share Posted November 25, 2014 Now you need to look in whatever error log file you found the log entry in as you posted in #17 above. It is not creating one.....I deleted the last one and nothing else has appeared for a few days. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 25, 2014 Share Posted November 25, 2014 Is the file as discussed in post#10 still present? And yet, there is no 'error_log' file in CubeCart's main folder? Quote Link to comment Share on other sites More sharing options...
Christopher Short Posted November 25, 2014 Author Share Posted November 25, 2014 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 Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 25, 2014 Share Posted November 25, 2014 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 Quote Link to comment Share on other sites More sharing options...
Christopher Short Posted November 25, 2014 Author Share Posted November 25, 2014 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 Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 25, 2014 Share Posted November 25, 2014 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; Quote Link to comment Share on other sites More sharing options...
Christopher Short Posted November 25, 2014 Author Share Posted November 25, 2014 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. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 25, 2014 Share Posted November 25, 2014 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? Quote Link to comment Share on other sites More sharing options...
Christopher Short Posted November 25, 2014 Author Share Posted November 25, 2014 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 Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 25, 2014 Share Posted November 25, 2014 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. Quote Link to comment Share on other sites More sharing options...
Christopher Short Posted November 25, 2014 Author Share Posted November 25, 2014 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) Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 26, 2014 Share Posted November 26, 2014 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. Quote Link to comment Share on other sites More sharing options...
Christopher Short Posted November 26, 2014 Author Share Posted November 26, 2014 I made the change. Still the same. If you have a handling fee, it shows up but no real shipping charges. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 26, 2014 Share Posted November 26, 2014 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. Quote Link to comment Share on other sites More sharing options...
Christopher Short Posted November 27, 2014 Author Share Posted November 27, 2014 I am out of ideas. What I don't understand is what caused it to stop working. I did not make any changes to anything in cubecart and it quit working. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted November 27, 2014 Share Posted November 27, 2014 Fedex and UPS are both making major changes in the way shipping charges are calculated as of Jan, 2015 - dimensional weight pricing on ALL package sizes. Perhaps Fedex has made some intermediary change in preparation? Quote Link to comment Share on other sites More sharing options...
Christopher Short Posted November 27, 2014 Author Share Posted November 27, 2014 Fedex and UPS are both making major changes in the way shipping charges are calculated as of Jan, 2015 - dimensional weight pricing on ALL package sizes. Perhaps Fedex has made some intermediary change in preparation? I still have box dimensions in there, as I have forever. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted November 27, 2014 Share Posted November 27, 2014 True, but currently, as I understand it, the Dimensional weight pricing only is used for calculations on larger packages. That will change Jan. 1. Since you're sure you have made no changes, perhaps your host or Fedex has made a change of some kind. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 27, 2014 Share Posted November 27, 2014 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.