<?php
/* author Raffaele Pugliese
created on 23/10/23  */


namespace FiloBlu\Refilo\Plugins;

use Magento\Sales\Block\Adminhtml\Order\View\Info;
use Magento\Sales\Model\Order\Address;

class AddCareOfLabel
{
    /**
     * @param Info $subject
     * @param Address $address
     * @return array
     */
    public function beforeGetFormattedAddress(Info $subject, Address $address)
    {
        if(isset($address['care_of']) && $address['care_of'] != null) {
            $address['care_of'] = __("c/o ") . $address['care_of'];
        }
        return [$address];
    }
}