Magento2: Custom tracking is not handled correctly in popup

Created on 10 Mar 2017  路  6Comments  路  Source: magento/magento2

When you add a tracking to a shipment you can use the Custom option. The tracking is then an array instead of an object. The popup however uses it as an object which creates an exception.

Preconditions

  1. Magento 2.1.5
  2. PHP 7

Steps to reproduce

  1. Create order.
  2. Add shipment with custom carrier code.
  3. Open the Track pop-up.

Expected result

  1. Pop-up with the tracking information.

Actual result

  1. Pop-up with only the shipping id.
  2. Exception in report folder.

I think the fix is easy (vendor/magento/module-shipping/view/frontend/templates/tracking/details.phtml):

<table class="data table order tracking" id="tracking-table-popup-<?php /* @noEscape */ echo is_object($track) ? $track->getTracking() : null; ?>">

instead of

<table class="data table order tracking" id="tracking-table-popup-<?php /* @noEscape */ echo $track->getTracking(); ?>">

Ready for Work

All 6 comments

Issue in progress @epson121

This seems to be solved in the current develop branch (2.2 release)

Already fixed and merged into develop branch.

I have changed the code as provided above for getTracking() function issue
Now the getTracking() issue was gone and a new one arises as below:

PHP Fatal error: Call to a member function getProgressdetail() on array in /home/magento/public_html/vendor/magento/module-shipping/view/frontend/templates/tracking/popup.phtml on line 34

@MagentoRize See this commit which shows the other changes to make if you have to patch this before upgrading to Magento 2.2: 2c5b4c5

I just got this issue on the latest version 2.3

Was this page helpful?
0 / 5 - 0 ratings