Back to PhocacartCurrency class

Method getCurrenciesListBox

public static
getCurrenciesListBox
()

Method getCurrenciesListBox - Source code

public static function getCurrenciesListBox()
{
    $session = Factory::getSession();
    $active = $session->get('currency', 0, 'phocaCart');
    if ((int) $active < 1) {
        $active = self::getDefaultCurrency();
    }
    $currencies = self::getAllCurrencies();
    $o = '';
    if (!empty($currencies)) {
        $o .= '<ul class="ph-input-list-currencies">';
        foreach ($currencies as $k => $v) {
            $class = '';
            if ($v->value == $active) {
                $class = 'class="active"';
            }
            $o .= '<li rel="' . $v->value . '" ' . $class . '>' . $v->text . '</li>';
        }
        $o .= '</ul>';
    }
    return $o;
}