Back to PhocacartShipping class

Method getShippingMethod

public
getShippingMethod
(mixed $shippingId)

Method getShippingMethod - Source code

public function getShippingMethod($shippingId)
{
    //$app			= JFactory::getApplication();
    //$paramsC 		= PhocacartUtils::getComponentParameters();
    //$shipping_amount_rule	= $paramsC->get( 'shipping_amount_rule', 0 );
    $db = Factory::getDBO();
    $query = ' SELECT s.id, s.tax_id, s.cost, s.cost_additional, s.calculation_type, s.title, s.method, s.params, s.description, s.image,' . ' t.id as taxid, t.title as taxtitle, t.tax_rate as taxrate, t.calculation_type as taxcalculationtype' . ' FROM #__phocacart_shipping_methods AS s' . ' LEFT JOIN #__phocacart_taxes AS t ON t.id = s.tax_id' . ' WHERE s.id = ' . (int) $shippingId . ' ORDER BY s.id' . ' LIMIT 1';
    $db->setQuery($query);
    $shipping = $db->loadObject();
    if (isset($shipping->params)) {
        $registry = new Registry();
        //$registry->loadString($shipping->params);
        if (isset($shipping->params)) {
            $registry->loadString($shipping->params);
        }
        $shipping->params = $registry;
    }
    return $shipping;
}