Back to PhocacartOrderView class

Method getItemCommon

public
getItemCommon
(mixed $orderId)

Method getItemCommon - Source code

public function getItemCommon($orderId)
{
    $db = Factory::getDBO();
    $query = 'SELECT o.*,' . ' u.id AS user_id, o.vendor_id AS vendor_id, u.name AS user_name, u.username AS user_username,' . ' p.title AS paymenttitle, p.description_info AS paymentdescriptioninfo,' . ' s.title AS shippingtitle, s.description_info AS shippingdescriptioninfo, s.tracking_link as shippingtrackinglink, s.tracking_description as shippingtrackingdescription,' . ' c.title AS coupontitle, cu.title AS currencytitle, d.title AS discounttitle, os.orders_view_display as ordersviewdisplay,' . ' uv.username as vendor_username, uv.name as vendor_name,' . ' sc.title as section_name, un.title as unit_name' . ' FROM #__phocacart_orders AS o' . ' LEFT JOIN #__users AS u ON u.id = o.user_id' . ' LEFT JOIN #__users AS uv ON uv.id = o.user_id' . ' LEFT JOIN #__phocacart_order_statuses AS os ON os.id = o.status_id' . ' LEFT JOIN #__phocacart_payment_methods AS p ON p.id = o.payment_id' . ' LEFT JOIN #__phocacart_shipping_methods AS s ON s.id = o.shipping_id' . ' LEFT JOIN #__phocacart_coupons AS c ON c.id = o.coupon_id' . ' LEFT JOIN #__phocacart_discounts AS d ON d.id = o.discount_id' . ' LEFT JOIN #__phocacart_currencies AS cu ON cu.id = o.currency_id' . ' LEFT JOIN #__phocacart_sections AS sc ON sc.id = o.section_id' . ' LEFT JOIN #__phocacart_units AS un ON un.id = o.unit_id' . ' WHERE o.id = ' . (int) $orderId . ' ORDER BY o.id';
    $db->setQuery($query);
    $order = $db->loadObject();
    return $order;
}