Questions tagged [module]

Questions about developing custom modules

Filter by
Sorted by
Tagged with
6
votes
4answers
248 views

How to manipulate templates without copying them, for example in an extension?

If I write extensions it is often unavoidable to install small pieces of code into core templates (if there are no appropriate layout templates). How do you handle this situation? How do to inject ...
6
votes
1answer
422 views

Custom Module for Custom Column using Plugin Yes/No option

I have been digging all day trying to figure out a way to enable/disable the plugins of my custom module with system configuration yes/no. Basically, I have a custom module that adds the Company ...
6
votes
1answer
1k views

How does the payment gateway works in Magento 2?

I want to integrate my own payment gateway in Magento 2. I've read many topics, studied the sample code from the Magento 2 repository and the braintree module. However I've not found great posts ...
6
votes
1answer
101 views

Magento 2 build in modules/functionality investigation workflow

I am new at writing difficult front-end modules like one page checkout or... . Associated with this i have a question. When I want to investigate(find out) how magento 2 module located in vendor/...
6
votes
2answers
1k views

Magento 2: require.js error when disabling wishlist module

When I disable module Magento_Wishlist in admin (Stores->configuration->advanced->advanced) I get the following error in frontend (js console): Uncaught Error: Script error for: ...
6
votes
1answer
241 views

How to install module-sample-scss in Magento 2

I'm trying to install this module (magento/module-sample-scss) in Magento 2 with composer as described here, but with no success. If I run this from the Magento root folder: $ composer require ...
6
votes
1answer
3k views

magento 2 add/call css file in email template of custom module

I am trying to add inline CSS in the email template in my custom module. Example <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> &...
6
votes
1answer
266 views

How to override Interface of Other custom module?

I have tried with preference to override interface as below in di.xml file <preference for="Custom\Module\Api\Data\AccountInterface" type="Override\Module\Api\Data\AccountInterface" /> <...
6
votes
0answers
98 views

How to do the same controller action to create an image for one button but not for another?

We are calling same controller action for 2 buttons for create product pro-grammatically and assign a custom image for that product. 1. create - custom image uploading for newly created product 2. ...
6
votes
0answers
284 views

Magento2 : custom rate for shipping method

In magento2 - I want to use custom price for one of my shipping method per quote. I want to show custom amount for only current quote. how to do it. Like there is a shipping method. "CUSTOM FLAT ...
6
votes
1answer
896 views

Watermark Category Images with Brand Logo

I'd like to add a watermark to each small image (but only in the category listing page) that is based on the manufacturer attribute. I don't want to alter the small image for that product on other ...
5
votes
7answers
29k views

Magento module is not creating the database table?

I am doing a module in Magento (1.7.2). In that module, I want to create a database table. I have used all the codes properly. But still, I can't see the database table in phpMyAdmin. In /app/etc/...
5
votes
2answers
12k 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.
5
votes
2answers
10k views

Magento2 - Missing required argument

I'm trying to create a block I can call in my override of 'root.phtml'. In the root file, I added some extra classes to the body depending on the url, so I've created a module which I call on this ...
5
votes
1answer
20k 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?
5
votes
1answer
890 views

Does a complete “config.xml” reference exist?

I am in the process of writing some in-house documentation that goes a bit beyond the "hello world" examples that populate the internet and would like to start a complete reference wiki on some of the ...
5
votes
2answers
4k views

Is It Possible To Create My Own Shortcode

I'm building a module. I want to be able to use a shortcode (template directive) in my CMS static blocks, such as the following: {{store url=""}} I want to call my own module's frontpage blocks ...
5
votes
4answers
661 views

How can i protect my module

I have a couple of modules that I have created and will be to consider that I may take action of selling those on Magento Connect marketplace. Aside from only adding a license docblock and terms/...
5
votes
1answer
1k views

Can I use a .sql file in my Magento module installer?

I have a large SQL file. Can I use this in my module installer?
5
votes
2answers
16k views

How do I modify Magento rendered page before it's displayed?

I am trying to modify the rendered page content before it's displayed to the user. I would like to do this in my custom module. So far, I have tried hooking into the cms_page_render event but: it ...
5
votes
1answer
13k views

Magento 2: Creating a custom layout

I'm having trouble creating a custom layout. I have successfully created a layout called home_page.xml which is a copy of the default 1column layout. I have selected this layout for my home page, ...
5
votes
3answers
6k views

New module router index 404 error

I'm attempting to build a module but I can't even get the url routing to work as it keeps responding with a 404. I've follow this tutorial in an attempt to get it working but I still get a 404 page ...
5
votes
2answers
2k views

How to install modules in app/code with composer in Magento 2

How can I force composer to install modules in app/code instead of vendor directory in Magento 2? I have few modules they strictly need to be install in app/code, but when I update them with ...
5
votes
4answers
350 views

What is the proper way to add theme-specific translations of new strings?

We are creating a new template and have some new text which are not yet defined anywhere. If they would be defined before we would add some "Mage_TheModule::Foo";"Fuh" to the translate.csv in the ...
5
votes
1answer
439 views

<module>…</module> vs <namespace_module>…</namespace_module> in config.xml Magento

I am new into Magento development, I have created some basic modules also with the help of available tutorials. However, I am not able to understand the difference between <module>...</module&...
5
votes
1answer
3k views

Magento 2 - editing module structure and functions

in Magento 1.x you could duplicate the extensions to app/design/frontend/themeName/default/template/or/layout and then modify it's layout or functionality via xml or phtml files. How do we duplicate ...
5
votes
1answer
6k 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/...
5
votes
3answers
4k views

Get new empty item on model method

Collections provide a handy means of getting a blank model - e.g.: $quote->getItemsCollection()->getNewEmptyItem(); Is there any means of doing this from an existing model without having to ...
5
votes
3answers
2k views

Custom module dynamic action controller

Each controller I need to define how many action can be like saleAction() , productAction() something else. But I want to make a action who receive all action like ......Action() It's receive all ...
5
votes
1answer
2k views

Module Config File: what are resource connection definitions for

I searched for that information quite a while but did not found any explanation. Many examples and tutorials for custom modules with custom database tables suggest the following for the config.xml ...
5
votes
2answers
1k views

When would you place a module in the app/code folder versus another location?

When would you place a module in the app/code folder versus another location? If I add new module in app/code folder with composer.json and another module in vendor folder using composer What ...
5
votes
2answers
6k views

How to Override Module CSS in Custom Theme?

I am using Magento 2.1.3 EE and my custom theme is using Luma as it's parent. I am trying to override a third-party module's CSS in my custom theme. I am not using LESS. When I say override, I mean ...
5
votes
1answer
2k views

How should I define and use a custom module Exception?

I want to create a custom Magento exception class for my module. Are there any rules for how I should do it? Where should I put the new class? How should it be thrown? I'm familiar with Mage::...
5
votes
3answers
5k views

Magento 2 requesting external REST API

I want to call a 3rd party REST API within Magento 2. Is there any class to handle the HTTP requests and responses for that?
5
votes
7answers
8k views

Frequent Css and js changes not reflecting Magento 2 in Windows environment

I am modifying a module which uses css and js. OS : WINDOWS Magento Mode : Developer What I've tried : php bin/magento setup:static-content:deploy php bin/magento indexer:reindex deleted cache ...
5
votes
2answers
558 views

How to add min value for a field in custom Module system.xml file?

I want to add minimum value attribute for a admin interface field in my custom module. Can anyone suggest me how I can add min attribute in field? Here is my system.xml code: <field id="...
5
votes
2answers
472 views

How to use Custom Module Js to RequireJS

I add my custom Module to JS to requirejs-config.js File var config = { paths: { 'Test/jquery':"Test_Header/js/jquery.min" , 'Test/popup':"Test_Header/js/jquery....
5
votes
1answer
6k views

get Admin controller URL in magento 2

Here is my Directory structure of controller file in Magento 2 - app/code/Namespace/Modulename/Controller/Adminhtml/Blacklist/Index.php In Index.php i write the below code - namespace Mynamespace\...
5
votes
2answers
11k views

How to “reload” a custom module after code changes

I've made several custom modules for i.e. adding attributes to categories. This is all the first time for me, so I set up the module the first time, enabled it and all is fine so far. But when I go ...
5
votes
1answer
7k views

Module created gives Error filtering template: {Classname} does not implement BlockInterface

I need a way to show products from a category and created a module following the advice of this answer of Marius (https://magento.stackexchange.com/users/146/marius) here: Magento 2: get product ...
5
votes
1answer
2k views

Error - “Object DOMDocument should be created” keeps appearing. Magento 2

I created a custom module, that was throwing back errors. So I disabled and removed it from the app/code dir. Then I cleared pub/static, var/generation, var/cache, var/view_processed But I still ...
5
votes
1answer
4k views

composer install magento 2 module fails

I am trying to install a module which i created in magento 2 via composer, I have hosted the module on the bitbucket repository, and added the repository url in magento's composer.json, When i try to ...
5
votes
1answer
884 views

Test Driven Development with Magento

I am interested in unit testing in magento and have started looking at the ecomdev module. However, i dont think it is going to be possible to do full tdd with magento. For the following scenarios ...
5
votes
1answer
2k views

How to override template files in a module

I have two template files that I need to override in a custom module. Those files are app/design/frontend/<current-theme>/template/catalogue/category/view.phtml app/design/frontend/<your-...
5
votes
1answer
2k views

Magento + Modman Module Development

Just a quick question in regards to version control using github + modman. I understand how both work and can use both independently fine. However my query is the following:- We version control every ...
5
votes
1answer
1k views

Logged In or Not check works only in Customer pages not other pages Magento 2

User logged in or not checking not works in other pages such as Product, Category and other static pages but its works well on customer pages like Dashboard, Address book, Orders etc... Here is my ...
5
votes
2answers
7k views

custom module + cron

I have a little problem (which should be easy to solve), with a custom module I try to execute through crontab. For now, the only thing it is supposed to do is to print a log entry in dev.log file. ...
5
votes
2answers
1k views

Why core session is empty?

I have a custom module, which basically adds social media login in magento. However I am facing an issue with core/session which I dont know how to resolve. I am adding my custom blocks in customer ...
5
votes
2answers
4k views

Correct usage of jstranslator.xml

I'm attempting to translate the error messages returned by the Postcode Anywhere module. They're displayed in browser alerts, so are created in JavaScript. I managed to translate one using the inline ...
5
votes
1answer
422 views

Plugin for aroundSavePaymentInformationAndPlaceOrder Throwing Error

I have a plugin that i want to intercept aroundSavePaymentInformationAndPlaceOrder, but it is giving me an error. Here is how it is set up: Vendor/Module/etc/di.xml <?xml version="1.0" ...

1 2 3
4
5
61