Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Idea or Suggestion FedEx Web Services - change number # of business days

    When text related to the ( number of business days ) the shipping service has quoted - is not realistically possible to ship - Example: If a customer orders beyond the FedEx pickup hours or beyond depot hours of operation.

    You can take control or filter out the $transitTime - related to # of days 'quoted' by FedEx

    change line 602 - 605
    if ($new_cost < 0) $new_cost = 0;
    $methods[] = array('id' => str_replace('_', '', $rateReply->ServiceType),
    'title' => ucwords(strtolower(str_replace('_', ' ', $rateReply->ServiceType))) . $transitTime,
    'cost' => $new_cost);

    to this:
    if ($new_cost < 0) $new_cost = 0;
    // Twitch this line defines the display text in the shopping cart
    /* original $methods[] = array('id' => str_replace('_', '', $rateReply->ServiceType),
    'title' => ucwords(strtolower(str_replace('_', ' ', $rateReply->ServiceType))) . $transitTime,
    'cost' => $new_cost); */
    // Redoc - Method used to see EXACTLY what the stored value is - var_dump ($transitTime);
    if ($transitTime == " (1 business day)" ) {
    // This allows you to control the output in case the stock FedEx return details do not match real world shipment times
    // Hide $transitTime output
    // $methods[] = array('id' => str_replace('_', '', $rateReply->ServiceType),
    // 'title' => ucwords(strtolower(str_replace('_', ' ', $rateReply->ServiceType))) /*. $transitTime*/,
    // 'cost' => $new_cost);
    // Change output
    $transitTime = ' (2 business days)';
    $methods[] = array('id' => str_replace('_', '', $rateReply->ServiceType),
    'title' => ucwords(strtolower(str_replace('_', ' ', $rateReply->ServiceType))) . $transitTime,
    'cost' => $new_cost);
    } elseif ($transitTime == '') {
    $transitTime = ' (1 business day)';
    $methods[] = array('id' => str_replace('_', '', $rateReply->ServiceType),
    'title' => ucwords(strtolower(str_replace('_', ' ', $rateReply->ServiceType))) . $transitTime,
    'cost' => $new_cost);
    } else {
    // Show transitTime output
    $methods[] = array('id' => str_replace('_', '', $rateReply->ServiceType),
    'title' => ucwords(strtolower(str_replace('_', ' ', $rateReply->ServiceType))) . $transitTime,
    'cost' => $new_cost);
    } // Twitch end of $transitTime split


    There are other uses for this text change/injection - you could now communicate very accurate or separately automated transit times to the customer. Use your own calculation/algorithm here to predict and in time for weekends, holidays etc.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  2. #2
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: FedEx Web Services - change number # of business days

    The first post was for FedEx Web Services 1.52

    Be certain you have Show Estimated Transit Time set to true

    If you have upgraded to 1.76/1.78 this is the code you need to change around line 759:
    if($transitTime != ''){
    $quote_title = ucwords(strtolower(str_replace('_', ' ', $rateReply->ServiceType))) . $transitTime;


    to this:
    // bof Twitch ETA controller - if Show Estimated Transit Time == true
    // var_dump ($transitTime); // Redoc - Method used to see EXACTLY what the stored value is (coming from FedEx)
    if($transitTime != ''){
    if ($transitTime == " (1 business day)" ) {
    // This allows you to control the output in case the stock FedEx return details do not match real world shipment times
    $transitTime = ' (2 business days)';
    }
    // eof Twitch ETA controller
    $quote_title = ucwords(strtolower(str_replace('_', ' ', $rateReply->ServiceType))) . $transitTime;


    This will allow the ETA output to remain unfiltered. ($transitTime can be text or pulled from the DeliveryDayOfWeek/DeliveryTimestamp)

    As before you can add a code to advance the ETA estimates to meet your own needs, add your own message for shipment times/special holidays or simply set the new transit time switch to false to hide them.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

 

 

Similar Threads

  1. Replies: 5
    Last Post: 22 Jan 2018, 10:00 PM
  2. v151 Numinix Fedex Web Services + Fedex LTL
    By Feznizzle in forum Addon Shipping Modules
    Replies: 4
    Last Post: 10 Jun 2013, 09:09 PM
  3. Replies: 0
    Last Post: 19 Dec 2012, 11:50 PM
  4. v139h FedEx Web Services: ERROR: Meter number is missing or invalid.
    By lemonygem in forum Addon Shipping Modules
    Replies: 1
    Last Post: 14 Sep 2012, 10:55 PM
  5. FedEx Web Services
    By markalpine in forum Addon Shipping Modules
    Replies: 1
    Last Post: 10 Jun 2011, 11:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR