Back to PhocacartCategoryMultiple class

Method getNextOrder

public static
getNextOrder
(mixed $pId, mixed $cId)

Method getNextOrder - Source code

public static function getNextOrder($pId, $cId)
{
    $db = Factory::getDBO();
    $where = 'category_id =' . (int) $cId;
    $query = $db->getQuery(true)->select('MAX(ordering)')->from('#__phocacart_product_categories')->where($where);
    $db->setQuery($query);
    $max = (int) $db->loadResult();
    return $max + 1;
}