1
votes

Tyring to create a module where i can create a product dynamically using catalog->products model, and redirect control to the product's review page. Need only single controller with single action. No blocks, helpers, templates.... nothing required.

But it seems like controller action is not properly routed, there is some mistake in code or configuration ... getting 404 not found error

Trying this url:

http://localhost/magento_test/dynamicproduct/index/index

Namespace: Waqasalieee

Module name: Dynamicproduct

Magento version: 1.7.0.2

Here are the file contents:

local/Waqasalieee/Dynamicproduct/controllers/IndexController.php

<?php
    class Waqasalieee_Dynamicproduct_IndexController extends Mage_Core_Controller_Front_Action
    {
        public function indexAction() {
            die('working in index');
        }
    }
?>

local/Waqasalieee/Dynamicproduct/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Waqasalieee_Dynamicproduct>
            <version>1.0</version>
        </Waqasalieee_Dynamicproduct>
    </modules>
    <frontend>
        <routers>
            <dynamicproduct>
                <use>standard</use>
                <args>
                    <module>Waqasalieee_Dynamicproduct</module>
                    <frontName>dynamicproduct</frontName>
                </args>
            </dynamicproduct>
        </routers>
    </frontend>

</config>

app/etc/modules/Waqasalieee_Dynamicproduct.xml

<?xml version='1.0'?>
<config>
    <modules>
        <Waqasalieee_Dynamicproduct>
            <codepool>local</codepool>
            <active>true</active>
        </Waqasalieee_Dynamicproduct>
    </modules>
</config>

It should show some error or 'working in index' (string) but its giving 404 not found error.

2
Please use <codePool> , big P.Tentura Team
its codePool not codepool....ANKIT
:) yes its codePool. @Magento: this is not fair :PWaqas Ali Khan Puar

2 Answers

4
votes

In your config.xml use codePool instead of codepool.

<?xml version='1.0'?>
<config>
    <modules>
        <Waqasalieee_Dynamicproduct>
            <codePool>local</codePool>
            <active>true</active>
        </Waqasalieee_Dynamicproduct>
    </modules>
</config>
5
votes

I was having the same sympton and landed here. For me the error was not a erroneous XML config but that the Store Code was actually added to the URL (that's a magento feature, not a bug) and so my controller was only accessible by adding a valid store code to the URL like http://mystore/<storecode>/<controller>/<action>. In my case http://mage.localhost/en/customer/check