Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Admin Order detail] Carrier name not shown with legacy serialization of Orders #1540

Closed
ramundomario opened this issue Dec 4, 2020 · 1 comment
Assignees
Labels
Milestone

Comments

@ramundomario
Copy link
Contributor

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? yes/no

Carrier name is not shown in the shipment block in the admin order detail panel (Reproduced on latest demo).
bug

Doing some debugging I noticed the carrierName is not present in the response if the coreshop.order.legacy_serialization parameter is true (default).

/**
* @param OrderInterface $order
*
* @return array
*/
protected function getShipments($order)
{
$shipments = $this->getOrderShipmentRepository()->getDocuments($order);
$shipmentArray = [];
foreach ($shipments as $shipment) {
$availableTransitions = $this->getWorkflowStateManager()->parseTransitions($shipment, 'coreshop_shipment', [
'create',
'ship',
'cancel',
], false);
if ($this->useLegacySerialization()) {
$data = $this->getDataForObject($shipment);
foreach ($shipment->getItems() as $index => $item) {
$data['items'][$index]['_itemName'] = $item->getOrderItem()->getName();
}
} else {
$data = $this->getSerializer()->toArray($shipment);
}
$data['stateInfo'] = $this->getWorkflowStateManager()->getStateInfo('coreshop_shipment', $shipment->getState(), false);
$data['transitions'] = $availableTransitions;
$shipmentArray[] = $data;
}
return $shipmentArray;
}

A solution would be to manually add the carrier identifier taken from the shipment if legacy serialization is true (default).
wdyt? @dpfaffenbauer
I could open a pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants