Questions tagged [module]

Questions about developing custom modules

Filter by
Sorted by
Tagged with
143
votes
5answers
11k views

How to write a custom extension?

Because I had a lot of issues lately with free and commercial extension I've decided to ask this question and answer it with the steps I usually follow when writing an extension. Feel free to edit the ...
64
votes
3answers
63k views

Adding custom attribute to Customer

We need a simple way to add an attribute to a customer record that is not editable by the customer or admin, only programatically. Essentially, we have an ExpressionEngine site coupled with Magento. ...
36
votes
6answers
41k views

Debugging layout XML loading

TL;DR: is there a way I can debug the loading of the layout? As I believe one module's layout is conflicting with another. Related to a previous question I made: How to make a module layout to be ...
35
votes
6answers
6k views

How to create an EAV entity?

How to create an EAV entity? This is a question that pops up a lot on the web. There are some good blog articles that explain how to do that, but none of them are satisfying for me. So I decided to ...
33
votes
15answers
52k views

Magento 2: Safe and easiest way to disable Compare products & Wishlist Module

I am building Magento 2.0 only to sell 2 of my products online. The compare products and wishlist module is irrelevant for me. How I safely and easily remove those modules? I dont want to hack the ...
27
votes
4answers
7k views

Disabling modules - performance improvement?

This question has 2 parts: Does disabling core modules improve overall performance of the store and if so, do they need disabled in the admin (i.e. disable frontend output) or disabled via config.xml ...
26
votes
5answers
9k views

Why does Magento have 3 code pools?

Magento has three code pools: community core local Core: It contains all Magento default modules Community and local: We use these code pools for our custom module development. Now I have doubt ...
26
votes
3answers
3k views

What is the difference between an Extension and a Module?

What is the difference between an Extension and a Module? Just curious to know that what is the right term to use when we extend Magento's functionality by creating our custom code in local folder.
25
votes
4answers
6k views

What Default Modules I can disable?

From this question and Sander Mangel answer: Disabling modules - performance improvement? First of all, less modules means less code to (potentially) load and process. Next to that, a lot of ...
24
votes
2answers
20k views

Magento 2: Default Values for `system.xml` Configuration

In Magento 1, it was possible to Configuration a user interface for the System Configuration section in etc/system.xml files Set default values for those fields in the etc/config.xml files Behind ...
24
votes
2answers
31k views

Creating a custom helper class in module

I've made a new module called test_helper and I want to create a helper class in this module so that I can add custom functions to be called all over my site. I can't however seem to find any ...
23
votes
11answers
26k views

How to disable Magento 2 reviews

I'm trying to disable the Magento 2 product reviews feature. I tried Disabling the Module at the Magento 2 admin Stores\Advanced\Advanced\Magento_Review but the reviews tab on each product is still ...
23
votes
2answers
1k views

Magento 2: what are the benefits of using UI grid components over the standard Grid.php?

So Magento 2 introduced the UI Components. One of them is the UI Component Grid (you can find more information about it here: Explanation of UI Component Grid in Magento 2) When creating a custom ...
23
votes
4answers
11k views

Magento2 CLI module:enable gives error “Unkown module(s)”

In Magento2 I've built a simple custom module and want to enable it by CLI: bin/magento module:enable Vendorname_Modulename But it is giving me the following error: Unknown module(s): '...
22
votes
5answers
27k views

Magento 2: How to get controller, module, action and router name?

Magento 2: How to get controller, module, action and router name?
22
votes
5answers
12k views

Managing Magento csv Translation Files

As time has passed, the Magento core team has added more and more default language packs to the app/locale folder. Is there a canon way to manage your own translation files such that they don't ...
22
votes
2answers
4k views

Magento 2: Where do Third Party Modules Go?

I just installed the first official release of Magento 2. I was surprised to find that the app/code folder was gone app/code This was for both the version downloaded from the website and the ...
19
votes
2answers
21k views

Magento 2.1.1 How to load Order with Increment ID using OrderRepository object

What would be the latest best practice to load Order using increment ID (instead of Order ID) using OrderRepository
19
votes
2answers
2k views

List of not-used core modules that can be turn off with no harm

Reffering to this this topic for Magento 1, maybe it would be useful to prepare a list of core Magento 2 modules that can be turn off or completely removed with no harm for our store, because they are ...
18
votes
7answers
15k views

Strange Error when running setup:upgrade after module installation

I have tried to install wyomind google shopping and have the following error when running bin/magento setup:upgrade. [UnexpectedValueException] Unable to retrieve deployment version of static files ...
18
votes
2answers
4k views

What's a hard dependency and what's a soft dependency?

In Magento 2 (any stable version) you can run this command bin/magento info:dependencies:show-modules and you will get a csv file in the root of your application called modules-dependencies.csv with ...
18
votes
2answers
4k views

Magento 2: How to Check if a Module's Installed

In Magento 2, is it possible to check if a module's installed at runtime? In Magento 1 I'd either use the isModuleEnabled helper method, or manually fetch the global configuration tree and check the ...
18
votes
1answer
2k views

Patch 5994 is causing module Adminhtml 404 Status Error

I applied the Patch 5994 the other day and it has caused the admin section of a module I build to throw a 404. Has anyone else had this. The module is fine on the frontend though. It's Magento 1.8.1....
18
votes
3answers
3k views

Property does not have corresponding setter in class Magento\Quote\Api\Data\AddressInterface while change checkout step

1 - I add a eav attribute to customer_address $attributesInfo = [ 'reference' => [ 'label' => 'Reference', 'type' => 'varchar', 'input' => 'text', ...
17
votes
4answers
14k views

Why `code` folder is missing under `app` folder in magento 2 stable version?

I have downloaded Magento 2 stable from https://www.magentocommerce.com/download with sample data and installed. It's working fine in both areas i.e. frontend & backend. But I could not find app/...
17
votes
3answers
16k views

how to connect another database from magento

Is it possible to connect to another database from Magento and accessing data? If I need to create a module, how can I create a module to access another database? Is there any tutorial which tells ...
17
votes
1answer
4k views

Magento 2 Enterprise: Create New Module in vendor directory

I tried to create new module in vendor directory in Magento Enterprise 2.0.0. The module could not be loaded after I ran the Magento setup:upgrade. If I move my files to the app/code directory, the ...
16
votes
5answers
7k views

what is the difference between disable module output and module active = true

In magento I come to knew that we can disabel our module by two ways By navigating in the Magento backend to System > Configuration > Advanced > Disable modules output we can easily disable certain ...
15
votes
5answers
11k views

Magento 2: How to set custom template for core block

I'm trying to override the register.phtml in my module, but it seems there are some config problem that make Magento unable to use my custom template to override the one in core module. I've checked ...
15
votes
2answers
7k views

How should I licence my module?

I have a module which I have written for my company. It takes data from our back office solution and imports it into Magento. It also takes orders from Magento and imports them into the back office ...
15
votes
2answers
619 views

Create Employee Module like Customer module in magento 2

I have created Employee module. same as customer module. i have copied all files from vendor/magento/module-customer to app/code/Magento/Employee. I replaced customer with employee. but it shows an ...
14
votes
2answers
32k views

Adding custom layouts for CMS and Category use with custom module trouble

I have a category in my store that requires a totally different layout to the standard Magento layouts. So I created a new copy of the 1column.phtml and renamed it and made one small change to test. ...
14
votes
2answers
19k views

How to get data from config.xml of a module

In the module A I need to get some data from file config.xml of modules B and C. Are there any methods or classes dedicated for this? Especialy I need to get XML structure and values of node <...
14
votes
4answers
2k views

When to dispatch events in a custom module?

This is a question regarding both Magento 1 and Magento 2. I understand that, as a good practice, 3rd party modules developers are encouraged to dispatch events in their custom module to make it ...
14
votes
3answers
1k views

Magento 1: improving my module development workflow (Modman, composer, git)

This is something I've had in mind for quite some time but I can't find the right method to do it. So basically, I'm working with 6 different websites, all running Magento CE 1.9.2+ On those ...
13
votes
6answers
32k views

How to override .phtml files in Magento 2

I want to customize product details page, So it required to override some .phtml files in following locations. So I want to know, how to override .phtml files in vendor\magento\module-catalog\view\...
13
votes
1answer
4k views

Magento 2 uninstall module

Apparently, now Magento 2 supports uninstall scripts that allow db schema modification when uninstalling a module (horay!!). As explained in here this only works for module installed via composer. (I ...
13
votes
4answers
6k views

How to show a custom attribute in the admin Shipping Address box?

I have added the drop-down custom field on the checkout page with custom values. It's working fine also save attribute values in the database but not display in the order shipping address. Any idea ...
12
votes
3answers
4k views

How to override Virtual Type class in Magento 2

How to override VirtualType block in Magento 2, I want to override following virtual type block with my own block, <virtualType name="Magento\CatalogSearch\Block\SearchResult\ListProduct" type="...
12
votes
3answers
30k views

Magento new custom block module

I'm using Magento version 1.8.1.0. I'm trying to create a new custom block module, which I'll use for creating a new home page. Namespace: Crusader Module: CLHomePage Block Type: crusaderhome Class:...
11
votes
7answers
31k views

Magento 2 - How to uninstall module?

How to uninstall module ? I read this document: http://devdocs.magento.com/guides/v2.0/install-gde/install/cli/install-cli-uninstall-mods.html#instgde-cli-uninst-mod-uninst But it was not succcessful,...
11
votes
2answers
20k views

Setting a default value for a config defined value?

How can I assign a default value to a config value, which i am defining in a system.xml file? Currently it defaults to 'no', but i want it to default to 'yes'. Here is my current definition code: &...
11
votes
3answers
13k views

How do I override/rewrite a block class in Magento 1?

Note: This is intended as a canonical question that fully explains how block rewrites work and can be used as duplicate target for more specific "How do I override block X" or "Why does my rewrite not ...
11
votes
3answers
13k views

Magento2 REST API Error 'Class does not exist'

I've created a test Magento 2.0.2 REST web service based on Alan's blog: http://alankent.me/2015/07/24/creating-a-new-rest-web-service-in-magento-2/ I'm using Postman to call the custom web service ...
11
votes
1answer
12k views

Custom module: Access denied (ACL Problem)

I created a module, and it works perfectly; however, I hit a wall. When I'm logged in as admin, everthing is good. I added this in the acl: <?xml version="1.0"?> <config> <menu> ...
11
votes
2answers
8k views

Magento 2 How to uninstall attributes added by custom module?

So far I know that when uninstalling a custom module, it is possible to remove custom tables or columns added by custom module by using uninstall.php which extends \Magento\Framework\Setup\...
11
votes
1answer
4k views

How do I make my custom module pages use SSL?

I've created a Module with some pages and I'm wondering how do I force this pages to use SSL on the url, like the customer login page. Not all of the pages need it, but some do. What comes to mind (...
10
votes
5answers
23k views

Magento2 : How to get product id to my custom module

I am new to magento2 and currently I'm building a custom module and i want to get the product ID/SKU from the catalog. I'm trying to call using a function located in the Block folder. please advise!
10
votes
2answers
7k views

How can I set configuration values in Magento 2?

Previously (in Magento 1, that is) we created a module called Setup which contained setting for the site. The upgrade scripts looks something like this: $installer = $this; $installer->startSetup()...
10
votes
2answers
4k views

Magento 2: how to create your own custom cache type?

In Magento 1, it was possible to create your own cache type by declaring the following in your config.xml: <global> <cache> <types> <custom translate="...