Conn->GetOne('SELECT GatewayId FROM '.TABLE_PREFIX.'Gateways WHERE ClassName = \'kGWPayPal\''); if ($pay_pal_id) { $query = 'INSERT INTO '.TABLE_PREFIX.'GatewayConfigFields (SystemFieldName, FieldName, ElementType, ValueList, GatewayId) VALUES( \'shipping_control\', \'Shipping Control\', \'select\', \'3=la_CreditDirect,4=la_CreditPreAuthorize\', '.$pay_pal_id.' )'; $application->Conn->Query($query); $conf_id = $application->Conn->getInsertID(); $pay_pal_payment_types = $application->Conn->GetCol('SELECT PaymentTypeId FROM '.TABLE_PREFIX.'PaymentTypes WHERE GatewayId='.$pay_pal_id); foreach ($pay_pal_payment_types as $pp_id) { $query = 'INSERT INTO '.TABLE_PREFIX."'GatewayConfigValues VALUES (DEFAULT, $conf_id, $pp_id, '4')"; $application->Conn->Query($query); } } ?>