Page 1 of 1

Estimated Delivery Date - FedEx Global Live Rates

Posted: Fri May 17, 2019 12:39 am
by wafflemeister
I am using an old version of FedEx Global Live Rates on OpenCart 1.5.6.4. The extension has the ability to show the Estimated delivery date, which seems to have flaws when estimating delivery dates over weekends. At this point I prefer to show something like '3 Business Days' rather than trying to show dates to not upset customers. Can the below code be modified to do this? Thank you in advance.

Code: Select all

				if ($this->config->get($classname . '_' . $service) != '1') { continue; }

			    $package_count = '';
				if ($this->config->get($classname . '_package_count')) {
					$package_count = ' (' . ($rate['Package_Count'] . $this->language->get('text_pkg')) . ')';
				}

				$delivery_time = '';
				if ($this->config->get($classname . '_transit')) {
					if (!empty($rate['Transit']) && $rate['Transit'] != 'UNKNOWN') {
						if (strpos($rate['Transit'], 'DAY') !== false) {
							$xtransitTime = $transitTime[$rate['Transit']];
						} else {
							$xtransitTime = strtotime($rate['Transit']);
						}

						// Prevent weekends
						if (date('D', $xtransitTime) == 'Sat') {
							$xtransitTime += (86400*2);
						} elseif (date('D', $xtransitTime) == 'Sun') {
							$xtransitTime += 86400;
						} else {
							// Cutoff Time. Add day to shipping
							if (is_numeric($this->config->get('fedex_wsdl_cutoff'))) {
								if ((int)date('H') > (int)$this->config->get('fedex_wsdl_cutoff') || date('H') == '00') {
									$xtransitTime += 86400;
								}
							}
						}

						// Customer says I need to do this again to handle 3 day select issue for orders on wednesday
						// Not sure why yet. Haven't looked. But if it works, that's all that matters for now
						// Prevent weekends - Cleanup + Fridays
						if (date('D', $xtransitTime) == 'Sat') {
							$xtransitTime += (86400*2);
						} elseif (date('D', $xtransitTime) == 'Sun') {
							$xtransitTime += 86400;
						}


						$delivery_time =  ' (' . ($this->language->get('text_delivery_time') . date($this->language->get('date_format_short'), $xtransitTime)) . ')';
					}
				}

Re: Estimated Delivery Date - FedEx Global Live Rates

Posted: Sat May 18, 2019 12:05 am
by straightlight
Create a new service request in the Commercial Support section of the forum to get this done as a custom job.

Re: Estimated Delivery Date - FedEx Global Live Rates

Posted: Fri May 15, 2020 3:44 pm
by khnaz35
wafflemeister wrote:
Fri May 17, 2019 12:39 am
I am using an old version of FedEx Global Live Rates on OpenCart 1.5.6.4. The extension has the ability to show the Estimated delivery date, which seems to have flaws when estimating delivery dates over weekends. At this point I prefer to show something like '3 Business Days' rather than trying to show dates to not upset customers. Can the below code be modified to do this? Thank you in advance.

Code: Select all

				if ($this->config->get($classname . '_' . $service) != '1') { continue; }

			    $package_count = '';
				if ($this->config->get($classname . '_package_count')) {
					$package_count = ' (' . ($rate['Package_Count'] . $this->language->get('text_pkg')) . ')';
				}

				$delivery_time = '';
				if ($this->config->get($classname . '_transit')) {
					if (!empty($rate['Transit']) && $rate['Transit'] != 'UNKNOWN') {
						if (strpos($rate['Transit'], 'DAY') !== false) {
							$xtransitTime = $transitTime[$rate['Transit']];
						} else {
							$xtransitTime = strtotime($rate['Transit']);
						}

						// Prevent weekends
						if (date('D', $xtransitTime) == 'Sat') {
							$xtransitTime += (86400*2);
						} elseif (date('D', $xtransitTime) == 'Sun') {
							$xtransitTime += 86400;
						} else {
							// Cutoff Time. Add day to shipping
							if (is_numeric($this->config->get('fedex_wsdl_cutoff'))) {
								if ((int)date('H') > (int)$this->config->get('fedex_wsdl_cutoff') || date('H') == '00') {
									$xtransitTime += 86400;
								}
							}
						}

						// Customer says I need to do this again to handle 3 day select issue for orders on wednesday
						// Not sure why yet. Haven't looked. But if it works, that's all that matters for now
						// Prevent weekends - Cleanup + Fridays
						if (date('D', $xtransitTime) == 'Sat') {
							$xtransitTime += (86400*2);
						} elseif (date('D', $xtransitTime) == 'Sun') {
							$xtransitTime += 86400;
						}


						$delivery_time =  ' (' . ($this->language->get('text_delivery_time') . date($this->language->get('date_format_short'), $xtransitTime)) . ')';
					}
				}
what is the extension name or url to download ?

Re: Estimated Delivery Date - FedEx Global Live Rates

Posted: Fri May 15, 2020 6:51 pm
by straightlight
khnaz35 wrote:
Fri May 15, 2020 3:44 pm
wafflemeister wrote:
Fri May 17, 2019 12:39 am
I am using an old version of FedEx Global Live Rates on OpenCart 1.5.6.4. The extension has the ability to show the Estimated delivery date, which seems to have flaws when estimating delivery dates over weekends. At this point I prefer to show something like '3 Business Days' rather than trying to show dates to not upset customers. Can the below code be modified to do this? Thank you in advance.

Code: Select all

				if ($this->config->get($classname . '_' . $service) != '1') { continue; }

			    $package_count = '';
				if ($this->config->get($classname . '_package_count')) {
					$package_count = ' (' . ($rate['Package_Count'] . $this->language->get('text_pkg')) . ')';
				}

				$delivery_time = '';
				if ($this->config->get($classname . '_transit')) {
					if (!empty($rate['Transit']) && $rate['Transit'] != 'UNKNOWN') {
						if (strpos($rate['Transit'], 'DAY') !== false) {
							$xtransitTime = $transitTime[$rate['Transit']];
						} else {
							$xtransitTime = strtotime($rate['Transit']);
						}

						// Prevent weekends
						if (date('D', $xtransitTime) == 'Sat') {
							$xtransitTime += (86400*2);
						} elseif (date('D', $xtransitTime) == 'Sun') {
							$xtransitTime += 86400;
						} else {
							// Cutoff Time. Add day to shipping
							if (is_numeric($this->config->get('fedex_wsdl_cutoff'))) {
								if ((int)date('H') > (int)$this->config->get('fedex_wsdl_cutoff') || date('H') == '00') {
									$xtransitTime += 86400;
								}
							}
						}

						// Customer says I need to do this again to handle 3 day select issue for orders on wednesday
						// Not sure why yet. Haven't looked. But if it works, that's all that matters for now
						// Prevent weekends - Cleanup + Fridays
						if (date('D', $xtransitTime) == 'Sat') {
							$xtransitTime += (86400*2);
						} elseif (date('D', $xtransitTime) == 'Sun') {
							$xtransitTime += 86400;
						}


						$delivery_time =  ' (' . ($this->language->get('text_delivery_time') . date($this->language->get('date_format_short'), $xtransitTime)) . ')';
					}
				}
what is the extension name or url to download ?
If the extension does NOT involve a license!