My magento module is not shown? - magento

I have created a new Magento module which is in
app/code/local/my_module/...
but when I goto magento backend I cant see my module?

1- Create an XML file in etc/modules/ to be able to see your Module in magento-backend
etc/modules/MyCompany_MyModuleName.xml
2- MyCompany_MyModuleName.xml
<?xml version="1.0"?>
<config>
<modules>
<MyCompany_MyModuleName>
<active>true</active>
<codePool>local</codePool>
</MyCompany_MyModuleName>
</modules>
</config>

Related

Overriding adminhtml controller in Magento not working

Sorry for my english.
Just a question. In my magento, when i refresh statistics in Reports / Resfresh statistics, it's okay but it redirects me on the homepage of my website.
I solved this problem by changing two lines code in app/code/core/Mage/adminhtml/controllers/Report/StatisticsController.php.
But it's better to create "an override".
So i decided to create a module in app/code/local/myname/.
I have my file in app/etc/modules myname_all.xml wich contains :
<?xml version="1.0"?>
<config>
<modules>
<MyName_AdminExtras>
<active>true</active>
<codePool>local</codePool>
</MyName_AdminExtras>
Next, I create app/code/local/Myname/AdminExtras/Adminhtml/etc/config.xml which contains
<?xml version="1.0"?>
<config>
<modules>
<MyName_AdminExtras>
<version>0.1.0</version>
</MyName_AdminExtras>
</modules>
<admin>
<routers>
<adminhtml>
<args>
<modules>
<MyName_AdminExtras before="Mage_Adminhtml">MyName_AdminExtras_Adminhtml</MyName_AdminExtras>
</modules>
</args>
</adminhtml>
</routers>
</admin>
And finally, i created a folder named controllers which contains another folder named Report and the file named StatisticsController.php which is calling the base file /app/code/core/Mage/Adminhtml/controllers/Report/StatisticController.php
But it doesn't word. File is not calling by Magento.
What's wrong ?
Hum sorry i found the answer. My folders weren't ok.
I just follow this way :
App/code/local/MyName/AdminExtras/controllers/adminhtml..
instead of
App/code/local/MyName/AdminExtras/Adminhtml/controllers

Magento 1 - module controller not working

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.
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
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>

Overriding Core Blocks

I'm try to overriding Mage_Core_Block_Messages
I'm create module
Mycompany_Core.xml and save in path app/etc/modules/Mycompany_Core.xml
<?xml version="1.0"?>
<config>
<modules>
<Mycompany_Core>
<active>true</active>
<codepool>local</codepool>
</Mycompany_Core>
</modules>
</config>
next I was create in app/code/local/Mycompany/Core/Block/Messages.php
class Mycompany_Core_Block_Messages extends Mage_Core_Block_Messages
{
//update method
}
and add config.xml in app/code/local/Mycompany/Core/etc/config.xml
<config>
<modules>
<Mycompany_Core>
<version>0.0.1</version>
</Mycompany_Core>
</modules>
<global>
<blocks>
<core>
<rewrite>
<messages>Softdk_Core_Block_Messages</messages>
</rewrite>
</core>
</blocks>
</global>
</config>
But i don't see any result on frontend, I'm wonder where I'm make mistake.
Thx for help.
There are two things that caught my eye.
1.) In your module's registration file, it should be codePool and not codepool (as also said by David in comments)
2.) What is Softdk? If that is the name of your new module, then replace Mycompany with Softdk everywhere in your module.
Clear cache and voila!

want to over-ride adminhtml in Magento [duplicate]

This question already has answers here:
Magento - Override adminhtml template file
(4 answers)
Closed 8 years ago.
I have set up a custom theme in Magento admin panel under "Design" tab
I can now put my custom code in
\app\design\frontend\default\MYTHEME\template
instead of
\app\design\frontend\base\default\template
I would like to do the same for the admin panel code. In other words, I would like to selectively replace vanilla code in this directory
\app\design\adminhtml\default\default\template
with custom code, likely in this directory
\app\design\adminhtml\default\MYTHEME\template
Magento does not seem to recognize this automatically.
edit - - -
For the sake of maintainability it would be beneficial to have a global over-ride like we have in 'frontend'. Over-riding module by module in the module layout may not be obvious to next person that looks at the code.
Try
In /app/code/local/MageIgniter/AdminThemeAndMod/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<MageIgniter_AdminThemeAndMod>
<version>0.1.0</version>
</MageIgniter_AdminThemeAndMod>
</modules>
<stores>
<admin>
<design>
<theme>
<default>mageigniter</default>
</theme>
</design>
</admin>
</stores>
</config>
In /app/etc/modules/MageIgniter_AdminThemeAndMod.xml
<!-- /app/etc/modules/MageIgniter_AdminThemeAndMod.xml -->
<config>
<modules>
<MageIgniter_AdminThemeAndMod>
<active>true</active>
<codePool>local</codePool>
</MageIgniter_AdminThemeAndMod>
</modules>
</config>
Then add your newly add/update files to
/app/design/adminhtml/default/mageigniter/layout/
/app/design/adminhtml/default/mageigniter/template/
/skin/adminhtml/default/mageigniter/
for "/app/etc/modules/MageIgniter_AdminThemeAndMod.xml", you mean -
<?xml version="1.0"?>
<!-- /app/etc/modules/MageIgniter_AdminThemeAndMod.xml -->
<config>
<modules>
<MageIgniter_AdminThemeAndMod>
<active>true</active>
<codePool>local</codePool>
</MageIgniter_AdminThemeAndMod>
</modules>
</config>

Magento Module for new CMS layout, but in version 1.7.0.2

I'm trying to simply create a new layout option for a CMS page in Magento. I've followed the instructions here on the Magento wiki to create a module and it does not work. When I make the same addition to the actual core config.xml file, it works fine, but not as a custom module. Based on some research it looks like this would have worked in Magento 1.6, but does not work on 1.7, I'm trying to figure out why. I have the following:
app/etc/modules/Fruit_Banana.xml
<?xml version="1.0"?>
<config>
<modules>
<Fruit_Banana>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Page />
</depends>
</Fruit_Banana>
</modules>
</config>
app/code/local/Fruit/Banana/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Fruit_Banana>
<version>0.1.0</version>
</Fruit_Banana>
</modules>
<global>
<page>
<layouts>
<homepage_middle translate="label">
<label>Homepage</label>
<template>page/homepage.phtml</template>
<layout_handle>homepage_one</layout_handle>
</homepage_middle>
<!-- add more layouts here -->
</layouts>
</page>
</global>
</config>
Any ideas why it doesn't seem to be working as a module? I am using version 1.7.0.2
The local modules should be in the code directory
app/code/local/Fruit/Banana/etc/config.xml
and not in the core directory as you mentioned
app/code/core/local/Fruit/Banana/etc/config.xml
Well seems like I messed up! It does in fact work in 1.7, my problem was I had the filename for config.xml spelled confix.xml
Once I adjusted that, the custom layout popped right up! Thanks to those that chimed in.

Resources