Jump to content

Unable to retrieve data from drop-down lists in admin panel


Guillaume

Recommended Posts

Dear all,

I am new here, so apologises if I am stating anything obvious. I am developping a payment plugin, which I installed in my Cubecart project. In the admin panel where I set up the parameters of the plugin, I have several text fields (e.g. "test certificate") and drop-down lists (e.g. "mode") with options ("test", "prod").

These parameters are dealt with by the file skin/admin/index.tpl. While my software perfectly understands any value taken from the text field, it completely fails to understand the drop-down lists. It ignores any value I input on the admin panel.

Here below is an extract of index.tpl (I'd happily provide the whole soft if necessary):

 

            <div><label for="test_key">{$LANG.systempay.test_key}</label><span><input name="module[test_key]" id="test_key" class="textbox" type="text" value="{$MODULE.test_key}" /></span></div>
            <div><label for="prod_key">{$LANG.systempay.prod_key}</label><span><input name="module[prod_key]" id="prod_key" class="textbox" type="text" value="{$MODULE.prod_key}" /></span></div>
            <div><label for="mode">{$LANG.systempay.mode}</label>
                <span>
                    <select name="module[mode]" id="mode">
                        <option value="TEST" {$SELECT_mode_TEST}>{$LANG.systempay.test}</option>
                        <option value="PRODUCTION" {$SELECT_mode_PRODUCTION}>{$LANG.systempay.prod}</option>
                    </select>
                </span>
            </div>

 

If I change the option/value of module[mode] (e.g. putting "TESTA" instead), it seems to be ignored. Similarly, changing $SELECT_mode_TEST to $SELECT_mode_TESTA is ignored. I was advised to replace

{$SELECT_mode_TEST}

by

{if $MODULE.mode == 'TEST'} selected="selected"{/if}

But unfortunately it did not help. Again, I'm very new here, so apologises if it's something basic I'm missing, but would really appreciate any help! Cheers,

Guillaume

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...