Skip to content

Commit

Permalink
#36623 bugfix custom label return address
Browse files Browse the repository at this point in the history
  • Loading branch information
mbe1987 committed Aug 21, 2024
1 parent bedbdd9 commit cd63a4a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function toCustomizableParametersArray($query, Shipment $shipment): array
{
$shipper = $shipment->getShipper();
$services = $shipment->getServices();
$returnReceiver = $services->isInitialized('dhlRetoure') ? $services->getDhlRetoure()->getReturnAddress() : null;
$returnReceiver = $services->isInitialized('dhlRetoure') ? $services->getDhlRetoure()->getReturnAddress() : oxNew(ParcelShippingRequestBuilder::class)->buildReturnReceiver();
return [
'weight' => array_merge([
'total' => ['weight' => $shipment->getDetails()->getWeight()->getValue(), 'title' => Registry::getLang()->translateString('GENERAL_ATALL')],
Expand All @@ -57,8 +57,8 @@ public function toCustomizableParametersArray($query, Shipment $shipment): array
'services' => [
'parcelOutletRouting' => $services->isInitialized('parcelOutletRouting') ? $services->getParcelOutletRouting() : null,
'printOnlyIfCodeable' => $query['mustEncode'],
'dhlRetoure' => $services->isInitialized('dhlRetoure') ? [
'active' => (bool)$services->getDhlRetoure()->getBillingNumber(),
'dhlRetoure' => [
'active' => $services->isInitialized('dhlRetoure') && $services->getDhlRetoure()->getBillingNumber(),
'address' => [
'name1' => $returnReceiver->getName1(),
'name2' => $returnReceiver->isInitialized('name2') ? $returnReceiver->getName2() : '',
Expand All @@ -69,7 +69,7 @@ public function toCustomizableParametersArray($query, Shipment $shipment): array
'city' => $returnReceiver->getCity(),
'country' => $returnReceiver->getCountry(),
]
] : null,
],
'bulkyGoods' => $services->isInitialized('bulkyGoods') && $services->getBulkyGoods(),
'additionalInsurance' => $services->isInitialized('additionalInsurance') ? $services->getAdditionalInsurance()->getValue() : null,
'identCheck' => $services->isInitialized('identCheck') ? $services->getIdentCheck() : null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ protected function createIdent(Order $order): VASIdentCheck
/**
* @return ContactAddress
*/
protected function buildReturnReceiver(): ContactAddress
public function buildReturnReceiver(): ContactAddress
{
$config = Registry::getConfig();
if ($config->getShopConfVar('mo_dhl__retoure_receiver_use_sender')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
<input type="hidden" name="data[services][dhlRetoure][active]"
value="false">
<input type="checkbox" name="data[services][dhlRetoure][active]"
[{if $shipmentOrder.services.dhlRetoure}]checked[{/if}]>
[{if $shipmentOrder.services.dhlRetoure.active}]checked[{/if}]>
</td>
</tr>
[{/if}]
Expand Down

0 comments on commit cd63a4a

Please sign in to comment.