Magento extension dropdown option in configuration dont work
<p>I build a magento extension and I am trying to add in its configuration page a dropdown to choose one from product id or product sku so i can display in success page. I alter my code a lot of times but I can only get 1 of them working. How I can add the attribute codes for its value? I need to set product_id, sku and if its possible a custom field for its setup needs. Here are the parts I think you need.</p>

<p><strong>app/design/frontend/base/default/template/vendor/success.phtml</strong></p>

<pre><code>'product_id': '&lt;?php echo $_item-&gt;getData($this-&gt;getProductIdField())?&gt;',
</code></pre>

<p><strong>app/code/community/Vendor/Package/Model/System/Config/Source/Productid.php</strong></p>

<pre><code>class Vendor_Package_Model_System_Config_Source_Productid
{
    public function toOptionArray()
{
    return array(
        array('value' =&gt; 'entity_id', 'label'=&gt;Mage::helper('vendor_package')-&gt;__('Product ID')),
        array('value' =&gt; 'sku', 'label'=&gt;Mage::helper('vendor_package')-&gt;__('Product SKU')),
    );
}
</code></pre>

<p>}</p>

<p><strong>app/code/community/Vendor/Package/Block/Package.php</strong></p>

<pre><code>public function getProduct()
{
    return Mage::registry('current_product');
}
public function getProductIdField()
{
    return Mage::getStoreConfig('vendor_package/ecommerce/product_id') != false ? Mage::getStoreConfig('vendor_package/ecommerce/product_id') : 'sku';
}
</code></pre>

<p><strong>app/code/community/Vendor/Package/etc/config.xml</strong></p>

<pre><code>&lt;default&gt;
    &lt;vendor_package&gt;
        &lt;ecommerce&gt;
            &lt;transaction_id&gt;id&lt;/transaction_id&gt;
            &lt;product_id&gt;sku&lt;/product_id&gt;
        &lt;/ecommerce&gt;
    &lt;/vendor_package&gt;
&lt;/default&gt;
</code></pre>

<p><strong>app/code/community/Vendor/Package/etc/system.xml</strong></p>

<pre><code>                    &lt;product_id&gt;
                        &lt;label&gt;Product Id&lt;/label&gt;
                        &lt;frontend_type&gt;select&lt;/frontend_type&gt;
                        &lt;source_model&gt;vendor_package/system_config_source_productid&lt;/source_model&gt;
                        &lt;sort_order&gt;20&lt;/sort_order&gt;
                        &lt;show_in_default&gt;1&lt;/show_in_default&gt;
                        &lt;show_in_website&gt;1&lt;/show_in_website&gt;
                        &lt;show_in_store&gt;1&lt;/show_in_store&gt;
                    &lt;/product_id&gt;
</code></pre>