<?php

use KupShop\UserAddressesBundle\Util\UserAddressesUtil;

function smarty_function_get_addresses($params, &$smarty)
{
    $addressUtil = \KupShop\KupShopBundle\Util\Compat\ServiceContainer::getService(UserAddressesUtil::class);
    $result = $addressUtil->getDeliveryAddressesIds();

    if (!empty($params['assign'])) {
        $smarty->assign($params['assign'], $result);
    } else {
        return $result;
    }
}
