$referencePrice =
$lineItem->
getPrice()->
getReferencePrice();
$unit =
$product->
getUnit();
if ($referencePrice === null ||
$unit === null
) { return null;
} return [ 'label' => ProductFeatureSetDefinition::TYPE_PRODUCT_REFERENCE_PRICE,
'value' =>
[ 'price' =>
$referencePrice->
getPrice(),
'purchaseUnit' =>
$referencePrice->
getPurchaseUnit(),
'referenceUnit' =>
$referencePrice->
getReferenceUnit(),
'unitName' =>
$unit->
getTranslation('name'
),
],
'type' => ProductFeatureSetDefinition::TYPE_PRODUCT_REFERENCE_PRICE,
];
} /**
* Since it's not intended to display custom field labels outside of the admin at the moment,
* their labels are indexed by the locale code of the system language (fixed value, not translated).
*
* @see https://issues.shopware.com/issues/NEXT-9321
*/