Questions tagged [module]

Questions about developing custom modules

Filter by
Sorted by
Tagged with
5
votes
1answer
2k views

Magento 2 : User Role and Permission Issue (ACL Issue)

In my magento2, I have created one user role with custom permission in which I give permission only for "Shipping Methods" to user. When I login with this user, it also show me other custom extension ...
5
votes
3answers
5k views

Magento 2: modules are not listing in admin panel

On my test server, every installed extensions are not listing in admin panel under Stores > Settings > Configuration > Advanced > Advanced. And if the extension has configuration parameters ...
5
votes
2answers
3k views

Data install script wasn't run

I've created an installer script which does its job, but the data-install script doesn't seem to be running and I'm not sure why. Here is my data-install script: <?php $defaultCategories = ...
5
votes
1answer
67 views

How Magento registers new module?

While doing setup:upgrade What Magento actually does to register the unregistered module !!, Can anyone define the flow? Actually I want to send a notification to admin whenever a new module is ...
5
votes
0answers
29 views

create invoice module same as Admin side in magneto 2 [closed]

How to Create an invoice module the same as the Admin side in Magento 2?
5
votes
0answers
470 views

Custom Model Relationship (CMS Page + Product)

I am trying to assign a Product Object to a CMS Page Object, so when you have the CMS Page Object, you can do something like this: $product = $page->getProduct(); I have modified the CMS Page ...
5
votes
0answers
81 views

StoreRepository get($code) which does not exists

Till today all the code was okay, but after code review, I got that we use the method load() on the store itself so I replaced it with storeRepository->get($code) Code what I'm talking about ...
5
votes
1answer
1k views

I need to add a extra field in product rest api response - Magento 2

I want to add a field "slider" in /rest/V1/products/:sku I created a custom module and in my di.xml i have added the following code <?xml version="1.0"?> <config xmlns:xsi="http://www.w3....
5
votes
4answers
4k views

Magento 2 - Backend custom module 404 error

I'm trying to create my custom module in the back-end, I followed a lot of tutorials, but I continue to get 404 error when I try to access to my controller. The only thing that work fine is the menu ...
5
votes
0answers
141 views

Magento 1.9x - Include Dataflow Profile Functionality for Import operation into my custom module

I have created custom module for import operation by uploading csv, xls and ods files. It is working good, but now i need to include Dataflow Profile Functionality into my module. That means I have a ...
5
votes
2answers
2k views

Create custom “Catalog Input Type for Store Owner” for magento 2

I need to create a special input type in adminhtml product form. My input will display as a table but save data as a standard text input. Following the module Edge ProductAttachments I've created the ...
5
votes
2answers
3k views

Magento 2: How to add additional fields to newsletter subscriber table? [closed]

I would like to add some additional fields to the newsletter table. How do I go about rewriting the Newsletter subscriber table to add those fields? I am expecting to add things like firstname, last ...
4
votes
3answers
13k views

Disable modules via database

I don't have access to the backend and need to disable all the modules. How can I disable them via database?
4
votes
4answers
16k views

Dynamic page title on custom module

Where and how to set titles in custom module? I got a custom (but close to standard) news module with router,controller,etc ... and want to set title for single news view dynamically. Please let me ...
4
votes
2answers
11k views

Create global variable for Magento

I'm looking for a right way to create global variables in Magento that I can use it on every view page. I have some solution in mind but I don't if it's good enough. Create a module which provides a ...
4
votes
1answer
12k views

How to use the collectRates method in a shipping module to collect table rates

I am creating a shipping module that will use table rates for determining the amount to be charged for shipping. My question is, do I use the collectRates method in the shipping module to display the ...
4
votes
2answers
20k views

How To Create a Custom Block in Custom Module?

I have followed a tutorial to create the block. All codes are in here http://www.pierrefay.com/magento-create-block-44 but I cant seem to connect to the template file, no matter where i put it. i ...
4
votes
3answers
4k views

Where to declare a magento registry value

I have a custom module, which uses the sales_order_place_before observer. I have a set of code in there which scans through the products, and adds items to the order, where necessary. However, I have ...
4
votes
2answers
2k views

Magento 2: update an existing backend menu item

Let's say there's a module that declares a custom admin menu item via menu.xml like this: <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
4
votes
2answers
2k views

My admin module yields helper not found error on dashboard page

I've stripped my module down to try and identify this error. The following are my files. Can you see why I get the error "Fatal error: Class 'Mage_Caitlinhavener_Addschool_Helper_Data' not found in /...
4
votes
1answer
4k views

How to define multiple routes in single module

I am defining two routes to be used in same module. <router id="standard"> <route frontName="hello" id="hello"> <module name="HelloWorld_Hello"/> </route> ...
4
votes
1answer
7k views

Using Magento 2 custom cache in custom module

@Rakesh explains how to add custom cache in Magento 2 here. My question is how to actually work with my custom cache in Magento 2? In Magento 1 you would do something like: $cacheId = 'example_id'; ...
4
votes
1answer
5k views

Magento 2: Check condition on Click of “Proceed to Checkout”

May be I need to create Event Observer. I would like to check Product's Type Condition & Display Message Accordingly on Shopping Cart Page. <event name="...
4
votes
2answers
2k views

before and after module in route.xml - magento 2

can anyone explain what is the right situation to use before and after attribute in route.xml? <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
4
votes
1answer
7k views

Magento: add button on order view page with custom module

I want to add a button on the Order View page of the Admin. I created a custom module in app\code\community\CPT\TCS and added subfolders Block, controllers, etc, Helper, Model, sql This is my ...
4
votes
2answers
3k views

Constructor for Magento Controller

I need constructor or init function that can be run for my custom module. I need to call it every time when request made to my module's controller in magento.
4
votes
2answers
4k views

Define Multiple Table Names In XML Config File

I am creating two database tables as part of a new extension. I can create one table just fine, but I get the following error message when I try to create two tables: PDOException: SQLSTATE[42S01]: ...
4
votes
2answers
13k views

Setup version for module 'Namespace_Modulename' is not specified : Magento 2 [duplicate]

I am creating an module in Magento 2 ( ver. 2.0.0). I have registered my module in app/etc/config.xml 'Namespace_Modulename => 1, My module.xml file under app/code/Namespace/Modulename/etc/module....
4
votes
1answer
4k views

Can't Save Role Resource for Custom Module

I've created a custom module and my adminhtml.xml is as follows... <config> <menu> <web translate="title" module="adminhtml"> <title>Custom</title> &...
4
votes
1answer
6k views

How to Uninstall modules in Magento 2 using composer?

How to Uninstall modules "ub data migration" in Magento 2 using composer
4
votes
1answer
7k views

window.checkoutConfig Javascript (usage)

It seems that Magento 2, with the default theme, has a JS object window.checkoutConfig which has all the cart information, and is updated when you change the cart. Is it safe to assume this will be ...
4
votes
2answers
132 views

Marshalling in Magento2

According to Magento2 Doc By default, when you install a package, Composer puts it into vendor/<package> directory, such as vendor/magento-module-catalog. However, the Magento framework requires ...
4
votes
1answer
8k views

Hook into “order shipped” event and get order id for order shipped

I have created a module that hooks into the sales_order_shipment_save_after event. I have tested the hook is working with Mage::log, My question is, how do I get the order id for the shipment that ...
4
votes
2answers
7k views

Custom Shipping Carrier Not Showing Up For getCarriers Method

I have created a custom shipping module with a custom carrier, however, the custom carrier is not showing up when grabbing the carriers... To Grab the carriers I am using the following snippet $...
4
votes
3answers
2k views

How to remove confirm password field?

I want to remove the confirm password validation field in my registration form. How could I do it?
4
votes
4answers
9k views

Magento 2 module “Object domdocument should be created” error

I am getting above error when I run my module in browser as: 192.168.0.106/magento-2/module1/index/index Below is my Controller code: <?php namespace Company1\Module1\Controller\Index; class ...
4
votes
3answers
6k views

How to set HTTP Response Code in Custom REST API

Hi Guys for a project i try to extend the Magento REST API. I have some problems with my error handling. I don't know how to send the right Http Response Code. I tried it with something like this: ...
4
votes
1answer
352 views

Magento ACL recursive permissions?

I have a module that adds a new menu in the backend. I have the acls defined and they work: <acl> <resources> <admin> <children> <...
4
votes
3answers
5k views

Module Database setData() makes UPDATE Query instead of INSERT?

in my own module I want to INSERT the orderId to my own DB Table. $data = array( 'order_id' => $order->getId() ); $model = Mage::getModel('magic/test')->setData($data); try { $model->...
4
votes
1answer
8k views

“Save and Continue Edit” button is not working properly

I have a form in my module, and now I want to add the new button to it i.e. Save and Continue Edit button. I added this button but it is working partially, means it is saving the values in the ...
4
votes
2answers
920 views

Constr is not a constructor on layout.js line 137 error custom module

I have gone through this posts and tried to implement the answers and suggestions Magento2 getting 'Constr is not a constructor' error for custom theme && Error in layout.js, cart ...
4
votes
2answers
3k views

Magento2 : How to add Observer for catch when new order placed

I wanted to save the orders from magento2 to my local Database. I am planning to Create a module and add Observer to catch once a order is placed. I don't know much about the Events & observer, ...
4
votes
2answers
143 views

Issues on create Magento 2 module

I create a module for Magento 2 to add a custom javascript to the theme head but my custom js file is loaded in front off all javascript files and this come with the error: ReferenceError: jQuery is ...
4
votes
2answers
509 views

how Magento validate XSD schema?

As we all know that Magento 2 uses XSD schema files to validate the contents of all module configuration files. But at that point, I have one question in my mind. How does Magento validate XSD ...
4
votes
2answers
1k views

I created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error? [duplicate]

Recoverable Error: Argument 1 passed to Webkul\Grid\Controller\Adminhtml\Grid\Index::__construct() must be an instance of Magento\Backend\App\Action\Context, instance of Magento\Framework\...
4
votes
1answer
179 views

How to get modules list inside particular namespace

I am trying to get all the modules names inside the particular Namespace
4
votes
2answers
701 views

Magento 2: good practice regarding custom module README.md

As you may have noticed, every Magento 2 core module contains a README.md file. Example for the Magento_Catalog module: Magento_Catalog module functionality is represented by the following sub-...
4
votes
2answers
3k views

Magento 2: how to set grid getRowUrl via the uiComponent

In my current Magento 2 module developement, I currently have the following code in my Grid.php file: public function getRowUrl($row) { if ($id = $row->getMageProd()) { return $this-&...
4
votes
1answer
2k views

Module disabled in app/etc/modules is still showing in admin in Disable Modules Output

I have changed the active parameter from true to false in a module's app/etc/modules/Namespace_Module.xml file, and flushed the cache. I've also logged out and then in again. However, the module is ...
4
votes
2answers
91 views

Unable to get Module Cronjob working

I've seen a few other questions about this with similar issues, but I can't seem to duplicate their fixes with my structure and Namespace/Moduel name etc. I've got the following files: Namespace/...

1
3 4
5
6 7
61