Back to PhocacartShipping class

Method getAllShippingMethodsSelectBox

public static
getAllShippingMethodsSelectBox
(mixed $name, mixed $id, mixed $activeArray, mixed $javascript = NULL, mixed $order = 'id', mixed $type = array())

Method getAllShippingMethodsSelectBox - Source code

/* Used as payment rule too
 * Used in administration (this is why $type = array();
 */
public static function getAllShippingMethodsSelectBox($name, $id, $activeArray, $javascript = NULL, $order = 'id', $type = array())
{
    $db = Factory::getDBO();
    $query = 'SELECT a.id AS value, a.title AS text' . ' FROM #__phocacart_shipping_methods AS a';
    $query .= !empty($type) && is_array($type) ? ' WHERE a.type IN (' . implode(',', $type) . ')' : '';
    $query .= ' ORDER BY a.' . $order;
    $db->setQuery($query);
    $methods = $db->loadObjectList();
    $methodsO = HTMLHelper::_('select.genericlist', $methods, $name, 'class="form-select" size="4" multiple="multiple"' . $javascript, 'value', 'text', $activeArray, $id);
    return $methodsO;
}