1

I'd like to create a new module with just AjaxController. Do I need anyway to have a layout ?
I mean here is my file and code :

/var/www/html/dev/app/code/local/NameSpace/Cart/controllers/AjaxController.php

class NameSpace_Cart_AjaxController extends Mage_Core_Controller_Front_Action
{
    public function quickbuyAction()
    {
        return json_encode(array('ok' => true));
    }
}

/var/www/html/dev/app/code/local/NameSpace/Cart/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <NameSpace_Cart>
            <version>0.1.0</version>
        </NameSpace_Cart>
    </modules>
    <global>
    </global>
</config>

When i tried to call my url localhost/cart/ajax/quickbuy, its returned me a 404.
Do I miss something ?

And yes I declared my xml in the app/etc/modules folder.

Thanks for your help.

0

Solution :

<?xml version="1.0"?> <config> <modules> <NameSpace_Cartevent> <version>0.1.0</version> </NameSpace_Cartevent> </modules> <frontend> <routers> <NameSpace_cartevent> <use>standard</use> <args> <module>NameSpace_Cartevent</module> <frontName>cartevent</frontName> </args> </NameSpace_cartevent> </routers> </frontend> </config>

My mistake : When i tried the first time, i put the <frontend> tag in the <global> tag but it has to be outside the <global> tag.

Thx for you links @Arunendra.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.