macinville Posted October 25, 2012 Share Posted October 25, 2012 I am trying to add a new field in PrestaShop registration, but I was not able to get data from my newly created table. Here's a summary of what I already did: 1) In authentication.tpl I added: <p class="select required"> <span>{l s='Account Type'}</span> <select id="accountType" name="accountType"> <option value="">-</option> {foreach from=$accountTypes item=accountType} <option value="{$accountType->product_percentage}" >{$accountType->product_percentage} </option> {/foreach} </select> </p> 2) Added the line $this->context->smarty->assign('accountTypes', AccountType::getAccountTypes()); in AuthController.php, wherein AccountType::getAccountTypes() returns the content of my table. 3) In smarty debug window, the value of $accountTypes is: $accountTypes Smarty_Variable Object (3) ->value = Array (2) 0 => Array (7) id_account_type => "1" allowed_store => "1" allowed_product => "25" downpayment => "0.00" month_payment_interval => "1" fixed_recurring_fee => "0.00" product_percentage => "2.00" 1 => Array (7) id_account_type => "2" allowed_store => "3" allowed_product => "100" downpayment => "0.00" month_payment_interval => "1" fixed_recurring_fee => "1250.00" product_percentage => "0.00" ->nocache = false ->scope = "Smarty root" So there. I am expecting that the field will have values in the HTML, but no record was appearing () Any tip on where to look at? I am using version 1.5.1.0 Link to comment Share on other sites More sharing options...
Recommended Posts