Post by mkofirearms » Fri Feb 16, 2018 3:22 am

i'm having same trouble with fedex as OP did om vrsion 3.0.2.0
I corrected the URL in fedex.php and lines in fedex.twig. uninstalled, cleared cash, restarted, etc as per instructions.
however i still having trouble. Services checkbox selections still don't stay selected in fedex setup module.
from website checkout page i get " Warning: No Shipping options are available."

from admin side OC logs getting this message:

2018-02-15 19:14:33 - PHP Warning: in_array() expects parameter 2 to be array, null given in /.../.../public_html/catalog/model/extension/shipping/fedex.php on line 180

line 180 consists of:

if (in_array(strtoupper($code), $this->config->get('shipping_fedex_service'))) {
$title = $this->language->get('text_' . $code);

$delivery_time_stamp = $rate_reply_detail->getElementsByTagName('DeliveryTimestamp');

if ($this->config->get('shipping_fedex_display_time') && $delivery_time_stamp->length) {
$title .= ' (' . $this->language->get('text_eta') . ' ' . date($this->language->get('date_format_short') . ' ' . $this->language->get('time_format'), strtotime($delivery_time_stamp->item(0)->nodeValue)) . ')';
}

$rated_shipment_details = $rate_reply_detail->getElementsByTagName('RatedShipmentDetails');

foreach ($rated_shipment_details as $rated_shipment_detail) {
$shipment_rate_detail = $rated_shipment_detail->getElementsByTagName('ShipmentRateDetail')->item(0);
$shipment_rate_detail_type = explode('_', $shipment_rate_detail->getElementsByTagName('RateType')->item(0)->nodeValue);

if (count($shipment_rate_detail_type) == 3 && $shipment_rate_detail_type[1] == $this->config->get('shipping_fedex_rate_type')) {
$total_net_charge = $shipment_rate_detail->getElementsByTagName('TotalNetCharge')->item(0);

break;
}
}

$cost = $total_net_charge->getElementsByTagName('Amount')->item(0)->nodeValue;

$currency = $total_net_charge->getElementsByTagName('Currency')->item(0)->nodeValue;

$quote_data[$code] = array(
'code' => 'fedex.' . $code,
'title' => $title,
'cost' => $this->currency->convert($cost, $currency, $this->config->get('config_currency')),
'tax_class_id' => $this->config->get('shipping_fedex_tax_class_id'),
'text' => $this->currency->format($this->tax->calculate($this->currency->convert($cost, $currency, $this->session->data['currency']), $this->config->get('shipping_fedex_tax_class_id'), $this->config->get('config_tax')), $this->session->data['currency'], 1.0000000)
);
}

I see the problem is in parameter 2 but which one of these is parameter 2?

my fedex.php

Image

my fedex.twig

Image

Newbie

Posts

Joined
Wed Feb 14, 2018 5:12 am

Post by AllenFreeman » Sun Mar 04, 2018 2:06 am

I'm having the same issue as described, and I have carefully implemented all of the steps outlined above as stated (edited fedex.twig and fedex.php, cleared cache, restarted, etc.)

The Services checkboxes within the fedex extension still won't stay checked.

And when I do test order, I get the red ERROR. Log below.

Any advice would be appreciated. Thx!

Error log:
2018-03-03 17:56:54 - FEDEX :: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelop ... :RateReply xmlns:v10="http://fedex.com/ws/rate/v10"> <v10:HighestSeverity xmlns:v10="http://fedex.com/ws/rate/v10">ERROR</v1 ... stSeverity> <v10:Notifications xmlns:v10="http://fedex.com/ws/rate/v10"> <v10:Severity xmlns:v10="http://fedex.com/ws/rate/v10">ERROR</v10:Severity> <v10:Source xmlns:v10="http://fedex.com/ws/rate/v10">prof</v10:Source> <v10:Code xmlns:v10="http://fedex.com/ws/rate/v10">1000</v10:Code> <v10:Message xmlns:v10="http://fedex.com/ws/rate/v10">Authentication Failed</v10:Message> </v10:Notifications> <v10:Version xmlns:v10="http://fedex.com/ws/rate/v10"> <v10:ServiceId xmlns:v10="http://fedex.com/ws/rate/v10">crs</v10:ServiceId> <v10:Major xmlns:v10="http://fedex.com/ws/rate/v10">10</v10:Major> <v10:Intermediate xmlns:v10="http://fedex.com/ws/rate/v10">0</v10:Intermediate> <v10:Minor xmlns:v10="http://fedex.com/ws/rate/v10">0</v10:Minor> </v10:Version> </v10:RateReply></SOAP-ENV:Body></SOAP-ENV:Envelope>

New member

Posts

Joined
Tue Feb 20, 2018 10:18 pm

Post by AllenFreeman » Tue Mar 06, 2018 9:46 am

I have followed the instructions in this thread for corrections to fedex.twig and fedex.php. Both issues were found, corrected, uploaded. Installed as instructed, cleared cache, maintenance refresh, etc. The Fedex connection is correct with meter/key/pw.

But the doggone Services checkboxes won't stay checked!

The only error log message I'm getting is about line 355, which is that no services have been designated.

I'm using v3.0.2.0. Might anything in this version be different from the time when straightlight posted the original solution?

Thanks in advance for any suggestions...

--AllenFreeman

New member

Posts

Joined
Tue Feb 20, 2018 10:18 pm

Post by Bunny168 » Wed Apr 04, 2018 7:35 am

I also followed the instructions in this thread for corrections to fedex.twig and fedex.php.
Confirmed with FedEx web services support that both URLs works and there's no need to modify fedex.php
FedEx is getting the request from my site and sending the quote back.
However, I'm getting these error (which can be found in the OC error log):
Warning: in_array() expects parameter 2 to be array, null given in . . . . . catalog/model/extension/shipping/fedex.php on line 180
My OC version is 3.0.2.0. Not sure if this is related to my recent site migration from http to https
Seems like the problem is on the OC side.
Please help

Newbie

Posts

Joined
Tue Aug 22, 2017 6:45 am

Post by straightlight » Wed Apr 04, 2018 6:47 pm

My OC version is 3.0.2.0. Not sure if this is related to my recent site migration from http to https
Seems like the problem is on the OC side.
What are the web access logs reporting about fedex.php file when using https?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ssrw » Tue Jun 19, 2018 6:54 pm

We have also followed the instructions in this thread and it HAS NOT resolved the issue.

Is there any update on this?

This is somewhat time-urgent for us.

Thanks in advance.

Newbie

Posts

Joined
Thu Jul 27, 2017 10:17 pm

Post by MajorPain » Wed Jul 11, 2018 5:58 am

I also did a new install andsetup fedex module.
Made the changes to both files and I also get the error on checkout.

Code: Select all

Warning: in_array() expects parameter 2 to be array, null given in /home/valleybee/store2.valleybeekeeping.com/catalog/model/extension/shipping/fedex.php on line 180Warning: in_array() expects parameter 2 to be array, null given in /home/valleybee/store2.valleybeekeeping.com/catalog/model/extension/shipping/fedex.php on line 180Warning: in_array() expects parameter 2 to be array, null given in /home/valleybee/store2.valleybeekeeping.com/catalog/model/extension/shipping/fedex.php on line 180Warning: in_array() expects parameter 2 to be array, null given in /home/valleybee/store2.valleybeekeeping.com/catalog/model/extension/shipping/fedex.php on line 180Warning: in_array() expects parameter 2 to be array, null given in /home/valleybee/store2.valleybeekeeping.com/catalog/model/extension/shipping/fedex.php on line 180

Active Member

Posts

Joined
Mon Jul 09, 2018 9:05 am

Post by Garden of Mirth » Tue Aug 07, 2018 11:58 pm

Followed instructions to the letter. FedEx selections will not stay selected and when testing all I get is that big red ERROR on the page. Nothing here seems to work and there's been no new answers. Has anyone had any success figuring this out? FedEx needs to be a shipping option.


Posts

Joined
Sun Aug 05, 2018 6:41 am

Post by DavidL » Sat Oct 20, 2018 5:32 am

Had the same issue and applied straightlights's two fixes and so far so good! Shipping method checkboxes remain checked!
Now need to test a complete end to end order with shipping and fingers crossed!

Thanx Straightlight!
BTW...curious on why since 2017 these fixes aren't in the Opencart production build... any ideas?

Newbie

Posts

Joined
Sun Dec 07, 2014 5:06 am

Post by straightlight » Sun Oct 21, 2018 1:08 am

Had the same issue and applied straightlights's two fixes and so far so good! Shipping method checkboxes remain checked!
Thanks for the feedback.
BTW...curious on why since 2017 these fixes aren't in the Opencart production build... any ideas?
[
The replies size of this topic already describes the reason why. As I mentioned before on other topics, if one can succeed on implementing solutions, normally, others can as well. It is all a matter of properly following the instructions and being able to read more than one line from those provided instructions.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by dcol » Fri Nov 02, 2018 6:30 am

I also have this issue. Just get Error in a red box. Registered with FedEx and got all the test info. The only thing they did not give me was the 'Post Code'. Is that my zip code or the test one or something completely different?

Newbie

Posts

Joined
Thu Nov 01, 2018 7:45 am

Post by dcol » Sat Nov 03, 2018 12:26 am

Fixed it. Selected Ounces instead of Pounds in the 'Weight Class' field. Obviously FedEx doesn't like that.

Newbie

Posts

Joined
Thu Nov 01, 2018 7:45 am

Post by ayopencart » Tue Nov 06, 2018 9:36 am

First of all, thanks everyone especially to straightlight's sharing regarding this issue. I have the same issue and also applied straightlight's two fixes, tested on google chrome and firefox, clear cache and browser and even restart the computer many times... but still no luck- the shipping method still won't stay checked.

Here is what i discovered and hopefully anyone can help me to solve the problem:

OC version is 3.0.2.0.
Got everything production key/psd/meter number from FedEx
Post Code: 92618
Test Mode: No
Service Type: FedEx Ground, 2Day, 3Day, Intl Priority, Standard Overnight, Priority Overnight
Dimension: 10x10x8
Length Class: Inch
Drop Off Type: Regular Pickup
Package Type: FedEx Envelop
Rate: Type: List Rate
Weight Class: Pound
Tax Class: Taxable Goods
Geo Zone: All Zones
Status: Enabled

Based on the above settings, during the checkout process, and at the "Estimate Shipping & Taxes" window, there is NO ERROR reported, however there is no shipping methods listed for user to select. It only shows "Warning: No Shipping options are available. Please contact us for assistance!"

After changing the package type to "Your Packaging" or "FedEx Box", I started to see these error messages in front end and admin error log:

Front end Shipping Quote windo:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
OK
<b>Warning</b>: in_array() expects parameter 2 to be array, null given in <b>/store/catalog/model/extension/shipping/fedex.php</b> on line <b>180...{"error":{"warning":"Warning: No Shipping options are available. Please <a href=\"http:\/\/store/index.php?route=information\/contact\">contact us<\/a> for assistance!"}}

Front end checkout page and admin error log:
2018-11-06 0:50:33 - PHP Warning: in_array() expects parameter 2 to be array, null given in /.../.../.../catalog/model/extension/shipping/fedex.php on line 180

line 180 is as some folks mentioned before:

if (in_array(strtoupper($code), $this->config->get('shipping_fedex_service'))) {

Look like to me that it's expecting the service type which can not be saved in the module. Is there an alternative way to save the service type?

Please help. Thank you!
Last edited by ayopencart on Wed Nov 14, 2018 6:26 am, edited 2 times in total.

Newbie

Posts

Joined
Tue Oct 30, 2018 8:28 am

Post by MajorPain » Tue Nov 06, 2018 9:30 pm

I would think that if your only always using the same service type, couldn't you just set the service type in a line before?

Like shipping_fedex_service='ground';

Active Member

Posts

Joined
Mon Jul 09, 2018 9:05 am

Post by ayopencart » Thu Nov 08, 2018 8:18 am

MajorPain wrote:
Tue Nov 06, 2018 9:30 pm
I would think that if your only always using the same service type, couldn't you just set the service type in a line before?

Like shipping_fedex_service='ground';
Thank you for the reply!! Not an expert of writing codes... but finally i got this problem solved!

Needs to pay attention to straiglight's instruction of #6 - Clear the "Opencart cache", have to clear the cache files in system/storage/cache folder via cPanel's file manager or FTP Client, finally the service type stay saved!!

Newbie

Posts

Joined
Tue Oct 30, 2018 8:28 am

Post by straightlight » Thu Nov 08, 2018 6:59 pm

Needs to pay attention to straiglight's instruction of #6 - Clear the "Opencart cache", have to clear the cache files in system/storage/cache folder via cPanel's file manager or FTP Client, finally the service type stay saved!!
Isn't it great when people just needs to follow the FAQ for simplicity: viewtopic.php?f=176&p=737014#p718325

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by MajorPain » Thu Nov 08, 2018 9:41 pm

Followed your clear cache instructions and it didn't work like others mentioned.
Deleting them from the files/folders as mentioned above may be the work around.

Active Member

Posts

Joined
Mon Jul 09, 2018 9:05 am

Post by ayopencart » Wed Nov 14, 2018 6:24 am

Thank you Straightlight for the reminder of the easier way to clear the cache! Really appreciate your patient!

Now the FedEx module is working, but i noticed two issues and wondering if there are solutions:

1. FedEx Ground method does show on Estimated Shipping section on the View Cart page, but it does NOT show up as an option at the checkout page.
2. The rates are different on the Estimated Shipping & Taxes on the view cart page and on the checkout process page

Issue 2 I just remove the codes for that module in the twig template file from admin/theme editor for temporary fix.

Issue 1, in admin -> Extension -> fedex module setup, both FedEx Ground and Ground Home Delivery are checked, however on the front end the home delivery showed up but not FedEx Ground. Anyone can help please? Thank you!

Newbie

Posts

Joined
Tue Oct 30, 2018 8:28 am

Post by cybergr » Thu Jan 17, 2019 6:36 am

I am experiencing the red error at the shopping cart for FedEx rates. Running Version 3.0.2.0
I have dutifully followed the step by step instructions. Double checked by repeating twice. The rate selections ARE SAVING in the Extension settings. I updated the twig and php files, cleared caches, etc. etc. I have my production key from FedEx. I have tried using using pounds and ounces. I'm at a loss as to what to try next.
My error log is showing:
2019-01-16 22:05:09 - FEDEX :: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelop ... :RateReply xmlns:v10="http://fedex.com/ws/rate/v10"> <v10:HighestSeverity xmlns:v10="http://fedex.com/ws/rate/v10">ERROR</v1 ... stSeverity> <v10:Notifications xmlns:v10="http://fedex.com/ws/rate/v10"> <v10:Severity xmlns:v10="http://fedex.com/ws/rate/v10">ERROR</v10:Severity> <v10:Source xmlns:v10="http://fedex.com/ws/rate/v10">prof</v10:Source> <v10:Code xmlns:v10="http://fedex.com/ws/rate/v10">1000</v10:Code> <v10:Message xmlns:v10="http://fedex.com/ws/rate/v10">Authentication Failed</v10:Message> </v10:Notifications> <v10:Version xmlns:v10="http://fedex.com/ws/rate/v10"> <v10:ServiceId xmlns:v10="http://fedex.com/ws/rate/v10">crs</v10:ServiceId> <v10:Major xmlns:v10="http://fedex.com/ws/rate/v10">10</v10:Major> <v10:Intermediate xmlns:v10="http://fedex.com/ws/rate/v10">0</v10:Intermediate> <v10:Minor xmlns:v10="http://fedex.com/ws/rate/v10">0</v10:Minor> </v10:Version> </v10:RateReply></SOAP-ENV:Body></SOAP-ENV:Envelope>

Newbie

Posts

Joined
Thu Jan 03, 2019 4:55 am

Post by goodguyssigns » Fri May 10, 2019 10:04 pm

string(586) "<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelop ... <RateReply xmlns="http://fedex.com/ws/rate/v10"><HighestS ... sage>There are no valid services available. </Message><LocalizedMessage>There are no valid services available. </LocalizedMessage></Notifications><Version><ServiceId>crs</ServiceId><Major>10</Major><Intermediate>0</Intermediate><Minor>0</Minor></Version></RateReply></SOAP-ENV:Body></SOAP-ENV:Envelope>"

Error is "There are no valid services available"

The services are correctly checked and saved per the mods made in this topic. The urls have also been changed per this topic, the test url in this topic also match what fedex sent me for my test account.

Row in setting table from query "SELECT * FROM setting where code='shipping_fedex';"

2619 0 shipping_fedex shipping_fedex_service ["FEDEX_1_DAY_FREIGHT","FEDEX_2_DAY","FEDEX_2_DAY_AM","FEDEX_2_DAY_FREIGHT","FEDEX_3_DAY_FREIGHT","FEDEX_EXPRESS_SAVER","FEDEX_FIRST_FREIGHT","FEDEX_FREIGHT_ECONOMY","FEDEX_FREIGHT_PRIORITY","FEDEX_GROUND","FIRST_OVERNIGHT","GROUND_HOME_DELIVERY","PRIORITY_OVERNIGHT","STANDARD_OVERNIGHT"] 1

I have no relevant changes to the system, this is a stock 3.0.3.1 install
From and to zip codes are correct

Newbie

Posts

Joined
Wed Apr 10, 2019 9:20 pm
Who is online

Users browsing this forum: Majestic-12 [Bot] and 41 guests