Questions tagged [module]

Questions about developing custom modules

Filter by
Sorted by
Tagged with
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. ...
8
votes
7answers
7k views

How to create simple module in magento 2

I'm new to magento2. I want to create simple Hello World module in magento 2. How to create this module?
12
votes
6answers
31k 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\...
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 ...
33
votes
15answers
50k 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 ...
7
votes
1answer
3k views

Magento2: How to include third pary module through composer.json in custom module

I created a custom module, this module depends on thirt party module(tecnickcom/tcpdf), I added this library in my custom module composer.json file { "name": "packagename/mymodule", "description": "N/...
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 ...
5
votes
1answer
13k views

magento2 how to override model file? [duplicate]

I would like to override (call the below model file from my custom module called Demo_Customprice /vendor/magento/module-catalog/Model/Product/Option/Value.php How could we achieve this?
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 ...
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. ...
23
votes
4answers
10k 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): '...
10
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 ...
6
votes
4answers
1k views

Hide/disable standard shipping when qualified for free shipping

I have read the other suggestions for similar problems but I have not solved my issue yet. I'm using standard shipping (with tablerates.csv) and free shipping on orders over $50 plus a flat rate for ...
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 ...
9
votes
2answers
8k views

How to “add to cart” a product with custom input field and save it to Database?

I had created a custom module in which I am overriding the add to cart form on the product page, and I successfully did it with catalog_product_view.xml file. Now I can see a custom input field on the ...
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.
5
votes
2answers
13k views

Magento 2 - Custom Page Layout

I wish to add a custom home page layout in Magento 2. In Magento 1, it's very simple, i create my module : <?xml version="1.0"?> <config> <modules> <Vendor_Custom>...
6
votes
2answers
5k views

How does translation scope work in Magento 2?

In Magento 1 different modules could provide different translations for the same string and the various __() methods in helpers and blocks always passed a module scope to the translator model, to ...
5
votes
1answer
5k views

How to add new css file for a module in Magento2?

I'm trying add custom css file for my module namely Magento_Hello in magento2. In the module I've created new page and trying to add new custom css to that page. Here is what I have done in app/code/...
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 ...
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 ...
23
votes
10answers
25k 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 ...
8
votes
4answers
8k views

How prevent a model data save using _save_before event

I have create a model which has its own database table. For a customization I need to trigger save_before event of this model. If one field value is not matched, then the data should not be saved. ...
5
votes
1answer
12k views

Magento 2 - Send form data to Controller using AJAX and return Result to PHTML

I am working on a simple custom module, where user can input height and the weight/BMI will be shown as output on form submit. The page where user enters input is Calculation Page while output is ...
10
votes
5answers
22k 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!
7
votes
2answers
7k views

Magento 2: How to override Adminhtml “Shipping & Handling Information” Information

I'm following https://ranasohel.me/2015/10/02/how-to-overwrite-sales-view-order-phtml-file-in-magento2/ I would like to override magento\vendor\magento\module-shipping\view\adminhtml\templates\order\...
2
votes
1answer
467 views

Magento2 : Custom payment Module with Drop down list Is not working

Please check my Custom payment Module, I was able to display the list in drop down in Payment method, But when i select and place order it is not working as expected. Please download the complete ...
19
votes
2answers
20k 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
8
votes
2answers
3k views

Including generated 3rd party PHP library in Magento2

I am creating a module that connects to a SOAP service, I have generated classes for this service using wsdl2phpgenerator which uses autoload.php. Placing this in "lib/" with the correct class namings ...
3
votes
1answer
250 views

What is <fieldsets/ > stands for?

When I have gone through Mage_Bundle module in magento, I found this code snippet inside app/code/core/Mage/Bundle/etc/config.xml. <admin> <fieldsets> <...
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 ...
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/...
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 ...
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 ...
10
votes
4answers
4k views

Magento 2 does not allow linking Modules using symlinks

I've added a local development module (separate git repo) to Magento 2 using symbolic links and it was working fine until I hit the PHTML templates. After heavy debugging I found out that the Magento ...
24
votes
2answers
19k 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 ...
9
votes
1answer
18k views

Create Magento 2 Upgrade Script to add/update new field into custom module table

Anybody have any idea/suggestion about creating Magento 2(CE Stable version) Upgrade Script(in custom-module) for adding/updating new field into custom table ? I know about "InstallSchema" but is ...
6
votes
2answers
830 views

What are the first steps in exploring Magento 2? [closed]

I am planning to start out with Magento 2. Could you please advise me on the first steps of transition from Magento 1 to Magento 2? I have quite little experience with Magento 1 development, but ...
3
votes
2answers
10k views

Magento generate coupon codes programmatically

I would like to create unique coupon codes automatically. I have tried the following - when using setCouponCode() to generate coupon code, i must set static code. Example: $code = "abc"; ...
21
votes
5answers
26k views

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

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

Magento 1 : how to override/rewrite a core controller class?

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

What is the order of execution of setup scripts in a module?

1) Can there be multiple install scripts in the custom module? For example: data-install-1.0.0.php data-install-1.0.1.php 2) Assuming I have the following scripts inside app/code/local/Company/...
8
votes
1answer
21k views

Custom helper in custom module in Magento 2

How to create new Helper or override/rewrite Core Helper in Magento 2 module ? I tried adding dependency into my module.xml of Custom Module, but it doesn't load Helper class at all. Below is my ...
2
votes
3answers
534 views

Installation issue in magento marketplace 'page doesn't contain HIT in cache header.'

I have developed customer module in magento. When i am trying to submit in marketplace its keep giving the same error even after trying so many solutions. Installation issue: http://magento.dev/gear....
5
votes
2answers
9k views

How can i disable module manually in Magento 2

I'd like to know if its possible to manually disable a module by changing some code like in Magento 1. I know the SSH way.
0
votes
3answers
3k views

Magento 2 - add Enable / Disable field for custom module

I want to add some fields in the Magento 2 Admin Panel for my custom module and then I want to check in the phtml file if this field is have value or not. I need to add this fields: - enable / ...
8
votes
3answers
2k views

How to upload a file attachment to custom product attribute using Magento SOAP

This is in relation to my question; how-to-get-a-products-file-attachments I'd like to make a script (not on the server) that can utilize the Intellimage_Attachs module in my other question. I am ...
3
votes
1answer
404 views

observer getting called more than once

i wrote below observer to add extra price to product price based on get paramter id of product <catalog_product_load_after> <observers> <setcustomprice> ...
2
votes
3answers
1k views

Magento 2 Web API pre/post dispatch events (REST/SOAP)

Is there any pre/post dispatch events for the Magento 2 web API (REST/SOAP) ?
10
votes
2answers
18k views

How to overwrite core template files from a custom module?

I want to overwrite two files. Namely the view.phtml and print.phtml of sales orders. (path: app/design/frontend/base/default/template/sales/order/) I am creating a module in which I want to create a ...