Back to PhocacartOrderView class

Method getItemTotal

public
getItemTotal
(mixed $orderId, mixed $onlyPublished = 0, mixed $type = '')

Method getItemTotal - Source code

public function getItemTotal($orderId, $onlyPublished = 0, $type = '')
{
    $db = Factory::getDBO();
    $q = ' SELECT t.*' . ' FROM #__phocacart_orders AS o' . ' LEFT JOIN #__phocacart_order_total AS t ON o.id = t.order_id' . ' WHERE o.id = ' . (int) $orderId;
    if ($onlyPublished == 1) {
        $q .= ' AND t.published = 1';
    }
    if ($type != '') {
        $q .= ' AND t.type = ' . $db->quote($type);
    }
    $q .= ' ORDER BY t.ordering';
    $db->setQuery($q);
    $items = $db->loadObjectList();
    return $items;
}