I created a new module which I will explain below. I can see the new options on the admin. I clicked on role, administrators and saved. I logged out and logged in
However I still see 404 Not found when I want to change the config. http://screencast.com/t/IbLJeVjpxMm
Config.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Luisvalencia_Affiliate>
<version>0.0.1</version>
</Luisvalencia_Affiliate>
</modules>
<global>
<models>
<luisvalencia_affiliate>
<class>Luisvalencia_Affiliate_Model</class>
</luisvalencia_affiliate>
</models>
<helpers>
<affiliate>
<class>Luisvalencia_Affiliate_Helper</class>
</affiliate>
</helpers>
</global>
<frontend>
<events>
<controller_action_predispatch>
<observers>
<luisvalencia_affiliate>
<class>luisvalencia_affiliate/observer</class>
<method>captureReferral</method>
<type>singleton</type>
</luisvalencia_affiliate>
</observers>
</controller_action_predispatch>
</events>
</frontend>
</config>
adminhtml.xml
<?xml version="1.0"?>
<config>
<acl>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<luisvalenciasection translate="title" module="affiliate">
<title>Luisvalencia Section</title>
<sort_order>0</sort_order>
</luisvalenciasection>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
</config>
system.xml
<?xml version="1.0" ?>
<config>
<tabs>
<luisvalenciatab translate="label" module="affiliate">
<label>Luisvalencia Cookie</label>
<sort_order>0</sort_order>
</luisvalenciatab>
</tabs>
<sections>
<luisvalenciasection translate="label" module="affiliate">
<label>Luisvalencia</label>
<tab>luisvalenciatab</tab>
<frontend_type>text</frontend_type>
<sort_order>0</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<groups>
<luisvalenciagroup translate="label">
<label>Luisvalencia Group</label>
<frontend_type>text</frontend_type>
<sort_order>0</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<cookie_time translate="label">
<label>Set Cookie Time</label>
<frontend_type>text</frontend_type>
<sort_order>0</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</cookie_time>
</fields>
</luisvalenciagroup>
</groups>
</luisvalenciasection>
</sections>
</config>
Data.php
<?php
class Luisvalencia_Affiliate_Helper_Data extends Mage_Core_Helper_Abstract {
}
Observer.php
<?php
class Luisvalencia_Affiliate_Model_Observer
{
const COOKIE_KEY_SOURCE = 'luisvalencia_affiliate_source';
public function captureReferral(Varien_Event_Observer $observer)
{
$cookietime = Mage::getStoreConfig('luisvalenciasection/luisvalenciagroup/cookie_time');
if(Mage::getModel('core/cookie')->get('ref') != 'cj'){
if( isset($_GET["ref"]) ){
$ref=$_GET["ref"];
}
else{
$ref='';
}
$name_c = 'ref';
$val_c = $ref;
$expired = 31556926; /* 1 year */
$path = '/';
$cookie = Mage::getSingleton('core/cookie');
$cookie->set($name_c, $val_c ,(int)$cookietime,$path);
}
}
}
Luisvalencia_Affiliate.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Luisvalencia_Affiliate>
<active>true</active>
<codePool>community</codePool>
</Luisvalencia_Affiliate>
</modules>
</config>