Skip to main content
added 1 character in body
Source Link
Rafael Corrêa Gomes
  • 13.7k
  • 14
  • 91
  • 181

Using Magento 1.7 and I've created a simple frontend form, however, when I go to test and submit the form it returns the 404 page, though I'm really not sure why.

Here is my code structure:

|-Vendor
|-----Module
|---------Block
|-------------Form.php
|---------controllers
|-------------IndexController.php
|---------etc
|-------------config.xml

Form.php:

<?php
    class Vendor_Module_Block_Form extends Mage_Core_Block_Template
    {
        public function getFormAction()
        {
            return $this->getUrl('module/index/post');
        }
    }

IndexController.php

<?php
    class Vendor_Module_IndexController extends Mage_Contacts_IndexController
    {
        public function postAction()
        {
            //custom form stuff
        }
    }

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Vendor_Module>
            <version>0.1.0</version>
        </Vendor_Module>
    </modules>
    <frontend>
        <routers>
            <module>
                <args>
                    <modules>
                        <Vendor_Module before="Mage_Contacts">Vendor_Module</Vendor_Module>
                    </modules>
                </args>
            </module>
        </routers>
    </frontend>
    <global>
        <blocks>
            <module>
                <class>Vendor_Module_Block</class>
            </module>
        </blocks>
    </global>
</config>

I've checked in admin and can see that it is enabled, I've added a Helper/Data.php file as suggested in another SO post. I've cleared cache and reindexed but still, it doesn't work.

Any ideas or anything clearly wrong that I've missed?

Using Magento 1.7 and I've created a simple frontend form, however, when I go to test and submit the form it returns the 404 page, though I'm really not sure why.

Here is my code structure:

|-Vendor
|-----Module
|---------Block
|-------------Form.php
|---------controllers
|-------------IndexController.php
|---------etc
|-------------config.xml

Form.php:

<?php
    class Vendor_Module_Block_Form extends Mage_Core_Block_Template
    {
        public function getFormAction()
        {
            return $this->getUrl('module/index/post');
        }
    }

IndexController.php

<?php
    class Vendor_Module_IndexController extends Mage_Contacts_IndexController
    {
        public function postAction()
        {
            //custom form stuff
        }
    }

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Vendor_Module>
            <version>0.1.0</version>
        </Vendor_Module>
    </modules>
    <frontend>
        <routers>
            <module>
                <args>
                    <modules>
                        <Vendor_Module before="Mage_Contacts">Vendor_Module</Vendor_Module>
                    </modules>
                </args>
            </module>
        </routers>
    </frontend>
    <global>
        <blocks>
            <module>
                <class>Vendor_Module_Block</class>
            </module>
        </blocks>
    </global>
</config>

I've checked in admin and can see that it is enabled, I've added a Helper/Data.php file as suggested in another SO post. I've cleared cache and reindexed but still it doesn't work.

Any ideas or anything clearly wrong that I've missed?

Using Magento 1.7 and I've created a simple frontend form, however, when I go to test and submit the form it returns the 404 page, though I'm really not sure why.

Here is my code structure:

|-Vendor
|-----Module
|---------Block
|-------------Form.php
|---------controllers
|-------------IndexController.php
|---------etc
|-------------config.xml

Form.php:

<?php
    class Vendor_Module_Block_Form extends Mage_Core_Block_Template
    {
        public function getFormAction()
        {
            return $this->getUrl('module/index/post');
        }
    }

IndexController.php

<?php
    class Vendor_Module_IndexController extends Mage_Contacts_IndexController
    {
        public function postAction()
        {
            //custom form stuff
        }
    }

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Vendor_Module>
            <version>0.1.0</version>
        </Vendor_Module>
    </modules>
    <frontend>
        <routers>
            <module>
                <args>
                    <modules>
                        <Vendor_Module before="Mage_Contacts">Vendor_Module</Vendor_Module>
                    </modules>
                </args>
            </module>
        </routers>
    </frontend>
    <global>
        <blocks>
            <module>
                <class>Vendor_Module_Block</class>
            </module>
        </blocks>
    </global>
</config>

I've checked in admin and can see that it is enabled, I've added a Helper/Data.php file as suggested in another SO post. I've cleared cache and reindexed but still, it doesn't work.

Any ideas or anything clearly wrong that I've missed?

Using Magento 1.7 and I've created a simple frontend form, however, when I go to test and submit the form it returns the 404 page, though I'm really not sure why.

Here is my code structure:

|-Vendor
|-----Module
|---------Block
|-------------Form.php
|---------controllers
|-------------IndexController.php
|---------etc
|-------------config.xml

Form.php:

<?php
    class Vendor_Module_Block_Form extends Mage_Core_Block_Template
    {
        public function getFormAction()
        {
            return $this->getUrl('module/index/post');
        }
    }

IndexController.php

<?php
    class Vendor_Module_IndexController extends Mage_Contacts_IndexController
    {
        public function postAction()
        {
            //custom form stuff
        }
    }

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Vendor_Module>
            <version>0.1.0</version>
        </Vendor_Module>
    </modules>
    <frontend>
        <routers>
            <module>
                <args>
                    <modules>
                        <Vendor_Module before="Mage_Contacts">Vendor_Module</Vendor_Module>
                    </modules>
                </args>
            </module>
        </routers>
    </frontend>
    <global>
        <blocks>
            <module>
                <class>Vendor_Module_Block</class>
            </module>
        </blocks>
    </global>
</config>

I've checked in admin and can see that it is enabled, I've added a Helper/Data.php file as suggested in another SO post. I've cleared cache, and reindexed but still it doesn't work - any.

Any ideas or anything clearly wrong that I've missed?

Using Magento 1.7 and I've created a simple frontend form, however, when I go to test and submit the form it returns the 404 page, though I'm really not sure why.

Here is my code structure:

|-Vendor
|-----Module
|---------Block
|-------------Form.php
|---------controllers
|-------------IndexController.php
|---------etc
|-------------config.xml

Form.php:

<?php
    class Vendor_Module_Block_Form extends Mage_Core_Block_Template
    {
        public function getFormAction()
        {
            return $this->getUrl('module/index/post');
        }
    }

IndexController.php

<?php
    class Vendor_Module_IndexController extends Mage_Contacts_IndexController
    {
        public function postAction()
        {
            //custom form stuff
        }
    }

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Vendor_Module>
            <version>0.1.0</version>
        </Vendor_Module>
    </modules>
    <frontend>
        <routers>
            <module>
                <args>
                    <modules>
                        <Vendor_Module before="Mage_Contacts">Vendor_Module</Vendor_Module>
                    </modules>
                </args>
            </module>
        </routers>
    </frontend>
    <global>
        <blocks>
            <module>
                <class>Vendor_Module_Block</class>
            </module>
        </blocks>
    </global>
</config>

I've checked in admin and can see it enabled, I've added a Helper/Data.php file as suggested in another SO post. I've cleared cache, reindexed but still doesn't work - any ideas or anything clearly wrong that I've missed?

Using Magento 1.7 and I've created a simple frontend form, however, when I go to test and submit the form it returns the 404 page, though I'm really not sure why.

Here is my code structure:

|-Vendor
|-----Module
|---------Block
|-------------Form.php
|---------controllers
|-------------IndexController.php
|---------etc
|-------------config.xml

Form.php:

<?php
    class Vendor_Module_Block_Form extends Mage_Core_Block_Template
    {
        public function getFormAction()
        {
            return $this->getUrl('module/index/post');
        }
    }

IndexController.php

<?php
    class Vendor_Module_IndexController extends Mage_Contacts_IndexController
    {
        public function postAction()
        {
            //custom form stuff
        }
    }

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Vendor_Module>
            <version>0.1.0</version>
        </Vendor_Module>
    </modules>
    <frontend>
        <routers>
            <module>
                <args>
                    <modules>
                        <Vendor_Module before="Mage_Contacts">Vendor_Module</Vendor_Module>
                    </modules>
                </args>
            </module>
        </routers>
    </frontend>
    <global>
        <blocks>
            <module>
                <class>Vendor_Module_Block</class>
            </module>
        </blocks>
    </global>
</config>

I've checked in admin and can see that it is enabled, I've added a Helper/Data.php file as suggested in another SO post. I've cleared cache and reindexed but still it doesn't work.

Any ideas or anything clearly wrong that I've missed?

Source Link
treyBake
  • 141
  • 1
  • 6
  • 27

Frontend Form 404 action

Using Magento 1.7 and I've created a simple frontend form, however, when I go to test and submit the form it returns the 404 page, though I'm really not sure why.

Here is my code structure:

|-Vendor
|-----Module
|---------Block
|-------------Form.php
|---------controllers
|-------------IndexController.php
|---------etc
|-------------config.xml

Form.php:

<?php
    class Vendor_Module_Block_Form extends Mage_Core_Block_Template
    {
        public function getFormAction()
        {
            return $this->getUrl('module/index/post');
        }
    }

IndexController.php

<?php
    class Vendor_Module_IndexController extends Mage_Contacts_IndexController
    {
        public function postAction()
        {
            //custom form stuff
        }
    }

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Vendor_Module>
            <version>0.1.0</version>
        </Vendor_Module>
    </modules>
    <frontend>
        <routers>
            <module>
                <args>
                    <modules>
                        <Vendor_Module before="Mage_Contacts">Vendor_Module</Vendor_Module>
                    </modules>
                </args>
            </module>
        </routers>
    </frontend>
    <global>
        <blocks>
            <module>
                <class>Vendor_Module_Block</class>
            </module>
        </blocks>
    </global>
</config>

I've checked in admin and can see it enabled, I've added a Helper/Data.php file as suggested in another SO post. I've cleared cache, reindexed but still doesn't work - any ideas or anything clearly wrong that I've missed?