Back to PhocacartPayment class

Method getPaymentMethods

public static
getPaymentMethods
(mixed $paymentId, mixed $select = 0, mixed $table = 'shipping')

Method getPaymentMethods - Source code

public static function getPaymentMethods($paymentId, $select = 0, $table = 'shipping')
{
    if ($table == 'shipping') {
        $t = '#__phocacart_payment_method_shipping';
        $c = 'payment_id';
    }
    $db = Factory::getDBO();
    if ($select == 1) {
        $query = 'SELECT p.shipping_id';
    } else {
        $query = 'SELECT a.*';
    }
    $query .= ' FROM #__phocacart_shipping_methods AS a' . ' LEFT JOIN ' . $t . ' AS p ON a.id = p.shipping_id' . ' WHERE p.' . $c . ' = ' . (int) $paymentId;
    $db->setQuery($query);
    if ($select == 1) {
        $items = $db->loadColumn();
    } else {
        $items = $db->loadObjectList();
    }
    return $items;
}