gonliSs Posted November 18, 2014 Share Posted November 18, 2014 (edited) Hello, I've modified a bit a way of choosing payment option. Now user has to check checkbox which payment which payment option he wants to use. But now I have problem with translating payment module name. This is my function which gets all payment modules names: public function paymentList() { $paymentsList = array(); $paymentQuery = "SELECT id_module FROM "._DB_PREFIX_."hook_module WHERE id_hook='1';"; $countMethods = 0; if ($results = Db::getInstance()->ExecuteS($paymentQuery)) foreach ($results as $row) { $moduleNameQuery = "SELECT name FROM "._DB_PREFIX_."module WHERE id_module='".$row['id_module']."';"; if ($results2 = Db::getInstance()->ExecuteS($moduleNameQuery)) { foreach ($results2 as $key ) { $paymentsList[$countMethods] = $key['name']; ++$countMethods; } } } return $paymentsList; } but then I can't translate that name, becase for example that code doesn't work: {foreach from=$paymentList item=single key=key2} <p> <label><input type="radio" name="paymentMethod" value="{$single}" {if $single==$paymentValue}checked="checked"{/if}>{l s=$single}</label> </p> {/foreach} because in admin panel I don't have these strings to translate. Any help would be greatly appreciated. Edited November 18, 2014 by gonliSs (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted November 21, 2014 Share Posted November 21, 2014 Start with Module::getInstanceByName($module_name). There are more usefull methods and code in the Module class. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now