Back to PhocacartParameter class

Method getAllParametersSelectBox

public static
getAllParametersSelectBox
(mixed $name, mixed $id, mixed $active, mixed $attr = 'class="form-select"', mixed $order = 'id', mixed $selectText = 0)

Method getAllParametersSelectBox - Source code

/*
 * PARAMETERS (group for each parameter values)
 */
public static function getAllParametersSelectBox($name, $id, $active, $attr = 'class="form-select"', $order = 'id', $selectText = 0)
{
    $db = Factory::getDBO();
    $query = 'SELECT a.id AS value, a.title AS text' . ' FROM #__phocacart_parameters AS a' . ' ORDER BY ' . $order;
    $db->setQuery($query);
    $parameters = $db->loadObjectList();
    //if (!empty($parameters) && $selectText == 1) {
    if ($selectText == 1) {
        array_unshift($parameters, HTMLHelper::_('select.option', '', '- ' . Text::_('COM_PHOCACART_SELECT_PARAMETER') . ' -', 'value', 'text'));
    }
    $paramsO = HTMLHelper::_('select.genericlist', $parameters, $name, $attr, 'value', 'text', $active, $id);
    return $paramsO;
}