I'm new to Magento. Need to create an extension which will enable to add comments to products on 'product view' pages. I created a new tab next to "descriptions" and "reviews" and added the form, but can't put the correct form action which will load the controller file, save the input information and then save it in the database. Read lot of different articles,but couldn't figure this out. Any help is greatly appreciated!

This is the form action line in app\design\frontend\rwd\default\template\productcomments\productcomments.phtml

<form enctype="multipart/form-data" method="post" action="<?php echo $this->getUrl('productcomments/index/savecomment'); ?>" id="product-view-add-comment">

Here is my indexController.php content:

class Cpstest_ProductComments_IndexController extends Mage_Core_Controller_Front_Action
    public function savecommentAction()
        echo "Hello";

And I added the block information (tab "Product Comments") in app\design\frontend\rwd\default\layout\catalog.xml like this:

<block type="catalog/product_view_attributes" name="product.comments" as="additional" template="productcomments/productcomments.phtml">
    <action method="setTitle" translate="value"><value>Product Comments</value></action>

2 Answers 2


I am making some assumptions, but it seems like this should instead be Cpstest_ProductComments. Now that you have added the file paths, it looks like your controller filename is incorrect. It should be: controllers\IndexController.php (note the plural controllers).

  • Thanks so much for your response. Yes, you are right, it should be Cpstest instead of Cpatest. I made a correction, but it still doesn't work. I'm getting a 404 error after submitting the form. Commented Mar 1, 2017 at 21:26
  • @bestwebdevs - cleared the Magento cache? Commented Mar 1, 2017 at 21:33
  • Yeah, I did, but the error is still there Commented Mar 1, 2017 at 21:40
  • @bestwebdevs - can you add the file/directory structure of your extension to the question? Commented Mar 1, 2017 at 22:12
  • Sure, I did. Please let me know if you need any other information. Commented Mar 1, 2017 at 23:05

I think you didn't activated your extension, to do so make sure that you already created the file:


With the following content:

<?xml version="1.0"?>

Clear the cache, and from admin go to System > Advanced > Advanced and see if the extension name is listed.

  • thanks for your answer. fantasticrice 's updated reply already resolved the issue. Commented Mar 2, 2017 at 1:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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